Kaze [風] zero-runtime CSS in JS for React.
🚧 under development 🚧
Features
- Build - can choose when to extract css (build time & run time)
- TypeScript - Type-safe styles via csstype
- Minimal - 0.3kb runtime by build time extract
- Merge - Style merging ignoring css specificity
- Theme - Consistent styling using "@kaze-style/themes"
Example
import { createStyle, createGlobalStyle, mergeStyle } from '@kaze-style/react';
createGlobalStyle({
html: {
lineHeight: '1.5',
},
});
const classes = createStyle({
container: {
margin: '20px',
},
base: {
color: 'red',
background: 'black',
},
action: {
color: 'blue',
},
});
export const App = ({ action }) => {
return (
<div className={classes.container}>
<p className={mergeStyle(classes.base, action && classes.action)}></p>
</div>
);
};
import { withKazeStyle } from '@kaze-style/next-plugin';
const nextConfig = {};
export default withKazeStyle(nextConfig);
Inspiration
KazeStyle was designed with reference to several CSS in JS libraries.
microsoft/griffel
seek-oss/vanilla-extract
argyleink/open-props
callstack/linaria
Author
Taishi Naritomi
License
MIT