Skip to content

Commit d2de632

Browse files
committed
add different color schemes
1 parent 5bf8826 commit d2de632

11 files changed

Lines changed: 138 additions & 73 deletions

File tree

.github/workflows/build.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and dev release
1+
name: "[Dev] Lint, build and release"
22

33
on:
44
push:
@@ -52,7 +52,11 @@ jobs:
5252
- name: Cache CSS
5353
uses: actions/cache@v3
5454
with:
55-
path: assets/gh-theme.min.css
55+
path: |
56+
assets/gh-base.min.css
57+
assets/gh-dimmed.min.css
58+
assets/gh-light.min.css
59+
assets/gh-dark.min.css
5660
enableCrossOsArchive: true
5761
key: ${{ runner.os }}-mincss-${{ hashFiles('utils/package-lock.json') }}
5862
restore-keys: |
@@ -68,7 +72,11 @@ jobs:
6872
- name: Load minified CSS
6973
uses: actions/cache@v3
7074
with:
71-
path: assets/gh-theme.min.css
75+
path: |
76+
assets/gh-base.min.css
77+
assets/gh-dimmed.min.css
78+
assets/gh-light.min.css
79+
assets/gh-dark.min.css
7280
enableCrossOsArchive: true
7381
fail-on-cache-miss: true
7482
key: ${{ runner.os }}-mincss-${{ hashFiles('utils/package-lock.json') }}
@@ -83,7 +91,10 @@ jobs:
8391
with:
8492
name: files-v${{ steps.appVersion.outputs.version }}
8593
path: |
86-
assets/gh-theme.min.css
94+
assets/gh-base.min.css
95+
assets/gh-dimmed.min.css
96+
assets/gh-light.min.css
97+
assets/gh-dark.min.css
8798
assets/config.yml
8899
- name: Upload binary to release
89100
uses: softprops/action-gh-release@v1
@@ -96,5 +107,8 @@ jobs:
96107
tag_name: v${{ steps.appVersion.outputs.version }}
97108
name: v${{ steps.appVersion.outputs.version }}
98109
files: |
99-
assets/gh-theme.min.css
110+
assets/gh-base.min.css
111+
assets/gh-dimmed.min.css
112+
assets/gh-light.min.css
113+
assets/gh-dark.min.css
100114
assets/config.yml

.github/workflows/release-manually.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and release
1+
name: Build for release
22

33
on:
44
workflow_dispatch:
@@ -49,7 +49,11 @@ jobs:
4949
- name: Cache CSS
5050
uses: actions/cache@v3
5151
with:
52-
path: assets/gh-theme.min.css
52+
path: |
53+
assets/gh-base.min.css
54+
assets/gh-dimmed.min.css
55+
assets/gh-light.min.css
56+
assets/gh-dark.min.css
5357
enableCrossOsArchive: true
5458
key: ${{ runner.os }}-mincss-${{ hashFiles('utils/package-lock.json') }}
5559
restore-keys: |
@@ -65,7 +69,11 @@ jobs:
6569
- name: Load minified CSS
6670
uses: actions/cache@v3
6771
with:
68-
path: assets/gh-theme.min.css
72+
path: |
73+
assets/gh-base.min.css
74+
assets/gh-dimmed.min.css
75+
assets/gh-light.min.css
76+
assets/gh-dark.min.css
6977
enableCrossOsArchive: true
7078
fail-on-cache-miss: true
7179
key: ${{ runner.os }}-mincss-${{ hashFiles('utils/package-lock.json') }}
@@ -80,7 +88,10 @@ jobs:
8088
with:
8189
name: files-v${{ steps.appVersion.outputs.version }}
8290
path: |
83-
assets/gh-theme.min.css
91+
assets/gh-base.min.css
92+
assets/gh-dimmed.min.css
93+
assets/gh-light.min.css
94+
assets/gh-dark.min.css
8495
assets/config.yml
8596
README.md
8697
VERSION.txt
@@ -95,7 +106,10 @@ jobs:
95106
tag_name: v${{ steps.appVersion.outputs.version }}
96107
name: v${{ steps.appVersion.outputs.version }}
97108
files: |
98-
assets/gh-theme.min.css
109+
assets/gh-base.min.css
110+
assets/gh-dimmed.min.css
111+
assets/gh-light.min.css
112+
assets/gh-dark.min.css
99113
assets/config.yml
100114
README.md
101115
VERSION.txt

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.3
1+
0.1.0

assets/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ header: true
77
footer: '<p>Theme made with <span class="has-text-danger">❤️</span> by <a href="https://github.com/tim0-12432">Timo</a></p>' # set false if you want to hide it.
88

99
stylesheet:
10-
- "assets/gh-theme.min.css"
10+
- "assets/gh-dimmed.min.css"
11+
- "assets/gh-base.min.css"
1112

1213
columns: "2"
1314
theme: default
Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
@charset "UTF-8";
22

3-
:root {
4-
--c-gh-bg-light: #373e47;
5-
--c-gh-bg-middle: #2d333b;
6-
--c-gh-bg-dark: #22272e;
7-
--c-gh-text-light: #cdd9e5;
8-
--c-gh-text-middle: #adbac7;
9-
--c-gh-text-dark: #768390;
10-
--c-gh-border-light: #444c56;
11-
--c-gh-link: #539bf5;
12-
}
13-
143
html {
154
overflow-y: auto !important;
165
}
@@ -42,7 +31,7 @@ a:active {
4231
}
4332

4433
.navbar {
45-
background-color: var(--c-gh-bg-light) !important;
34+
background-color: var(--c-gh-bg-middle) !important;
4635
}
4736

4837
.navbar .navbar-burger {
@@ -180,6 +169,10 @@ article.message .message-body {
180169
border-radius: 6px !important;
181170
}
182171

172+
.card .card-content .media.no-subtitle {
173+
align-items: baseline !important;
174+
}
175+
183176
.card .card-content .media-left {
184177
color: var(--c-gh-text-dark) !important;
185178
}
@@ -227,33 +220,26 @@ article.message .message-body {
227220
text-transform: capitalize;
228221
}
229222

230-
.card .card-content .media .status.offline::before,
231-
.card .card-content .media .status.bad::before {
232-
background-color: #d75137 !important;
223+
.card .card-content .media .status::before {
233224
box-shadow: none !important;
234225
border: 1px solid var(--c-gh-border-light) !important;
235-
height: 12px !important;
236-
width: 12px !important;
226+
height: 1em !important;
227+
width: 1em !important;
237228
border-radius: 50% !important;
238229
}
239230

231+
.card .card-content .media .status.offline::before,
232+
.card .card-content .media .status.bad::before {
233+
background-color: #d75137 !important;
234+
}
235+
240236
.card .card-content .media .status.warn::before {
241237
background-color: #b07219 !important;
242-
box-shadow: none !important;
243-
border: 1px solid var(--c-gh-border-light) !important;
244-
height: 12px !important;
245-
width: 12px !important;
246-
border-radius: 50% !important;
247238
}
248239

249240
.card .card-content .media .status.online::before,
250241
.card .card-content .media .status.good::before {
251242
background-color: #468221 !important;
252-
box-shadow: none !important;
253-
border: 1px solid var(--c-gh-border-light) !important;
254-
height: 12px !important;
255-
width: 12px !important;
256-
border-radius: 50% !important;
257243
}
258244

259245
.card .card-content .media .notif {

assets/gh-dark.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@charset "UTF-8";
2+
3+
:root {
4+
--c-gh-bg-light: #21262d;
5+
--c-gh-bg-middle: #161b22;
6+
--c-gh-bg-dark: #0d1117;
7+
--c-gh-text-light: #f0f6fc;
8+
--c-gh-text-middle: #e6edf3;
9+
--c-gh-text-dark: #7d8590;
10+
--c-gh-border-light: #30363d;
11+
--c-gh-link: #2f81f7;
12+
}

assets/gh-dimmed.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@charset "UTF-8";
2+
3+
:root {
4+
--c-gh-bg-light: #373e47;
5+
--c-gh-bg-middle: #2d333b;
6+
--c-gh-bg-dark: #22272e;
7+
--c-gh-text-light: #cdd9e5;
8+
--c-gh-text-middle: #adbac7;
9+
--c-gh-text-dark: #768390;
10+
--c-gh-border-light: #444c56;
11+
--c-gh-link: #539bf5;
12+
}

assets/gh-light.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@charset "UTF-8";
2+
3+
:root {
4+
--c-gh-bg-light: #373e47;
5+
--c-gh-bg-middle: #2d333b;
6+
--c-gh-bg-dark: #fff;
7+
--c-gh-text-light: #fff;
8+
--c-gh-text-middle: #1f2328;
9+
--c-gh-text-dark: #656d76;
10+
--c-gh-border-light: #d0d7de;
11+
--c-gh-link: #539bf5;
12+
}

utils/generate-minified-css.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,22 @@ const { minify } = require('csso');
22
const path = require('path');
33
const fs = require('fs');
44

5-
const cssPath = path.resolve(__dirname, '../assets/gh-theme.css');
6-
console.log("### Got the path to CSS:", cssPath);
5+
function generate(res) {
6+
const cssPath = path.resolve(__dirname, `../assets/gh-${res}.css`);
7+
console.log("### Got the path to CSS:", cssPath);
78

8-
const css = fs.readFileSync(cssPath, 'utf8');
9-
console.log("### Read the CSS:", css.replace(/(\r\n|\n|\r)/gm, " ").substring(0, 50) + "...");
9+
const css = fs.readFileSync(cssPath, 'utf8');
10+
console.log("### Read the CSS:", css.replace(/(\r\n|\n|\r)/gm, " ").substring(0, 50) + "...");
1011

11-
const minifiedCss = minify(css).css;
12-
console.log("### Minified the CSS:", minifiedCss.substring(0, 50) + "...");
12+
const minifiedCss = minify(css).css;
13+
console.log("### Minified the CSS:", minifiedCss.substring(0, 50) + "...");
1314

14-
const minifiedCssPath = path.resolve(__dirname, '../assets/gh-theme.min.css');
15-
fs.writeFileSync(minifiedCssPath, minifiedCss);
16-
console.log("### Wrote the minified CSS to:", minifiedCssPath);
15+
const minifiedCssPath = path.resolve(__dirname, `../assets/gh-${res}.min.css`);
16+
fs.writeFileSync(minifiedCssPath, minifiedCss);
17+
console.log("### Wrote the minified CSS to:", minifiedCssPath);
18+
}
19+
20+
generate("base");
21+
generate("dimmed");
22+
generate("light");
23+
generate("dark");

utils/lint-css.js

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,36 @@ const stylelint = require('stylelint');
22
const path = require('path');
33
const fs = require('fs');
44

5-
const cssPath = path.resolve(__dirname, '../assets/gh-theme.css');
6-
console.log("### Got the path to CSS:", cssPath);
5+
function lint(res) {
6+
const cssPath = path.resolve(__dirname, `../assets/gh-${res}.css`);
7+
console.log("### Got the path to CSS:", cssPath);
78

8-
const css = fs.readFileSync(cssPath, 'utf8');
9-
console.log("### Read the CSS:", css.replace(/(\r\n|\n|\r)/gm, " ").substring(0, 50) + "...");
9+
const css = fs.readFileSync(cssPath, 'utf8');
10+
console.log("### Read the CSS:", css.replace(/(\r\n|\n|\r)/gm, " ").substring(0, 50) + "...");
1011

11-
stylelint.lint({
12-
code: css,
13-
config: {
14-
extends: 'stylelint-config-standard',
15-
rules: {},
16-
},
17-
}).then((data) => {
18-
const warnings = data.results[0].warnings;
19-
console.log("### Linted the CSS:", warnings.length, "warnings found.");
20-
const report = warnings.map((warning) => {
21-
const string = warning.severity +
22-
" (" + warning.line + ":" + warning.column + "): " +
23-
warning.text;
24-
console.log("# -- " + string);
25-
return string;
26-
}).join("\n");
27-
fs.writeFileSync(path.resolve(__dirname, '../linting-report.txt'), report);
28-
}).catch((err) => {
29-
console.error("### Error linting the CSS:", err);
30-
});
12+
stylelint.lint({
13+
code: css,
14+
config: {
15+
extends: 'stylelint-config-standard',
16+
rules: {},
17+
},
18+
}).then((data) => {
19+
const warnings = data.results[0].warnings;
20+
console.log("### Linted the CSS:", warnings.length, "warnings found.");
21+
const report = warnings.map((warning) => {
22+
const string = warning.severity +
23+
" (" + warning.line + ":" + warning.column + "): " +
24+
warning.text;
25+
console.log("# -- " + string);
26+
return string;
27+
}).join("\n");
28+
fs.writeFileSync(path.resolve(__dirname, '../linting-report.txt'), report);
29+
}).catch((err) => {
30+
console.error("### Error linting the CSS:", err);
31+
});
32+
}
33+
34+
lint("base");
35+
lint("dimmed");
36+
lint("light");
37+
lint("dark");

0 commit comments

Comments
 (0)