rebassjs / rebass

:atom_symbol: React primitive UI components built with styled-system.
https://rebassjs.org
MIT License
7.94k stars 658 forks source link

Can I change theme CSS based on parent class? #1157

Open mmukhin opened 1 year ago

mmukhin commented 1 year ago

Let's say this is my default <Input /> theme.

image

What if I wanted to create a different style for a form with a class ".form2", how would I adjust the <Input /> to have a red background only for a parent form with class ".form2"?

In CSS, I'd just do .form2 input { background: red; } but with these themes, I'm not sure how to target the parent of the input: {} styles. Can I do something similar to:

image