2

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',
      }
    }
Victor Tsang
  • 21
  • 1
  • 2

1 Answers1

10

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',
      }
    }
Anwardo
  • 650
  • 5
  • 15