Skip to content

Commit

Permalink
update make_style.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
LLaammTTeerr committed Sep 27, 2024
1 parent aa3258a commit 425a6c3
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions make_style.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
#!/bin/sh
cd "$(dirname "$0")" || exit
if ! [ -x "$(command -v sass)" ]; then
echo 'Error: sass is not installed.' >&2
exit 1
fi

if ! [ -x "$(command -v postcss)" ]; then
echo 'Error: postcss is not installed.' >&2
exit 1
fi

node scripts/check-package-installed.js postcss sass autoprefixer || exit
if ! [ -x "$(command -v autoprefixer)" ]; then
echo 'Error: autoprefixer is not installed.' >&2
exit 1
fi

cd "$(dirname "$0")" || exit

build_style() {
echo "Creating $1 style..."
cp resources/vars-$1.scss resources/vars.scss
npx sass resources:sass_processed
npx postcss sass_processed/style.css sass_processed/martor-description.css sass_processed/select2-dmoj.css --verbose --use autoprefixer -d $2
sass resources:sass_processed
postcss sass_processed/style.css sass_processed/martor-description.css sass_processed/select2-dmoj.css --verbose --use autoprefixer -d $2
}

build_style 'default' 'resources'
build_style 'dark' 'resources/dark'
build_style 'dark' 'resources/dark'

0 comments on commit 425a6c3

Please sign in to comment.