Skip to content

Commit a6c3ee0

Browse files
authored
self-host fonts, match monospace one with react.dev (#4805)
1 parent 66eccbb commit a6c3ee0

7 files changed

+39
-9
lines changed

website/src/css/customTheme.scss

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@
3333
--ifm-font-family-base:
3434
"Optimistic Display", system-ui, -apple-system, sans-serif;
3535
--ifm-font-family-monospace:
36-
Source Code Pro, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
37-
"Courier New", monospace;
36+
"Source Code Pro", SFMono-Regular, Menlo, Monaco, Consolas,
37+
"Liberation Mono", "Courier New", monospace;
38+
3839
--ifm-color-primary: #06bcee;
3940
--ifm-color-primary-75: #087ea4cc;
4041
--ifm-code-background: rgba(0, 0, 0, 0.06);
4142
--ifm-font-size-base: 17px;
43+
--ifm-code-font-size: 92%;
4244
--ifm-spacing-horizontal: 16px;
4345
--ifm-navbar-item-padding-horizontal: 18px;
4446
--ifm-menu-link-padding-horizontal: 0;
@@ -192,24 +194,42 @@ html[data-theme="dark"] {
192194

193195
@font-face {
194196
font-family: "Optimistic Display";
195-
src: url("https://facebookmicrosites.github.io/design/public/fonts/OptimisticDisplayLight-199be98cf48e5b4c688356b08a02362c.woff2")
196-
format("woff2");
197+
src: url("/static/fonts/Optimistic-Display-Light.woff2") format("woff2");
197198
font-weight: 300;
198199
font-style: normal;
199200
}
200201

201202
@font-face {
202203
font-family: "Optimistic Display";
203-
src: url("https://facebookmicrosites.github.io/design/public/fonts/OptimisticDisplayRegular-b0e4e99f91efd0021c3ab8e4df0e6e1b.woff2")
204-
format("woff2");
204+
src: url("/static/fonts/Optimistic-Display-Regular.woff2") format("woff2");
205+
font-weight: 400;
206+
font-style: normal;
207+
}
208+
209+
@font-face {
210+
font-family: "Optimistic Display";
211+
src: url("/static/fonts/Optimistic-Display-Medium.woff2") format("woff2");
205212
font-weight: 500;
206213
font-style: normal;
207214
}
208215

209216
@font-face {
210217
font-family: "Optimistic Display";
211-
src: url("https://facebookmicrosites.github.io/design/public/fonts/OptimisticDisplayBold-3a50548145f36de582c3b36d9626f4d6.woff2")
212-
format("woff2");
218+
src: url("/static/fonts/Optimistic-Display-Bold.woff2") format("woff2");
219+
font-weight: 700;
220+
font-style: normal;
221+
}
222+
223+
@font-face {
224+
font-family: "Source Code Pro";
225+
src: url("/static/fonts/Source-Code-Pro-Regular.woff2") format("woff2");
226+
font-weight: 400;
227+
font-style: normal;
228+
}
229+
230+
@font-face {
231+
font-family: "Source Code Pro";
232+
src: url("/static/fonts/Source-Code-Pro-Bold.woff2") format("woff2");
213233
font-weight: 700;
214234
font-style: normal;
215235
}
@@ -288,9 +308,13 @@ hr {
288308
margin-top: 0;
289309
}
290310

311+
pre code {
312+
line-height: 1.4 !important;
313+
}
314+
291315
code {
292316
border-color: transparent;
293-
vertical-align: initial;
317+
vertical-align: baseline;
294318
}
295319

296320
kbd {
@@ -572,6 +596,10 @@ html[data-theme="dark"] article .badge {
572596
}
573597
}
574598

599+
.alert {
600+
padding: 24px 28px;
601+
}
602+
575603
.alert--secondary {
576604
--ifm-alert-border-color: hsl(from var(--light) h calc(s - 20) calc(l + 30));
577605
--ifm-alert-background-color: var(--ifm-color-secondary-lightest);
@@ -629,6 +657,7 @@ html[data-theme="dark"] .homepage {
629657
line-height: var(--ifm-pre-line-height);
630658
text-align: center;
631659
border-radius: var(--ifm-alert-border-radius);
660+
padding: var(--ifm-alert-padding-vertical) var(--ifm-alert-padding-horizontal);
632661

633662
a {
634663
color: var(--ifm-font-color-base) !important;
@@ -1271,6 +1300,7 @@ div[class^="tableOfContents"] {
12711300
background: none;
12721301
padding: 0;
12731302
border: 0;
1303+
vertical-align: baseline;
12741304
}
12751305

12761306
&:hover {
23.1 KB
Binary file not shown.
21.6 KB
Binary file not shown.
22.8 KB
Binary file not shown.
22.3 KB
Binary file not shown.
75.6 KB
Binary file not shown.
74.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)