diff options
author | mia <mia@mia.jetzt> | 2024-06-08 22:56:05 -0700 |
---|---|---|
committer | mia <mia@mia.jetzt> | 2024-06-08 22:56:05 -0700 |
commit | 8cf813ff033bbc98a7dd40db6ac11e2e35c7e997 (patch) | |
tree | a451059194cbd4ba90993ebdaced4749448ec4df /cgit/css.sh | |
download | asylum-8cf813ff033bbc98a7dd40db6ac11e2e35c7e997.tar.gz asylum-8cf813ff033bbc98a7dd40db6ac11e2e35c7e997.zip |
initial commit
Diffstat (limited to 'cgit/css.sh')
-rwxr-xr-x | cgit/css.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/cgit/css.sh b/cgit/css.sh new file mode 100755 index 0000000..b0fd633 --- /dev/null +++ b/cgit/css.sh @@ -0,0 +1,34 @@ +#!/bin/bash +set -e + +test -d cgit/css && rm -r cgit/css +mkdir cgit/css + +function compile { + local variant=$1 + local css=$2 + curl -L "https://github.com/ArmandPhilippot/coldark-bat/raw/master/Coldark-$variant.tmTheme" \ + | MODE=theme cgit-syntect - cgit/css/$css.css cgit/css/scopes + sed -i 's/background-color: .*//' cgit/css/$css.css # we don't actually want that +} + +compile Cold light +compile Dark dark + +curl https://git.kernel.org/cgit-data/cgit.css \ + | tail -n+2 \ + | sed 's/font-family: .* monospace/font-family: monospace/' \ + | sed -n '/Style definition file/q;p' \ + > cgit/css/kernel.css + +{ + echo '/* adapted from https://git.kernel.org/cgit-data/cgit.css */' + cat cgit/css/kernel.css + cat cgit/css/light.css + echo "@media only all and (prefers-color-scheme: dark) {" + cat cgit/css/dark.css + echo "}" + cat cgit/patch.css +} | prettier --parser css > cgit/css/style.css + +# rm -r cgit/css |