Skip to content
This repository has been archived by the owner on Jan 27, 2019. It is now read-only.

Latest commit

 

History

History

jss

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

JSS

RepoDocs

// app.js
import injectSheet from 'react-jss';

const styles = {
  container: {
    margin: '0 auto',
    width: '100%',
    '@media screen and (min-width: 360px)': {
      maxWidth: '400px',
    },
    '@media screen and (min-width: 600px)': {
      maxWidth: '600px',
    },
  },
};

const App = (props) => (
  <div className={props.sheet.classes.container}>
    <Tweet data={data} />
  </div>
);

export default injectSheet(styles)(App);

Checklist

  • ✅ No build requirements
  • ✅ Small and lightweight
  • 😕 Supports global CSS (requires separate setup)
  • ✅ Supports entirety of CSS
  • ✅ Colocated
  • ✅ Isolated
  • ✅ Doesn’t break inline styles
  • 😕 Easy to override (inline styles, but no standard mechanism)
  • ❌ Theming
  • ❌ Pre-build
  • ✅ Server side rendering
  • ❌ No wrapper components
  • ❌ ReactNative support

Legend: ✅ = Yes, ❌ = No, 😕 = Kinda, refer to notes or parentheses

Notes

  • Has plugin system
  • Supports all selectors (nesting, children, siblings,…), requires custom '&selector' notation though (e.g. '&:hover', & div)