-
Notifications
You must be signed in to change notification settings - Fork 242
/
parse-sass.sh
executable file
·79 lines (67 loc) · 3.24 KB
/
parse-sass.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#! /usr/bin/env bash
. config.sh
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
SRC_DIR="${REPO_DIR}/src"
# Check command availability
function has_command() {
command -v $1 > /dev/null
}
if [ ! "$(which sassc 2> /dev/null)" ]; then
echo sassc needs to be installed to generate the css.
if has_command zypper; then
sudo zypper in sassc
elif has_command apt; then
sudo apt install sassc
elif has_command dnf; then
sudo dnf install -y sassc
elif has_command yum; then
sudo yum install sassc
elif has_command pacman; then
sudo pacman -S --noconfirm sassc
fi
fi
# Pass configuration to scss
echo '$MAX_SCALE_FACTOR: '"$MAX_SCALE_FACTOR;" > './src/sass/_config.scss'
SASSC_OPT="-M -t expanded"
_COLOR_VARIANTS=('-Light' '-Dark')
if [ ! -z "${COLOR_VARIANTS:-}" ]; then
IFS=', ' read -r -a _COLOR_VARIANTS <<< "${COLOR_VARIANTS:-}"
fi
_TRANS_VARIANTS=('' '-solid')
if [ ! -z "${TRANS_VARIANTS:-}" ]; then
IFS=', ' read -r -a _TRANS_VARIANTS <<< "${TRANS_VARIANTS:-}"
fi
_THEME_VARIANTS=('' '-blue' '-purple' '-pink' '-red' '-orange' '-yellow' '-green' '-grey')
if [ ! -z "${THEME_VARIANTS:-}" ]; then
IFS=', ' read -r -a _THEME_VARIANTS <<< "${THEME_VARIANTS:-}"
fi
rm -rf "${SRC_DIR}/sass/_theme-variant-temp.scss"
cp -rf "${SRC_DIR}/sass/_theme-variant.scss" "${SRC_DIR}/sass/_theme-variant-temp.scss"
for color in "${_COLOR_VARIANTS[@]}"; do
for trans in "${_TRANS_VARIANTS[@]}"; do
for theme in "${_THEME_VARIANTS[0]}"; do
sassc $SASSC_OPT src/main/gtk-3.0/gtk${color}${trans}${theme}.{scss,css}
echo "==> Generating the 3.0 gtk${color}${trans}${theme}.css..."
sassc $SASSC_OPT src/main/gtk-4.0/gtk${color}${trans}${theme}.{scss,css}
echo "==> Generating the 4.0 gtk${color}${trans}${theme}.css..."
sassc $SASSC_OPT src/main/gnome-shell/shell-3-28/gnome-shell${color}${trans}${theme}.{scss,css}
echo "==> Generating the 3.28 gnome-shell${color}${trans}${theme}.css..."
sassc $SASSC_OPT src/main/gnome-shell/shell-40-0/gnome-shell${color}${trans}${theme}.{scss,css}
echo "==> Generating the 40.0 gnome-shell${color}${trans}${theme}.css..."
sassc $SASSC_OPT src/main/gnome-shell/shell-42-0/gnome-shell${color}${trans}${theme}.{scss,css}
echo "==> Generating the 42.0 gnome-shell${color}${trans}${theme}.css..."
sassc $SASSC_OPT src/main/gnome-shell/shell-44-0/gnome-shell${color}${trans}${theme}.{scss,css}
echo "==> Generating the 44.0 gnome-shell${color}${trans}${theme}.css..."
sassc $SASSC_OPT src/main/gnome-shell/shell-46-0/gnome-shell${color}${trans}${theme}.{scss,css}
echo "==> Generating the 46.0 gnome-shell${color}${trans}${theme}.css..."
sassc $SASSC_OPT src/main/gnome-shell/shell-47-0/gnome-shell${color}${trans}${theme}.{scss,css}
echo "==> Generating the 47.0 gnome-shell${color}${trans}${theme}.css..."
sassc $SASSC_OPT src/main/cinnamon/cinnamon${color}${trans}${theme}.{scss,css}
echo "==> Generating the cinnamon${color}${trans}${theme}.css..."
done
done
done
sassc $SASSC_OPT src/other/dash-to-dock/stylesheet.{scss,css}
echo "==> Generating dash-to-dock stylesheet.css..."
sassc $SASSC_OPT src/other/dash-to-dock/stylesheet-Dark.{scss,css}
echo "==> Generating dash-to-dock stylesheet-Dark.css..."