Skip to content

Commit 521002b

Browse files
authored
fix: corrected the local font names (#530)
* fix: corrected the local font names * Update _fonts.variables.scss * Update _fonts.variables.scss * refactor: using DB Screen Cond for bold formatting * docs: wording
1 parent 04e5d71 commit 521002b

File tree

2 files changed

+41
-11
lines changed

2 files changed

+41
-11
lines changed

source/_patterns/00-base/type/_fonts.scss

+19-3
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,31 @@
66
$font-filename: map-get($font-meta, "font-filename");
77
$font-weight: map-get($font-meta, "font-weight");
88
$font-style: map-get($font-meta, "font-style");
9-
$font-local: map-get($font-meta, "font-local");
9+
$font-local-name: map-get($font-meta, "font-local-name");
10+
$font-local-name-short: map-get($font-meta, "font-local-name-short");
1011

1112
@font-face {
1213
font-family: $font-family;
1314
font-style: $font-style;
1415
font-weight: $font-weight;
15-
@if $font-local {
16+
@if $font-local-name and $font-local-name-short {
1617
src:
17-
local("#{$font-name}"),
18+
local("#{$font-local-name}"),
19+
local("#{$font-local-name-short}"),
20+
url("#{$fonts-path}#{$font-filename}.woff2?4r0080")
21+
format("woff2"),
22+
url("#{$fonts-path}#{$font-filename}.woff?4r0080")
23+
format("woff");
24+
} @else if $font-local-name {
25+
src:
26+
local("#{$font-local-name}"),
27+
url("#{$fonts-path}#{$font-filename}.woff2?4r0080")
28+
format("woff2"),
29+
url("#{$fonts-path}#{$font-filename}.woff?4r0080")
30+
format("woff");
31+
} @else if $font-local-name-short {
32+
src:
33+
local("#{$font-local-name-short}"),
1834
url("#{$fonts-path}#{$font-filename}.woff2?4r0080")
1935
format("woff2"),
2036
url("#{$fonts-path}#{$font-filename}.woff?4r0080")

source/_patterns/00-base/type/_fonts.variables.scss

+22-8
Original file line numberDiff line numberDiff line change
@@ -7,58 +7,72 @@ $font-families: (
77
// light font weight
88
"font-weight": 300,
99
"font-style": normal,
10-
"font-local": true
10+
"font-local-name": "DB Screen Head Light",
11+
"font-local-name-short": "DB Head Light"
1112
),
1213
"DB Screen Head Regular": (
1314
"font-family": "DB Screen Head",
1415
"font-filename": "dbscreenhead-regular",
1516
// normal font weight
1617
"font-weight": 400,
1718
"font-style": normal,
18-
"font-local": true
19+
"font-local-name": "DB Screen Head",
20+
"font-local-name-short": "DB Head"
1921
),
2022
"DB Screen Head Black": (
2123
"font-family": "DB Screen Head",
2224
"font-filename": "dbscreenhead-black",
2325
// black/"bold" font weight
2426
"font-weight": 900,
2527
"font-style": normal,
26-
"font-local": true
28+
"font-local-name": "DB Screen Head Black",
29+
"font-local-name-short": "DB Head Black"
2730
),
31+
2832
"DB Screen Sans Digital Regular": (
2933
"font-family": "DB Screen Sans Digital Regular",
3034
"font-filename": "dbscreensans-digitalregular",
3135
// normal font weight
3236
"font-weight": 400,
33-
"font-style": normal
37+
"font-style": normal,
38+
"font-local-name": "DB Screen Sans Digital",
39+
"font-local-name-short": "DB Sans Digital"
3440
),
41+
3542
"DB Screen Sans Regular": (
3643
"font-family": "DB Screen Sans",
3744
"font-filename": "dbscreensans-regular",
3845
// normal font weight
3946
"font-weight": 400,
4047
"font-style": normal,
41-
"font-local": true
48+
"font-local-name": "DB Screen Sans",
49+
"font-local-name-short": "DB Sans"
4250
),
4351
"DB Screen Sans Medium": (
4452
"font-family": "DB Screen Sans",
4553
"font-filename": "dbscreensans-medium",
4654
"font-weight": 500,
4755
"font-style": normal,
48-
"font-local": true
56+
// TODO: Identify the correct name on local environments; most likely this isn't installed and/or possible to get referenced at the moment
57+
// "font-local-name": "DB Screen Sans Medium",
58+
// "font-local-name-short": "DB Sans Medium"
4959
),
5060
"DB Screen Sans Semibold": (
5161
"font-family": "DB Screen Sans",
5262
"font-filename": "dbscreensans-semibold",
5363
"font-weight": 600,
5464
"font-style": normal,
55-
"font-local": true
65+
// TODO: Identify the correct name on local environments; most likely this isn't installed and/or possible to get referenced at the moment
66+
// "font-local-name": "DB Screen Sans Semibold",
67+
// "font-local-name-short": "DB Sans Semibold"
5668
),
5769
"DB Screen Sans Bold": (
5870
"font-family": "DB Screen Sans",
5971
"font-filename": "dbscreensans-bold",
6072
// bold font weight
6173
"font-weight": 700,
62-
"font-style": normal
74+
"font-style": normal,
75+
"font-local-name": "DB Screen Sans Bold",
76+
"font-local-name-short": "DB Sans Bold"
6377
)
6478
) !default;

0 commit comments

Comments
 (0)