Add hack font

This commit is contained in:
Tristan Daniël Maat 2022-06-21 21:57:42 +01:00
parent abe8ee631e
commit 0801e85839
Signed by: tlater
GPG key ID: 49670FD774E43268
4 changed files with 29 additions and 1 deletions

5
package-lock.json generated
View file

@ -3884,6 +3884,11 @@
"slash": "^3.0.0" "slash": "^3.0.0"
} }
}, },
"hack-font": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/hack-font/-/hack-font-3.3.0.tgz",
"integrity": "sha512-RohrcAr3UaKiIoxDlOytCjObcUAucfFc6V5fKu6gBrvmvTfIXeBqZwR0Q5kb9qpbluThJWt326LClLKIGiFyug=="
},
"har-schema": { "har-schema": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",

View file

@ -10,6 +10,7 @@
"@fontsource/nunito": "^4.5.9", "@fontsource/nunito": "^4.5.9",
"@fortawesome/fontawesome-free": "^6.1.1", "@fortawesome/fontawesome-free": "^6.1.1",
"bulma": "^0.9.4", "bulma": "^0.9.4",
"hack-font": "^3.3.0",
"three": "^0.141.0" "three": "^0.141.0"
}, },
"devDependencies": { "devDependencies": {

View file

@ -27,6 +27,7 @@ $weight-normal: 400;
$body-background-color: $black; $body-background-color: $black;
$family-sans-serif: Nunito, $family-sans-serif; $family-sans-serif: Nunito, $family-sans-serif;
$family-monospace: Hack, $family-monospace;
$text: $grey-light; $text: $grey-light;
$text-strong: $primary; $text-strong: $primary;

View file

@ -24,4 +24,25 @@ $weights: 300, 400, 500, 600, 700;
$display: auto, $display: auto,
$style: normal, $style: normal,
$fontDir: "~/node_modules/@fontsource/arimo/files" $fontDir: "~/node_modules/@fontsource/arimo/files"
) );
// Hack *does* come with its own CSS, but it's broken and hasn't seen
// a release since https://github.com/source-foundry/Hack/issues/467
// was resolved.
$variants:
regular 400 normal,
bold 700 normal,
italic 400 italic,
bolditalic 700 italic;
@each $name, $weight, $style in $variants {
@font-face {
font-family: "Hack";
src:
url("~/node_modules/hack-font/build/web/fonts/hack-#{$name}-subset.woff2?sha=3114f1256") format("woff2"),
url("~/node_modules/hack-font/build/web/fonts/hack-#{$name}-subset.woff?sha=3114f1256") format("woff");
font-weight: $weight;
font-style: $style;
}
}