|
5 | 5 | branches: [main] |
6 | 6 | paths: |
7 | 7 | - source/** |
8 | | - - .github/workflows/build-and-bump.yml |
| 8 | + - .github/workflows/build-and-bump.yml # this file itself |
9 | 9 | workflow_dispatch: |
10 | 10 |
|
11 | 11 | permissions: |
@@ -35,17 +35,26 @@ jobs: |
35 | 35 | # Due to globbing, the source files are inserted in alphabetical order. |
36 | 36 | # To keep things predictable, they are simply number in the order they |
37 | 37 | # should be included in. |
38 | | - cat ./source/**/*.css > ./theme.css |
| 38 | + cat ./source/**/*.css > ./source.css |
39 | 39 |
|
40 | 40 | # minification & syntax-lowering https://lightningcss.dev/transpilation.html |
41 | 41 | npm install |
42 | 42 | export BROWSERSLIST="chrome 108" # lowers syntax to before css-nesting https://caniuse.com/css-nesting |
43 | 43 | npx lightningcss --minify --browserslist \ |
44 | | - --output-file="./theme.css" -- "./theme.css" || exit 1 |
| 44 | + --output-file="./temp.css" -- "./temp.css" || exit 1 |
45 | 45 |
|
46 | | - # append style-settings (last, so not removed by minification) |
47 | | - cat <(echo && echo "/* @settings") ./source/style-settings.yaml <(echo "*/") \ |
48 | | - >> ./theme.css |
| 46 | + # merge header, css code, and style settings into `theme.css` |
| 47 | + echo "/*" >> ./theme.css |
| 48 | + cat ./source/header.txt >> ./theme.css |
| 49 | + echo "*/" >> ./theme.css |
| 50 | +
|
| 51 | + cat ./temp.css >> ./theme.css |
| 52 | + rm temp.css |
| 53 | +
|
| 54 | + echo "" >> ./theme.css |
| 55 | + echo "/* @settings" >> ./theme.css |
| 56 | + cat ./source/style-settings.yaml >> theme.css |
| 57 | + echo "*/" >> theme.css |
49 | 58 |
|
50 | 59 | - name: check for unsupported features |
51 | 60 | run: | |
|
0 commit comments