@zephora/theme
v1.0.0
Published
Theming engine for Zephora UI — ready-made light/dark/aura/material themes, createTheme() and a runtime <ThemeProvider> built on CSS custom properties.
Maintainers
Readme
@zephora/theme
Theming engine and locales for Zephora UI — ready-made
themes, createTheme(), a runtime <ThemeProvider> and 48 loadable locales, all
built on CSS custom properties.
Install
npm install @zephora/themeTheming
Themes are plain objects compiled to --z-* CSS variables — switching a theme
updates variables instantly, with zero re-render cost for styles.
import { createTheme, lightTheme, ThemeProvider, applyTheme } from "@zephora/theme";
const brand = createTheme(lightTheme, {
name: "brand",
colors: { primary: "#0f766e", primaryHover: "#115e59", ring: "#14b8a6" },
radius: "0.75rem",
});
// Scoped: wrap a subtree
<ThemeProvider theme={brand}>...</ThemeProvider>;
// Global: write variables to <html> at runtime
applyTheme(brand);Ready-made: lightTheme, darkTheme, auraTheme, materialTheme. Helpers for
FOUC-free SSR dark mode (colorSchemeCss, useColorScheme) are included.
Locales
Only en is embedded; every other language is a separate module or JSON file, loaded
and registered at runtime — 48 ship ready-made.
import { addLocale } from "@zephora/react";
import { trLocale } from "@zephora/theme/locales/tr";
addLocale("tr", trLocale);
// or fetch @zephora/theme/locales/tr.jsonDocumentation
zephoraui.com/theming · zephoraui.com/localization
