-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use EMs in UXDS and add script for CSS compilation
- Loading branch information
1 parent
745af42
commit 03f0407
Showing
4 changed files
with
1,088 additions
and
1,028 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
DEFAULT_PROJECT_ROOT=./ | ||
PROJECT_ROOT=${1:-$DEFAULT_PROJECT_ROOT} | ||
|
||
if [[ ! -d $PROJECT_ROOT ]]; | ||
then | ||
echo ${PROJECT_ROOT}" is not a directory..." | ||
exit 1 | ||
fi | ||
|
||
compile_sass () { | ||
echo "Compiling bootstrap SASS..." | ||
yarn sass ${PROJECT_ROOT}src/scss/themed-bootstrap.scss ${PROJECT_ROOT}src/shared/themed-bootstrap.css | ||
if [ $? -ne 0 ]; | ||
then | ||
echo "Failed to compile bootstrap... Aborting." | ||
exit 1 | ||
fi | ||
} | ||
|
||
replace_rem_w_em () { | ||
echo "Replacing REMs with EMs..." | ||
sed -i -r "s|([0-9])rem|\1em|g" ${PROJECT_ROOT}src/shared/themed-bootstrap.css | ||
if [ $? -ne 0 ]; | ||
then | ||
echo "Failed to replace content... Aborting." | ||
exit 1 | ||
fi | ||
} | ||
|
||
format_bootstrap () { | ||
echo "Formatting output..." | ||
yarn prettier -w ${PROJECT_ROOT}src/shared/themed-bootstrap.css | ||
if [ $? -ne 0 ]; | ||
then | ||
echo "Formatting output failed... Aborting." | ||
exit 1 | ||
fi | ||
} | ||
|
||
compile_sass | ||
replace_rem_w_em | ||
format_bootstrap | ||
exit $? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.