Reputation: 21
I am using the jss preset default and it comes with jss-nested.
I could get '&:hover' to work but '&:first-child' does not work for me.
sample code:
summaryItem: {
borderLeft: '2px solid red',
'&:first-child': {
borderLeft: '2px solid transparent',
}
}
Upvotes: 2
Views: 6307
Reputation: 710
You need to add a space for calling child selectors else it would be like calling div:first-child
instead of div > :first-child
summaryItem: {
borderLeft: '2px solid red',
'& > :first-child': {
borderLeft: '2px solid transparent',
}
}
Upvotes: 10