- A React hook to allow you to easily update styles
import React, { useState } from 'react';
import { useStyles } from 'flcss/react';
const App = () => {
const [ color, setColor ] = useState('red');
const styles = useStyles({
box: {
padding: '15px',
backgroundColor: color
}
});
return <div className={ styles.box }/>;
}
- less code means faster performance (probably).
- slightly better error handling.
- types are everywhere so writing styles should be much faster in vscode with suggestions and auto-completion.
- switched to using constructed stylesheets underneath (when it's available).
- added
setStyle()
to set styles for any selector. - added
updateStyle()
to update styles after they were created.
-
createAnimation()
keyframes was changed to use objects likecreateStyle()
instead of very long strings (because it's CSS-in-JS not Strings-in-JS). -
support for replacing
'%this'
with generated classnames was removed.