I'm trying to use component selectors in my emotion styles. Did you have any luck doing so?
For example, I have this OnOffSwitch component which has some child elements:
OnOffSwitch
const OnOffWrapper = styled.div` display: inline-block; ${props => props.isChecked ? ` ${OnOffTrack} { background-color: ${props.color}; border: 1px solid ${props.color}; } ${OnOffHandle} { transform: none; background-color: ${props.color}; } ` : ` ${OnOffTrack} { background-color: transparent; border: 1px solid ${colors.silver}; } ${OnOffHandle} { transform: translateX(-100%); background-color: ${colors.silver}; } `} `;
These styles (anything below display: inline-block;) are being ignored now.
display: inline-block;
I've found this, but there's no mention of how to achieve this with Vite: github.com/emotion-js/emotion/issu... Also this, which throws an error immediately ("Uncaught SyntaxError: missing ) after argument list"): stackoverflow.com/questions/614352...
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm trying to use component selectors in my emotion styles. Did you have any luck doing so?
For example, I have this
OnOffSwitch
component which has some child elements:These styles (anything below
display: inline-block;
) are being ignored now.I've found this, but there's no mention of how to achieve this with Vite: github.com/emotion-js/emotion/issu...
Also this, which throws an error immediately ("Uncaught SyntaxError: missing ) after argument list"):
stackoverflow.com/questions/614352...