Skip to content

Commit

Permalink
feat: Baking logo with script
Browse files Browse the repository at this point in the history
  • Loading branch information
gabyx committed Mar 13, 2024
1 parent d669550 commit 7098134
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion css/theme/source/company.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ $headingColor: $companyBlue;
$headingTextTransform: none;

$mainFont: "Museo", "Palatino Linotype", "Book Antiqua", "Palatino", serif;
$headingFont: "Museo Sans", "Palatin Linotype", "Book Antiqua", "Palatino", serif;
$headingFont: "Museo Sans", "Palatin Linotype", "Book Antiqua", "Palatino",
serif;
$linkColor: $companyBlueDark;
$linkColorHover: $companyBlue;

Expand Down
5 changes: 2 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ present:
package:
npm run package

bake-logo:
bake-logo mime="svg":
cd "{{root_dir}}" && \
repl=$(cat css/theme/source/files/company-logo.svg | base64 -w 0| sed "s/\+/\\\+/g") && \
sed -i -E "s@background-image(.*);base64,.*\"@background-image\1;base64,$repl\"@" css/theme/source/company.scss
tools/bake-logo.sh "{{mime}}"
3 changes: 2 additions & 1 deletion tools/bake-logo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ function clean_up() {
[ -f "$temp" ] && rm -rf "$temp"
}

repl=$(cat "$ROOT_DIR/css/theme/source/files/company-logo.png" | base64 -w 0 | sed "s/\+/\\\+/g")
repl=$(base64 -w 0 <"$ROOT_DIR/css/theme/source/files/company-logo.$type" | sed "s/\+/\\\+/g")
temp=$(mktemp)

# shellcheck disable=SC2028
echo "Baking logo into 'company.scss'..."
printf 's@background-image(.*);base64,.*"@background-image: url("data:image/%s;base64,%s"@' "$mime" "$repl" >"$temp"
sed -i -E -f "$temp" "$ROOT_DIR/css/theme/source/company.scss"

0 comments on commit 7098134

Please sign in to comment.