Created
July 11, 2018 17:38
-
-
Save kof/95590050383c41eeebe60cb378a1ecc7 to your computer and use it in GitHub Desktop.
static jss as a raw css string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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