diff options
Diffstat (limited to 's2i/bin/better-css.sh')
-rwxr-xr-x | s2i/bin/better-css.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/s2i/bin/better-css.sh b/s2i/bin/better-css.sh new file mode 100755 index 0000000..efb1828 --- /dev/null +++ b/s2i/bin/better-css.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +css="$1" +if test ! -f "$css"; then + echo "usage: $0 <css-file>" + exit 1 +fi + +orig="${css%.css}-orig.css" +if test ! -f "$orig"; then + cp "$css" "$orig" +fi + +( + echo "@import url(darkmode.css);" + sed -e 's/black/var(--color-black)/g' \ + -e 's/#F5F5F5/var(--color-white)/g' \ + -e 's/#552681/var(--color-blue)/g' \ + < "$orig" +) > "$css" |