Closed dvoytenko closed 4 years ago
Related to https://github.com/ampproject/wg-bento/issues/7
This pull request highlights several important CSS interactions:
See View1.css.js and View1.js.
It uses a popular JSS framework. It was picked for this demo because it's one of a more flexible frameworks that can be mapped to other approaches, such as import .css, styled-components, etc.
import .css
const styles = { myButton: {color: 'green', display: 'flex', ...} } const useStyles = createUseStyles(styles); function MyComponent() { const classes = useStyles(); return (<div className={classes.myButton}></div>); }
See extract-css.js.
The main steps are (and simpler steps are likely possible):
Related to https://github.com/ampproject/wg-bento/issues/7
This pull request highlights several important CSS interactions:
1. A CSS in JS example
See View1.css.js and View1.js.
It uses a popular JSS framework. It was picked for this demo because it's one of a more flexible frameworks that can be mapped to other approaches, such as
import .css
, styled-components, etc.2. How to extract CSS-in-JSS declarations into a stylesheet
See extract-css.js.
The main steps are (and simpler steps are likely possible):