chore: correct usage of font family (@fehmer) (#6793)

This commit is contained in:
Christian Fehmer 2025-07-28 15:45:34 +02:00 committed by GitHub
parent 3ddb3c68c1
commit a9a99947a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 8 deletions

View file

@ -1,25 +1,25 @@
@use "sass:map";
@each $font, $config in $fonts {
$src: "/webfonts/" + map-get($config, "src");
$dir: "webfonts";
$previewDir: "webfonts-preview";
@if variable-exists(previewFontsPath) {
$previewDir: $previewFontsPath;
}
@font-face {
font-family: $font;
font-family: "#{$font}";
font-style: normal;
font-weight: map-get($config, "weight");
font-display: block;
src: url($src) format("woff2");
src: url("/#{$dir}/#{map-get($config, 'src')}") format("woff2");
}
@font-face {
font-family: $font + " Preview";
font-family: "#{$font} Preview";
font-style: normal;
font-weight: map-get($config, "weight");
font-display: block;
src: url("/" + $previewDir + "/" + map-get($config, "src")) format("woff2");
src: url("/#{$previewDir}/#{map-get($config, 'src')}") format("woff2");
}
}

View file

@ -525,7 +525,7 @@ async function showCommands(): Promise<void> {
fontFamily += " Preview";
}
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>`;
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>`;
}
} else {
html += `<div class="command" data-command-id="${command.id}" data-index="${index}" style="${customStyle}"><div class="icon">${finalIconHtml}</div><div>${display}</div></div>`;

View file

@ -590,7 +590,7 @@ async function fillSettingsPage(): Promise<void> {
const activeClass = Config.fontFamily === name ? " active" : "";
const display = font.display ?? name.replace(/_/g, " ");
fontsElHTML += `<button class="${activeClass}" style="font-family:${fontFamily}" data-config-value="${name}">${display}</button>`;
fontsElHTML += `<button class="${activeClass}" style="font-family:'${fontFamily}'" data-config-value="${name}">${display}</button>`;
}
fontsElHTML +=

View file

@ -9,5 +9,4 @@
--error-extra-color: #2e7dde;
--colorful-error-color: #2e7dde;
--colorful-error-extra-color: #2e7dde;
--font: Roboto Mono;
}