Plumeria 0.12.0
2025/06/29
Imporved a way for return class name.
styles.$namecan now be used as aclassNameaccessor.
Example: styles.$button
The previous styles.button (object) can still be used.
definingStyles
const styles = css.create({
button: {
color: "blue",
},
size: {
width: 24,
height: 24,
},
})<div className={styles.$button} /> // assign a string directlyYou can put it directly as a string by prepending a $, this will act as a key hash directly.
This is useful if you want to apply a single style.
The class name is not meta information of the style object, but an artifact(representation) of the style.
Therefore, it is provided in a flat structure: styles.$name.
Provides a clean separation between design
(objects)and presentation(class names).
Apply a single style intuitively withstyles.$name. Apply multiple or conditional styles explicitly withcss.props().
If you want to apply multiple classes as per the previous syntax, the following syntax is supported:
<div className={css.props(styles.button, styles.size)} />