Referring to other components within sx
?
#1082
Unanswered
evanfrawley
asked this question in
General
Replies: 1 comment
-
Unfortunately this is not possible with Theme UI right now, since instances of components aren’t reference-able in the same way. I’d love for this syntax to be possible, though: <Heading sx={{ [Badge]: { bg: 'green', ml: 3 } }}>
Welcome!
<Badge>2</Badge>
</Heading> (I tried it, doesn’t work :( https://repl.it/@lachlanjc/theme-ui-referencing) |
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.
-
Hi!
Absolutely love the
theme-ui
, thank you for building it :)When I used it, one of my favorite parts of using
styled-components
was referencing other components to do complex styling, such as hovering over a parent to trigger some styles on a child.Right now, I am accomplishing this by setting a
className
on the child that I want to change styling of and usingI am wondering if there are plans to reference other components such that I can do
Beta Was this translation helpful? Give feedback.
All reactions