From 85a8c027fa7bc4d345ad4523123f48a9a3f81165 Mon Sep 17 00:00:00 2001 From: Radu Pogonariu Date: Tue, 3 Sep 2019 00:18:15 +0300 Subject: [PATCH] Use Autoprefixer for CSS postprocessing --- .browserslistrc | 1 + make_style.sh | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 .browserslistrc diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 000000000..e4fa36367 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1 @@ +cover 97% diff --git a/make_style.sh b/make_style.sh index 86b2b30b5..eb6cf7b4e 100755 --- a/make_style.sh +++ b/make_style.sh @@ -1,7 +1,23 @@ #!/bin/bash +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 + +if ! [ -x "$(command -v autoprefixer)" ]; then + echo 'Error: autoprefixer is not installed.' >&2 + exit 1 +fi + +FILES=(sass_processed/style.css sass_processed/content-description.css sass_processed/table.css sass_processed/ranks.css) + cd `dirname $0` -sass --update resources:sass_processed -pleeease compile sass_processed/style.css -t resources/style.css -mv sass_processed/content-description.css resources/content-description.css -mv sass_processed/table.css resources/table.css -mv sass_processed/ranks.css resources/ranks.css +sass -f --update resources:sass_processed + +echo +postcss "${FILES[@]}" --verbose --use autoprefixer -d resources