Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes CityOfDetroit/detroitmi#1112 #98

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions scripts/compile_bootstrap.sh
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 $?
10 changes: 10 additions & 0 deletions src/scss/themed-bootstrap.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// This SASS file customizes base bootstrap to meet the needs of the UXDS. The compiled output
// should be stored in src/shared/themed-bootstrap.css.

// The next comment line will be included in the compiled output and is only intended for readers
// of the compiled output. Please ignore in this file.
/**
* GENERATED CSS. DO NOT MODIFY.
* This file is generated from source SASS in src/scss/themed-bootstrap.scss. If you'd like to make
* changes please change the source file or the code generation script at scripts/compile_bootstrap.sh.
*/
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100;700&display=swap');
$primary: #004445 !default;
$secondary: #e6e6e6 !default;
Expand Down
Loading