-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Descendant selectors #131
Comments
I see two solutions, you can either pass in a style sheet
and inside the component
or colocate your styles with your components. |
But why? Why does aphrodite not support descendant selectors? The api is already there for pseudo selectors. Also, my project is using third party react components that I did not write. How would I go about styling nested components that I did not write? (e.g. I am importing the entire component from npm) |
@adamjking3 We have a long issue thread at #10 about descendant selectors, which I'm going to merge this into. The gist of it is that we're thinking of a way to do it, but it's hard to find a way that both makes the API clear/obvious, and doesn't expose too much power in case we want to change how internals work in the future that would break those use cases.
Aphrodite is a library for styling components. It isn't a goal of the library to be able to style things that are not already using Aphrodite. |
What is the current best practice for selecting child elements from a parent? For example, in one project I need to style the children of a react component that renders subcomponents. I can't do that unless I have descendant selectors. As far as I can tell, there isn't currently any syntax for selecting a '.childClass' from a parent.
e.g.
parent: { color: 'red', '.childClass': { backgroundColor: 'blue' } }
Are there any hacks/planned PR's for this sort of thing or am I just missing how to do this in the docs?
The text was updated successfully, but these errors were encountered: