Variants incorrect priority
Author: panzelvaCreated Apr 22, 2022Updated Sep 6, 2023
LabelsbugP1
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
In the sandbox, there is styled component Button, that has variants variant and isDisabled. 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
- OS: Ubuntu 21.10
- Browser: chrome
- Version of Stitches: 1.2.7
- Version of Node.js: 16.14.0
Source: stitchesjs/stitches