Open History to see the last commit
1import defaultThemeVariables from "../../generated-uniwind-default-theme-variables.json";
2
3import {
4 DEFAULT_MOBILE_THEME_ID,
5 getMobileThemeVariables,
6 type MobileThemeAppearance,
7 type MobileThemeId,
8 type MobileThemeVariables,
9} from "./mobileTheme";
10
11const defaults = defaultThemeVariables as Readonly<
12 Record<MobileThemeAppearance, MobileThemeVariables>
13>;
14
15/**
16 * Complete palette for native and third-party APIs that cannot consume a
17 * Uniwind className. The standard palette is generated from global.css; custom
18 * palettes share the same source that generates their registered CSS themes.
19 */
20export function getMobileThemeRuntimeVariables(
21 themeId: MobileThemeId,
22 appearance: MobileThemeAppearance,
23): MobileThemeVariables {
24 return themeId === DEFAULT_MOBILE_THEME_ID || themeId === "material-you"
25 ? defaults[appearance]
26 : getMobileThemeVariables(themeId, appearance);
27}