release: WRNexusJS 0.8.0
This commit is contained in:
@@ -11,7 +11,52 @@
|
||||
* emitted as the native CSS property instead of a custom property.
|
||||
*/
|
||||
|
||||
export type ThemeTokens = Record<string, string>;
|
||||
export type ThemeSemanticColor =
|
||||
"primary" | "secondary" | "info" | "success" | "warning" | "danger" | "error";
|
||||
export type ThemeToken =
|
||||
| "color-scheme"
|
||||
| "color-bg"
|
||||
| "color-background"
|
||||
| "color-foreground"
|
||||
| "color-surface"
|
||||
| "color-surface-2"
|
||||
| "color-surface-raised"
|
||||
| "color-surface-muted"
|
||||
| "color-text"
|
||||
| "color-text-muted"
|
||||
| "color-text-subtle"
|
||||
| "color-muted"
|
||||
| "color-border"
|
||||
| "color-border-strong"
|
||||
| "color-code-background"
|
||||
| "color-code-surface"
|
||||
| "color-code-text"
|
||||
| "color-code-muted"
|
||||
| "color-code-border"
|
||||
| `color-${ThemeSemanticColor}`
|
||||
| `color-${ThemeSemanticColor}-${"hover" | "active" | "contrast" | "soft" | "muted" | "text"}`
|
||||
| `color-on-${"primary" | "secondary"}`
|
||||
| "radius"
|
||||
| "radius-sm"
|
||||
| "shadow-1"
|
||||
| "shadow-sm"
|
||||
| "shadow-md"
|
||||
| "shadow-lg"
|
||||
| "space-section"
|
||||
| "space-section-sm"
|
||||
| "container-max"
|
||||
| "font-sans";
|
||||
|
||||
/** Known tokens get autocomplete while applications may add namespaced custom tokens. */
|
||||
export type ThemeTokens = Partial<Record<ThemeToken, string>> & Record<string, string>;
|
||||
|
||||
export function defineThemeTokens<T extends ThemeTokens>(tokens: T): T {
|
||||
return tokens;
|
||||
}
|
||||
|
||||
export function themeVar(token: ThemeToken, fallback?: string): string {
|
||||
return `var(--wire-${token}${fallback ? `, ${fallback}` : ""})`;
|
||||
}
|
||||
|
||||
export const THEME_PALETTE_NAMES = [
|
||||
"blue",
|
||||
|
||||
Reference in New Issue
Block a user