Skip to content

Instantly share code, notes, and snippets.

@kof kof/example.js
Created Jul 11, 2018

Embed
What would you like to do?
static jss as a raw css string
// source js
const styles = {
static: {
color: 'green'
},
mixed: {
color: 'red',
margin: (props) => props.spacing
}
}
createStyleSheet(styles).attach()
// generated js
const styles = {
'@raw': `
.static-0-0-1 {
color: green;
}
.mixed-0-0-2 {
color: red;
}
`,
mixed: {
margin: (props) => props.spacing
}
}
const {classes} = createStyleSheet(styles, {
classes: {
static: 'static-0-0-1',
mixed: 'mixed-0-0-2'
}
}).attach()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.