parse-sass.sh 1.2 KB
Newer Older
vinceliuice's avatar
vinceliuice committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#! /bin/bash

if [ ! "$(which sassc 2> /dev/null)" ]; then
   echo sassc needs to be installed to generate the css.
   exit 1
fi

SASSC_OPT="-M -t expanded"

_COLOR_VARIANTS=('' '-light' '-dark')
if [ ! -z "${COLOR_VARIANTS:-}" ]; then
  IFS=', ' read -r -a _COLOR_VARIANTS <<< "${COLOR_VARIANTS:-}"
fi

_WIN_VARIANTS=('' '-win')
if [ ! -z "${WIN_VARIANTS:-}" ]; then
  IFS=', ' read -r -a _WIN_VARIANTS <<< "${WIN_VARIANTS:-}"
fi

20 21 22 23 24 25
_THEME_VARIANTS=('' '-manjaro' '-ubuntu')
if [ ! -z "${THEME_VARIANTS:-}" ]; then
  IFS=', ' read -r -a _THEME_VARIANTS <<< "${THEME_VARIANTS:-}"
fi

for theme in "${_THEME_VARIANTS[@]}"; do
vinceliuice's avatar
vinceliuice committed
26 27
for win in "${_WIN_VARIANTS[@]}"; do
  for color in "${_COLOR_VARIANTS[@]}"; do
28 29
    sassc $SASSC_OPT src/gtk-3.0/theme${theme}/gtk${win}${color}.{scss,css}
    echo "==> Generating the gtk${theme}${win}${color}.css..."
vinceliuice's avatar
vinceliuice committed
30 31
  done
done
32
done
vinceliuice's avatar
vinceliuice committed
33

34
for theme in "${_THEME_VARIANTS[@]}"; do
vinceliuice's avatar
vinceliuice committed
35
for color in "${_COLOR_VARIANTS[@]}"; do
36 37 38 39 40
  sassc $SASSC_OPT src/gnome-shell/theme${theme}/gnome-shell${color}.{scss,css}
  echo "==> Generating the gnome-shell${theme}${color}.css..."
  sassc $SASSC_OPT src/cinnamon/theme${theme}/cinnamon${color}.{scss,css}
  echo "==> Generating the cinnamon${theme}${color}.css..."
done
vinceliuice's avatar
vinceliuice committed
41 42
done