#!/bin/sh
# Compile the Darkmatter stylesheets.
#
# Both gtk.css and gtk-dark.css are built from dark sources: Darkmatter has no
# light variant, and GTK apps that ask for the dark stylesheet by name should
# get the same theme rather than fall through to something else.
#
# Run from the theme root:  sh src/build.sh

set -e
command -v sassc >/dev/null || {
    echo "sassc not found: doas apk add sassc" >&2
    exit 1
}
[ -d gtk-3.0 ] || { echo "run me from the theme root" >&2; exit 1; }

for v in gtk gtk-dark; do
    sassc -I gtk-3.0 "gtk-3.0/$v.scss" "gtk-3.0/$v.css"
    echo "  gtk-3.0/$v.css"
done
for v in gtk gtk-dark; do
    sassc -I gtk-4.0 -I gtk-3.0 "gtk-4.0/$v.scss" "gtk-4.0/$v.css"
    echo "  gtk-4.0/$v.css"
done
