Add URL params to control fonts
This was also a good chance to switch to the semantic font size names used in Compound.
This commit is contained in:
parent
e6e18dd3f9
commit
acc41c532e
19 changed files with 156 additions and 58 deletions
|
|
@ -133,6 +133,21 @@ export class Initializer {
|
|||
import.meta.env.VITE_THEME_BACKGROUND_85 as string
|
||||
);
|
||||
}
|
||||
|
||||
// Custom fonts
|
||||
const { fonts, fontScale } = getUrlParams();
|
||||
if (fontScale !== null) {
|
||||
document.documentElement.style.setProperty(
|
||||
"--font-scale",
|
||||
fontScale.toString()
|
||||
);
|
||||
}
|
||||
if (fonts.length > 0) {
|
||||
document.documentElement.style.setProperty(
|
||||
"--font-family",
|
||||
fonts.map((f) => `"${f}"`).join(", ")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public static init(): Promise<void> | null {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue