0.2.0 • Published 6 years ago
@poi/plugin-astroturf v0.2.0
@poi/plugin-astroturf
Use astroturf to write CSS in JS with zero-runtime.
Install
yarn add astroturf @poi/plugin-astroturf --devHow to use
In your poi.config.js:
module.exports = {
plugins: [
{
resolve: '@poi/plugin-astroturf',
options: {}
}
]
}Then write css-in-js:
import { css } from 'astroturf'
const style = css`
.title {
font-size: 2em;
}
`
export const App = () => {
return <div className={style.title}>Hello world</div>
}Check out astroturf for more usages.
Options
loaderOptions:astroturf/loaderoptionsloaderOptions.extension: Default.module.css. You can also change it to.scssor.module.scssetc to use CSS pre-processors, but make sure that it ends with.module.xxxif you want CSS modules support.
License
MIT.