Skip to content

Commit 5880ec4

Browse files
fix: font family tools and settings
1 parent ebf4cd2 commit 5880ec4

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

packages/core/styles/01-settings/settings-font-family/_settings-font-family.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $bolt-font-family--sans-fallback:
2020
'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', /* [2] */
2121
'Helvetica Neue', sans-serif !default;
2222
$bolt-font-family--serif: 'Georgia', serif;
23-
$bolt-font-family--mono-fallback: monospace;
23+
$bolt-font-family--mono-fallback: monospace, monospace;
2424

2525

2626
/*
@@ -29,7 +29,7 @@ $bolt-font-family--mono-fallback: monospace;
2929
$bolt-font-family--sans: 'Open Sans', 'Helvetica Neue', sans-serif !default;
3030
$bolt-font-family--sans-subset: 'OpenSansSubset', 'Helvetica Neue', sans-serif !default;
3131
$bolt-font-family--serif: 'Georgia', serif;
32-
$bolt-font-family--mono: 'Courier New', monospace;
32+
$bolt-font-family--mono: monospace, monospace;
3333

3434

3535
/*
@@ -63,4 +63,4 @@ $bolt-font-families: (
6363
)
6464
);
6565

66-
@include export-data('typography/font-families.bolt.json', $bolt-font-families);
66+
@include export-data('typography/font-families.bolt.json', $bolt-font-families);

packages/core/styles/02-tools/tools-font-family/_tools-font-family.scss

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,28 @@
1717
$custom-font-family: map-get-deep($bolt-font-families, 'font-families', $type, 'custom-font');
1818
$fonts-loaded-class: map-get-deep($bolt-font-families, 'font-families', $type, 'loaded-class');
1919

20+
$fontFamilyNames: map-keys(map-get($bolt-font-families, 'font-families')); // get the names of all available font families (custom and fallback)
21+
2022
font-family: $fallback-font-family;
21-
font-family: var(--bolt-font-family);
23+
font-family: var(--bolt-font-family-#{$type});
2224

2325
@if $is_root == false {
2426
.#{$fonts-loaded-class} & {
2527
font-family: $custom-font-family;
26-
font-family: var(--bolt-font-family);
28+
font-family: var(--bolt-font-family-#{$type});
2729
}
2830
}
2931
@else {
30-
--bolt-font-family: #{$fallback-font-family};
32+
33+
@each $fontFamilyName in $fontFamilyNames {
34+
--bolt-font-family-#{$fontFamilyName}: #{map-get-deep($bolt-font-families, 'font-families', $fontFamilyName, 'fallback-font') ;};
35+
}
3136

3237
&.#{$fonts-loaded-class} {
33-
--bolt-font-family: #{$custom-font-family};
38+
@each $fontFamilyName in $fontFamilyNames {
39+
--bolt-font-family-#{$fontFamilyName}: #{map-get-deep($bolt-font-families, 'font-families', $fontFamilyName, 'custom-font') ;};
40+
}
41+
3442
font-family: $custom-font-family;
3543
}
3644
}

0 commit comments

Comments
 (0)