Skip to content

Commit

Permalink
📌 update fonts / font-face
Browse files Browse the repository at this point in the history
  • Loading branch information
ebullient committed Sep 28, 2023
1 parent e904cd3 commit c2b9b1c
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/base64font.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Define the path to the input SCSS file and the output file
INPUT_FILE="src/fragments/_02a-font-faces.scss"
OUTPUT_FILE="src/fragments/_02a-font-faces.scss.next"

# Create/clear the output file
> $OUTPUT_FILE

# Process each line
while IFS= read -r line
do
# Check if the line contains a [BASE64_STRING_HERE:path_to_file] pattern
if [[ $line =~ \[BASE64_STRING_HERE:(.+)\] ]]; then
# Extract the path from the match
font_path="${BASH_REMATCH[1]}"
# Base64 encode the font file
encoded=$(gbase64 "$font_path" | tr -d '\n')
# Replace the placeholder with the Base64 encoded string
line=${line/\[BASE64_STRING_HERE:$font_path\]/$encoded}
fi

# Append the processed line to the output file
echo "$line" >> $OUTPUT_FILE
done < "$INPUT_FILE"
1 change: 0 additions & 1 deletion src/fragments/_02-fonts.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Want a different font? This is the file to change! (02-fonts.scss)
@import url('https://fonts.googleapis.com/css2?family=Architects+Daughter&family=IBM+Plex+Sans:wght@300;400;700&display=swap');
body {
// style settings baseline
--ebw-font-text: 'IBM Plex Sans', Helvetica Neue;
Expand Down
76 changes: 76 additions & 0 deletions src/fragments/_02a-font-faces.scss

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@use 'fragments/01a-color-accents' as *;

@use 'fragments/02-fonts' as *;
@use 'fragments/02a-font-faces' as *;

@use 'fragments/03-core-themes-app' as *;

Expand Down

0 comments on commit c2b9b1c

Please sign in to comment.