aboutsummaryrefslogtreecommitdiffstats
path: root/s2i/bin/better-css.sh
blob: efb18281a9af429302e3b805c17419e5dbd2d9a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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"