Jss: write selectors with vendor prefixes

Created on 21 Jun 2019  路  3Comments  路  Source: cssinjs/jss

Hi, how i can write selectors with vendor prefixes? Now I use jss together with Material UI, I try to write this code, but it does not work. However, if I write this on vanilla css, the code works fine.

```
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}

docs question

Most helpful comment

Selectors are generated by default, to do this you need to use nesting or @global syntax

Nesting

{
  someComponent: {
    '& input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button': {
      WebkitAppearance: 'none',
      margin: 0
    }
  }
}

Global

{
  '@global': {
    'input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button': {
      WebkitAppearance: 'none',
      margin: 0
    }
  }
}

All 3 comments

Selectors are generated by default, to do this you need to use nesting or @global syntax

Nesting

{
  someComponent: {
    '& input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button': {
      WebkitAppearance: 'none',
      margin: 0
    }
  }
}

Global

{
  '@global': {
    'input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button': {
      WebkitAppearance: 'none',
      margin: 0
    }
  }
}

Keeping this issue open to add examples like that to documentation.

@kof, thank you so much! 馃槉

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HenriBeck picture HenriBeck  路  4Comments

antoinerousseau picture antoinerousseau  路  3Comments

valZho picture valZho  路  7Comments

Telokis picture Telokis  路  3Comments

kof picture kof  路  6Comments