Skip to content
Discussion options

You must be logged in to vote

compoundVariants generates atomic CSS in the @layer utilities
due to static limitations, it's way easier to reason about if we just generate that CSS no matter the usage in your code (just like cva/sva)

if we JIT'd this as well, users would often expect those styles to be generated in simple cases that involves dynamic stuff
things like

const Button = ({ color, children }) => {
    const [variant, setVariant] = useState("contained")
    // ...
    return <div className={button({ color, variant })}>{children}</div>
}

which compoundVariants CSS should we generate in that case ? do we not generate anything unless using config.staticCss ? that doesn't look like a good DX


btw for your use-cas…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by astahmer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1600 on October 30, 2023 13:05.