Open GianDigia opened 2 years ago
I'm pretty consistently running into this problem, with simple patterns like this:
const Media = styled('div');
const Body = styled('div');
const Card = styled('div', {
display: 'flex',
variants: {
direction: {
row: {
flexDirection: 'row',
[`& ${Media}`]: {
flexShrink: 0,
flexBasis: '66%',
},
},
column: {
flexDirection: 'column',
},
},
},
defaultVariants: { direction: 'column' },
});
Then both Media
and Body
get those properties applied. Is there any workaround in the meantime? Can I force a different class name?
You can use a dummy css variable to ensure a unique hash for the styles.
Hi
I have the same problem. Any updates ?
Bug report
Describe the bug
Creating two components with the same CSS the classNames generated is the same. This is particularly bad while composing styles.
To Reproduce
Create two components with the same style. Then create a wrapping stitches component and try to style one of the two child.
Calling A with B and C inside
the resulting code will be
and both B and C will be coloured in red
Expected behavior
The generated classNames should be different eg.