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
nth-of-type example #6
Comments
@DjordjePetrovic Could you please give me a specific code example (e.g. component and styles) that shows what you're trying to achieve and how you currently do that? |
let's say in component we have something like this
and in css
so I create cssToJS style object for "example" div, and what I wanted to do is to have something like
but I get "value must be a number or a string" So I assume I'll have to create style object for every "p" element and then attach styling on every p like
? |
This looks like a reasonable use case which should be addressed. I'm going to add support for it but this may take a few days since my spare time is somewhat limited currently. But I am always open for pull requests if you'd like to speed up the process. |
@martinandert great tnx! |
Hey @DjordjePetrovic, with version 1.2.0 you are now able to do var styles = cssInJS({
example: {
// some styling
},
'example p': {
':nth-child(2)': {
// styles for p:nth-child(2) children
}
}
}); Please let me know whether that works for you. |
For stuff like this in css
p:nth-of-type(1) {}
p:nth-of-type(2) {}
p:nth-of-type(3) {}
you basically need to create object with styling for every p and then attach it to that element? What's the best practice for this stuff?
The text was updated successfully, but these errors were encountered: