MCPcopy Create free account
hub / github.com/SuboptimalEng/coding-tutorials / applyTheme

Function applyTheme

_templates/01-basic/src/themes/utils.ts:3–8  ·  view source on GitHub ↗
(theme: ITheme)

Source from the content-addressed store, hash-verified

1import { ITheme } from './base';
2
3export function applyTheme(theme: ITheme) {
4 const root = document.documentElement;
5 Object.keys(theme).forEach((cssVar) => {
6 root.style.setProperty(cssVar, theme[cssVar]);
7 });
8}
9
10export interface ICreateTheme {
11 primary: string;

Callers 1

AppFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected