1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-11-23 11:46:08 -05:00

fix font css vars

This commit is contained in:
2025-04-10 20:23:34 -04:00
parent a63098b150
commit eb84ec37ee
13 changed files with 71 additions and 82 deletions

View File

@@ -1,14 +0,0 @@
import hash from "@emotion/hash";
// a little hacky-hack to have react combine all of these css var declarations into a single <style> tag up top. see:
// https://react.dev/reference/react-dom/components/style#rendering-an-inline-css-stylesheet
export const setRootCssVariables = (vars: Record<string, string>) => {
const root = Object.entries(vars)
.map(([key, value]) => `--${key}:${value}`)
.join(";");
return {
href: hash(root),
dangerouslySetInnerHTML: { __html: `:root{${root}}` },
};
};