Skip to content

Commit 580c1bd

Browse files
authored
fix(typography): properly pass Google font options (#1825)
1 parent 270a5dc commit 580c1bd

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

docs/configuration.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,25 @@ Some plugins are included by default in the [`quartz.config.ts`](https://github.
108108
You can see a list of all plugins and their configuration options [[tags/plugin|here]].
109109

110110
If you'd like to make your own plugins, see the [[making plugins|making custom plugins]] guide.
111+
112+
## Fonts
113+
114+
Fonts can be specified as a `string` or a `FontSpecification`:
115+
116+
```ts
117+
// string
118+
typography: {
119+
header: "Schibsted Grotesk",
120+
...
121+
}
122+
123+
// FontSpecification
124+
typography: {
125+
header: {
126+
name: "Schibsted Grotesk",
127+
weights: [400, 700],
128+
includeItalic: true,
129+
},
130+
...
131+
}
132+
```

quartz/util/theme.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ ${stylesheet.join("\n\n")}
105105
--highlight: ${theme.colors.lightMode.highlight};
106106
--textHighlight: ${theme.colors.lightMode.textHighlight};
107107
108-
--headerFont: "${theme.typography.header}", ${DEFAULT_SANS_SERIF};
109-
--bodyFont: "${theme.typography.body}", ${DEFAULT_SANS_SERIF};
110-
--codeFont: "${theme.typography.code}", ${DEFAULT_MONO};
108+
--headerFont: "${getFontSpecificationName(theme.typography.header)}", ${DEFAULT_SANS_SERIF};
109+
--bodyFont: "${getFontSpecificationName(theme.typography.body)}", ${DEFAULT_SANS_SERIF};
110+
--codeFont: "${getFontSpecificationName(theme.typography.code)}", ${DEFAULT_MONO};
111111
}
112112
113113
:root[saved-theme="dark"] {

0 commit comments

Comments
 (0)