Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
docs: add Consolas font and prioritize resource loading (#16225)
  • Loading branch information
amareshsm committed Sep 9, 2022
1 parent 1c388fb commit 1b5b2a7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions docs/src/_includes/layouts/base.html
Expand Up @@ -61,6 +61,8 @@
<link rel="preload" href="{{ '/assets/fonts/SpaceGrotesk-Medium-subset.woff2' | url }}" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="{{ '/assets/fonts/Inter-Regular-subset.woff2' | url }}" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="{{ '/assets/fonts/SpaceMono-Regular-subset.woff2' | url }}" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="{{ '/assets/fonts/Consolas.woff' | url }}" as="font" type="font/woff" crossorigin>
<link rel="preconnect" href="https://www.googletagmanager.com/">

<script>
(function () {
Expand All @@ -74,6 +76,16 @@


<style>

/* Overrides for funky punctuators */
@font-face {
font-family: "Mono Punctuators";
src: url("{{ '/assets/fonts/Consolas.woff' | url }}") format("woff");
font-weight: 400;
unicode-range: U+40, U+7B, U+7D, U+28, U+29;
font-display: swap;
}

/* Space Grotesk for headings */
@font-face {
font-family: "Space Grotesk";
Expand Down
Binary file added docs/src/assets/fonts/Consolas.woff
Binary file not shown.
1 change: 1 addition & 0 deletions docs/src/assets/scss/syntax-highlighter.scss
Expand Up @@ -12,6 +12,7 @@ pre[class*="language-"] {
word-break: normal;
word-wrap: normal;
line-height: 1.5;
font-variant-ligatures: none;

-moz-tab-size: 4;
-o-tab-size: 4;
Expand Down
2 changes: 1 addition & 1 deletion docs/src/assets/scss/tokens/typography.scss
Expand Up @@ -53,7 +53,7 @@
}

:root {
--mono-font: "Space Mono", monospace;
--mono-font: "Mono Punctuators", "Space Mono", monospace;
--text-font: "Inter",
-apple-system,
BlinkMacSystemFont,
Expand Down

0 comments on commit 1b5b2a7

Please sign in to comment.