Skip to content

Commit

Permalink
Use Montserrat font for headings to match godotengine.org
Browse files Browse the repository at this point in the history
This provides a visual look closer to the website and helps headings
stand out more thanks to their bolder weight.
  • Loading branch information
Calinou committed Feb 24, 2024
1 parent c8d799d commit 474c9b8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions _static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,31 @@

@font-face {
font-family: "JetBrains Mono";
src: url('fonts/JetBrainsMono-Regular.woff2');
font-weight: 400;
font-style: normal;
font-display: swap;
src: url("fonts/JetBrainsMono-Regular.woff2");
}
@font-face {
font-family: "JetBrains Mono";
src: url('fonts/JetBrainsMono-Medium.woff2');
font-weight: 600;
font-style: normal;
font-display: swap;
src: url("fonts/JetBrainsMono-Medium.woff2");
}
@font-face {
font-family: "JetBrains Mono";
src: url('fonts/JetBrainsMono-Bold.woff2');
font-weight: 700;
font-style: normal;
font-display: swap;
src: url("fonts/JetBrainsMono-Bold.woff2");
}
@font-face {
font-family: "Montserrat";
font-weight: 700;
font-style: normal;
font-display: swap;
src: url("fonts/Montserrat-Bold.woff2");
}

/* Default (light) theme colors */
Expand Down Expand Up @@ -148,6 +158,7 @@
--footer-color: #808080;

--system-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--header-font-family: "Montserrat", var(--system-font-family);
--monospace-font-family: "JetBrains Mono", SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, Courier, monospace;
}

Expand Down Expand Up @@ -279,25 +290,15 @@
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
input[type="text"],
input[type="button"],
input[type="reset"],
input[type="submit"],
textarea,
legend,
.btn,
.rst-content .toctree-wrapper p.caption,
.rst-versions {
/* Use a system font stack for better performance (no Web fonts required) */
font-family: var(--system-font-family);
/* Some fonts that we use (namely JetBrains Mono) can come with ligatures. It's better to opt-in if needed. */
font-variant-ligatures: none;
}

h1,
Expand All @@ -308,8 +309,8 @@ h5,
h6,
legend,
.rst-content .toctree-wrapper p.caption {
/* Use a lighter font for headers (Medium instead of Bold) */
font-weight: 500;
/* Use the same font as the godotengine.org website. */
font-family: var(--header-font-family);
}

/* See <https://github.com/godotengine/godot-docs/pull/5876> for context. */
Expand Down Expand Up @@ -500,6 +501,7 @@ html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method > dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).attribute > dt {
font-family: var(--monospace-font-family);
font-variant-ligatures: none;
font-size: 90%;
font-weight: normal;
margin-bottom: 16px;
Expand Down Expand Up @@ -551,6 +553,7 @@ html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(
}
html.writer-html5 .rst-content dl.field-list > dd strong {
font-family: var(--monospace-font-family);
font-variant-ligatures: none;
}

footer {
Expand Down Expand Up @@ -802,6 +805,7 @@ code,
.rst-content code {
font-size: .875em;
font-family: var(--monospace-font-family);
font-variant-ligatures: none;
background-color: var(--code-background-color);
border: none;
border-radius: 4px;
Expand Down Expand Up @@ -830,6 +834,7 @@ code,
font-size: 14px;
line-height: 1.5;
font-family: var(--monospace-font-family);
font-variant-ligatures: none;
}

/* Code tab display tweaks */
Expand Down Expand Up @@ -1098,6 +1103,7 @@ kbd.compound > .kbd,
.classref-descriptions-group > p.classref-enumeration-constant {
color: var(--classref-secondary-color);
font-family: var(--monospace-font-family);
font-variant-ligatures: none;
font-size: 110%;
font-weight: 600;
margin-bottom: 18px;
Expand Down Expand Up @@ -1194,6 +1200,7 @@ p + .classref-constant {

.classref-property-setget p {
font-family: var(--monospace-font-family);
font-variant-ligatures: none;
font-size: 100%;
line-height: 22px;
}
Expand Down
Binary file added _static/css/fonts/Montserrat-Bold.woff2
Binary file not shown.

0 comments on commit 474c9b8

Please sign in to comment.