create
Define local component-scoped styles with full type-safety and static generation.
The create
method defines static, component-scoped styles using plain JavaScript objects.
It is type-safe keys, compile-time validation, and scoped class names through automatic hashing.
Only the styles you use in css.props()
will be compiled.
Atomic API
Unique atom classes are reused without duplication, keeping the amount of class names constant.
Example
Output:
Plumeria compiles each style property into a unique, atomic, and hashed class name. This prevents style collisions and maximizes reusability.
Generated CSS:
Resulting:
Circular references
If modules reference each other circularly, the compiler will fail to compile them correctly. This design encourages a local, linear style structure that's easier to understand, faster to compile, and less error-prone across large codebases and bundlers like rscute.