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:
Robin Townsend 2022-12-09 14:25:02 -05:00
commit acc41c532e
19 changed files with 156 additions and 58 deletions

View file

@ -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 {