Open panzelva opened 2 years ago
I changed this behavior in the fork I prepared for my company. Variants take priority due to the order of declaration, not the order of use
https://github.com/patchkit-net/stitches
yarn add git+https://github.com/patchkit-net/stitches-react-package.git
stitches-fork-demo.zip stitches-original-demo.zip Original: Forked:
Bug report
Describe the bug
Looks like there is some inconsistency how stitches prioritizes styles from variants. I would expect, that variant that is declared later in styled component would take priority, but it looks like sometimes it does and sometimes it doesn't. If this is not the case, I would expect that it is atleast consistent.
I guess that this is not big issue, because I can use compoundVariants, but the inconsistency seems wierd.
To Reproduce
Please see this sandbox.
In the sandbox, there is styled component
Button
, that has variantsvariant
andisDisabled
. When combining these variants,isDisabled
sometimes takes priority, sometimes doesn't.Expected behavior
isDisabled
always takes priority, because its declared later in styled component.Screenshots
System information