Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add Consolas font and prioritize resource loading #16225

Merged
merged 3 commits into from Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consolas was never added to this repo. We'd need to duplicate what's in this PR:

eslint/eslint.org#318

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

<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