Skip to content

Commit e50254d

Browse files
CobusTFil
andauthored
Documentation font changes (#2139)
* branding changes * removed 'Enterprise' link from footer * css tweaks * Fixed color of button text on main page. * Use Vitepress headers for faster font loading See https://vitepress.dev/reference/site-config#example-adding-google-fonts Note that we're using the (slightly faster?) "preload as stylesheet" strategy —as we do in Framework— over "preconnect" that Vitepress suggests. * normalize hex color to lowercase * scope a.button to .promo, to remove an !important (a.button is not used anywhere else; introduced in #1757) * base * fixed h1 heading font and removed h1 margin * revert the change to vp-font-family-base * rename base classes * merged 2 root sections of css --------- Co-authored-by: Philippe Rivière <[email protected]>
1 parent 1d01e25 commit e50254d

File tree

4 files changed

+29
-12
lines changed

4 files changed

+29
-12
lines changed

docs/.vitepress/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export default defineConfig({
2525
}
2626
},
2727
head: [
28+
["link", {rel: "preconnect", href: "https://fonts.gstatic.com", crossorigin: ""}],
29+
["link", {rel: "preload", as: "style", href: "https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Spline+Sans+Mono:ital,wght@0,300..700;1,300..700&display=swap"}],
30+
["link", {rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Spline+Sans+Mono:ital,wght@0,300..700;1,300..700&display=swap"}],
2831
["link", {rel: "apple-touch-icon", href: "https://static.observablehq.com/favicon-512.0667824687f99c942a02e06e2db1a060911da0bf3606671676a255b1cf97b4fe.png"}],
2932
["link", {rel: "icon", type: "image/png", href: "https://static.observablehq.com/favicon-512.0667824687f99c942a02e06e2db1a060911da0bf3606671676a255b1cf97b4fe.png", sizes: "512x512"}],
3033
["script", {async: "", src: "https://www.googletagmanager.com/gtag/js?id=G-9B88TP6PKQ"}],

docs/.vitepress/theme/CustomFooter.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
<li class="mb2"><a target="_blank" href="https://observablehq.com/plot">Plot</a></li>
2626
<li class="mb2"><a target="_blank" href="https://observablehq.com/data-integrations">Integrations</a></li>
2727
<li class="mb2"><a target="_blank" href="https://observablehq.com/pricing">Pricing</a></li>
28-
<li class="mb2"><a target="_blank" href="https://observablehq.com/enterprise">Enterprise</a></li>
2928
</ul>
3029
</div>
3130
</div>

docs/.vitepress/theme/ObservablePromo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ h1 {
6262
opacity: 0.7;
6363
}
6464
65-
a.button {
65+
.promo a.button {
6666
display: inline-block;
6767
border: 1px solid transparent;
6868
text-align: center;

docs/.vitepress/theme/custom.css

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,40 @@
33
--vp-c-purple-2: #7f42cd;
44
--vp-c-purple-3: #9555e2;
55
--vp-c-purple-soft: rgba(155, 91, 233, 0.14);
6+
--vp-c-red: #f43f5e;
7+
--vp-c-green: #10b981;
8+
--vp-c-blue: #0092ff;
9+
--vp-c-purple: #a463f2;
10+
--vp-c-brand-1: var(--vp-c-purple-1);
11+
--vp-c-brand-2: var(--vp-c-purple-2);
12+
--vp-c-brand-3: var(--vp-c-purple-3);
13+
--vp-c-brand-soft: var(--vp-c-purple-soft);
14+
--vp-font-family-base: -apple-system, BlinkMacSystemFont, "avenir next", avenir, helvetica, "helvetica neue", ubuntu,
15+
roboto, noto, "segoe ui", arial, sans-serif;
16+
--sans-text: Inter, var(--vp-font-family-base);
17+
--mono-heading: "Spline Sans Mono", monospace;
618
}
719

820
.dark {
921
--vp-c-purple-1: #db96ff;
1022
--vp-c-purple-2: #9a5ae8;
1123
--vp-c-purple-3: #884ad6;
1224
--vp-c-purple-soft: rgba(155, 91, 233, 0.16);
25+
--vp-c-text-1: #f5f5f5;
1326
}
1427

15-
:root {
16-
--vp-c-red: #f43f5e;
17-
--vp-c-green: #10b981;
18-
--vp-c-blue: #0092ff;
19-
--vp-c-purple: #a463f2;
20-
--vp-c-brand-1: var(--vp-c-purple-1);
21-
--vp-c-brand-2: var(--vp-c-purple-2);
22-
--vp-c-brand-3: var(--vp-c-purple-3);
23-
--vp-c-brand-soft: var(--vp-c-purple-soft);
24-
--vp-font-family-base: -apple-system, BlinkMacSystemFont, "avenir next", avenir, helvetica, "helvetica neue", ubuntu, roboto, noto, "segoe ui", arial, sans-serif;
28+
.vp-doc {
29+
font-family: var(--sans-text);
30+
font-weight: 500;
31+
}
32+
33+
.vp-doc h1 {
34+
font-family: var(--mono-heading);
35+
font-weight: 500;
36+
}
37+
38+
.vp-doc a {
39+
color: var(--vp-c-text-1);
2540
}
2641

2742
.vp-doc figcaption {

0 commit comments

Comments
 (0)