Skip to content

Commit a9a9994

Browse files
authored
chore: correct usage of font family (@fehmer) (monkeytypegame#6793)
1 parent 3ddb3c6 commit a9a9994

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

frontend/src/styles/fonts.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
@use "sass:map";
22

33
@each $font, $config in $fonts {
4-
$src: "/webfonts/" + map-get($config, "src");
4+
$dir: "webfonts";
55
$previewDir: "webfonts-preview";
66
@if variable-exists(previewFontsPath) {
77
$previewDir: $previewFontsPath;
88
}
99

1010
@font-face {
11-
font-family: $font;
11+
font-family: "#{$font}";
1212
font-style: normal;
1313
font-weight: map-get($config, "weight");
1414
font-display: block;
15-
src: url($src) format("woff2");
15+
src: url("/#{$dir}/#{map-get($config, 'src')}") format("woff2");
1616
}
1717

1818
@font-face {
19-
font-family: $font + " Preview";
19+
font-family: "#{$font} Preview";
2020
font-style: normal;
2121
font-weight: map-get($config, "weight");
2222
font-display: block;
23-
src: url("/" + $previewDir + "/" + map-get($config, "src")) format("woff2");
23+
src: url("/#{$previewDir}/#{map-get($config, 'src')}") format("woff2");
2424
}
2525
}

frontend/src/ts/commandline/commandline.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ async function showCommands(): Promise<void> {
525525
fontFamily += " Preview";
526526
}
527527

528-
html += `<div class="command" data-command-id="${command.id}" data-index="${index}" style="font-family: ${fontFamily}"><div class="icon">${finalIconHtml}</div><div>${display}</div></div>`;
528+
html += `<div class="command" data-command-id="${command.id}" data-index="${index}" style="font-family: '${fontFamily}'"><div class="icon">${finalIconHtml}</div><div>${display}</div></div>`;
529529
}
530530
} else {
531531
html += `<div class="command" data-command-id="${command.id}" data-index="${index}" style="${customStyle}"><div class="icon">${finalIconHtml}</div><div>${display}</div></div>`;

frontend/src/ts/pages/settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ async function fillSettingsPage(): Promise<void> {
590590
const activeClass = Config.fontFamily === name ? " active" : "";
591591
const display = font.display ?? name.replace(/_/g, " ");
592592

593-
fontsElHTML += `<button class="${activeClass}" style="font-family:${fontFamily}" data-config-value="${name}">${display}</button>`;
593+
fontsElHTML += `<button class="${activeClass}" style="font-family:'${fontFamily}'" data-config-value="${name}">${display}</button>`;
594594
}
595595

596596
fontsElHTML +=

frontend/static/themes/darling.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@
99
--error-extra-color: #2e7dde;
1010
--colorful-error-color: #2e7dde;
1111
--colorful-error-extra-color: #2e7dde;
12-
--font: Roboto Mono;
1312
}

0 commit comments

Comments
 (0)