Skip to documentation
Design system / Sources & standards
Current repository source
colorMode.ts
src/theming/colorMode.ts
This view contains the escaped source read during the deployment build. Code and policy text are unchanged. Markdown is shown as source, not rendered as a document. A new deployment refreshes the content.
import type { CSSProperties } from "react";
import { getTenantThemeStyle } from "./tenantThemes";
/** Compose independently selected, server-resolved palettes without client fetching. */
export function getColorModeThemeStyle(lightStyle: CSSProperties, darkStyle: CSSProperties = getTenantThemeStyle("default-dark")): CSSProperties {
const tokens = lightStyle as Record<string, string>;
const darkTokens = darkStyle as Record<string, string>;
return Object.fromEntries(Object.entries(tokens).map(([name, light]) => [
name,
`light-dark(${light}, ${darkTokens[name]})`,
])) as CSSProperties;
}
All sources and standards