Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
76 lines (62 sloc) 895 Bytes

Global selectors

Selectors have a generated (scoped) suffix by default to avoid conflicts. You can use this plugin to generate a global selector.

Top level global declarations block

const styles = {
  '@global': {
    body: {
      color: 'green'
    },
    a: {
      textDecoration: 'underline'
    }
  }
}

Compiles to:

body {
  color: green;
}
a {
  text-decoration: underline;
}

Nested global declarations block

const styles = {
  button: {
    float: 'left',
    '@global': {
      span: {color: 'red'}
    }
  }
}

Compiles to:

.button-0 {
  float: left;
}
.button-0 span {
  color: red;
}

Nested global prefix

const styles = {
  button: {
    float: 'left',
    '@global span': {color: 'red'}
  }
}

Compiles to:

.button-0 {
  float: left;
}
.button-0 span {
  color: red;
}