Skip to content

Commit 3ca9a72

Browse files
committed
Display text while fonts are loading
Display text in a locally available font while custom fonts are loading.
1 parent 9b0e777 commit 3ca9a72

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/sass/elements.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ a {
3030
}
3131

3232
kbd {
33-
font-family: Roboto Mono, monospace;
33+
font-family: Roboto Mono, Cascadia Code, Consolas, monospace;
3434
font-size: 14px;
3535
color: var(--input-text-color);
3636
background-color: var(--footer-background);

src/sass/fonts.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
11
@font-face {
22
font-family: 'Roboto';
33
font-weight: 400;
4+
font-display: swap;
45
src: url('../assets/fonts/roboto-regular.ttf') format('truetype');
56
}
67

78
@font-face {
89
font-family: 'Roboto';
910
font-weight: 500;
11+
font-display: swap;
1012
src: url('../assets/fonts/roboto-medium.ttf') format('truetype');
1113
}
1214

1315
@font-face {
1416
font-family: 'Roboto';
1517
font-weight: 600;
18+
font-display: swap;
1619
src: url('../assets/fonts/roboto-bold.ttf') format('truetype');
1720
}
1821

1922
@font-face {
2023
font-family: 'Roboto Mono';
2124
font-weight: 400;
25+
font-display: swap;
2226
src: url('../assets/fonts/robotomono-regular.ttf') format('truetype');
2327
}
2428

2529
@font-face {
2630
font-family: 'Roboto Mono';
2731
font-weight: 600;
32+
font-display: swap;
2833
src: url('../assets/fonts/robotomono-bold.ttf') format('truetype');
2934
}

0 commit comments

Comments
 (0)