API reference
defineConsts
Define static constant values to use inside Plumeria styles.
The defineConsts
function defines static constant values (not CSS variables) that can be used inside create()
or defineTheme()
for conditions like media queries or other static references.
It is useful for creating values such as breakpoints, spacing scales, or other fixed design constants that don't rely on CSS variable resolution.
🎯 Example: Creating breakpoints
These constants are fully type-safe, readonly, and enforced as as const.
🎨 Using constants in styles
You can use these constants for any static keys inside styles or themes.
✅ Type enforcement benefits
- Enforces as const automatically
- Restricts to string | number values only
- Disallows object nesting
- Produces a readonly type automatically
This helps reduce bugs and keeps your design tokens predictable.