2022-02-21 03:54:35 +00:00
|
|
|
#!/bin/bash
|
2022-02-21 04:37:33 +00:00
|
|
|
# Maybe a Makefile would be better...
|
2022-02-21 03:54:35 +00:00
|
|
|
|
|
|
|
echo "Finding targets..."
|
|
|
|
targets=$(ls ../src/targets/*.less)
|
|
|
|
echo "Targets:"
|
|
|
|
echo "$targets"
|
|
|
|
echo
|
|
|
|
|
|
|
|
echo "Finding themes..."
|
|
|
|
themes=$(ls ../src/themes/*.less)
|
|
|
|
echo "Themes:"
|
|
|
|
echo "$themes"
|
|
|
|
echo
|
|
|
|
|
|
|
|
for target in $targets
|
|
|
|
do
|
|
|
|
for theme in $themes
|
|
|
|
do
|
|
|
|
|
|
|
|
btarget=$(basename $target .less)
|
|
|
|
btheme=$(basename $theme .less)
|
|
|
|
# Dot notation is used so .module.css files can be generated
|
|
|
|
base="$btheme.$btarget"
|
|
|
|
|
|
|
|
echo "Building $base with the following rules:"
|
|
|
|
|
|
|
|
tee "$base.less" << EOF
|
|
|
|
@import (less) "../src/utils/mixins.less";
|
|
|
|
@import (less) "$target";
|
|
|
|
@import (less) "$theme";
|
|
|
|
EOF
|
|
|
|
|
2022-04-29 23:18:15 +00:00
|
|
|
lessc "$base.less" "$base.css"
|
2022-02-21 03:54:35 +00:00
|
|
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|