10.0.2-0 • Published 5 years ago

oliviertassinari-jss-plugin-syntax-global v10.0.2-0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Global Styles for JSS

If you want to write regular globally scoped CSS with JSS, this plugin is for you. Don't use it if you can avoid it.

Gitter

Top level global declarations block

const styles = {
  '@global': {
    body: {
      color: 'green'
    },
    a: {
      textDecoration: 'underline'
    },
    '@keyframes a': {
      to: {
        width: '100%'
      }
    }
  }
}

Top level global prefix

const styles = {
  '@global body': {
    color: 'green'
  },
  '@global @keyframes a': {
    to: {
      width: '100%'
    }
  }
}

Nested global declarations block

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

Nested global prefix

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

Issues

File a bug against cssinjs/jss prefixed with [jss-global].

Run tests

yarn
yarn test

License

MIT