Replies: 2 comments 1 reply
-
Here's another workaround: const childBase = style({});
const parentBase = style({});
const child = style([childBase, {
selectors: {
[`${parentBase} &`]: {
color: 'red',
},
},
}]);
const parent = style([parentBase, {
selectors: {
[`&:has(${childBase})`]: {
padding: '10px',
},
},
}]); |
Beta Was this translation helpful? Give feedback.
1 reply
-
We can use getters to make circular selectors, here is the section in docs https://vanilla-extract.style/documentation/styling/#circular-selectors |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Since VE doesn't allow selecting child classes there can be cases where you can have circle references.
As workaround we can use a function in selector prop, something like that:
UPD: There is a PR to allow functional selectors #1081
Beta Was this translation helpful? Give feedback.
All reactions