hooks-first CSS-in-JS library, focused on semantics and runtime performance
MIT License
Bot releases are visible (Hide)
Published by github-actions[bot] over 4 years ago
e6a3323: # Version 3 π
This is Trousers' biggest update yet!
Including:
c9c8187: Trousers v3!
insertRule
πΉDev
Published by danieldelcore almost 5 years ago
πFixes issues with unwanted rerenders https://github.com/danieldelcore/trousers/pull/38
π§ Removes the elementName getter, in favour of a name property on the style definition https://github.com/danieldelcore/trousers/pull/36
π Minor changes to the misc storybook example https://github.com/danieldelcore/trousers/pull/36
Published by danieldelcore about 5 years ago
Adds the ability to create named modifiers
New API looks like...
const styles = styleCollector('button')
.element``
.modifier('primary', props => props.primary)`
color: red;
`;
This approach uses method overloading to allow the modifier name to be optional and provide backward compatibility. Which means, this is also allowed and works π
const styles = styleCollector('button')
.element``
.modifier('props => props.primary)`
color: red;
`;
π Reworked globals β
β‘οΈ Performance improvements β
π¨ Fix paint flashing β
πΎ Improved SSR API β
π Reduced bundle size β
π Better docs β
βοΈ Battle tested β
useGlobal
renamed to useGlobals
useTrousers
alias removed, please use useStyles
withTrousers
alias removed, please use withStyles
trousers
alias removed, please use styleCollector
severStyleRegistry.get()
now returns React NodesuseStyles
, css
and styleCollector
useLayoutEffect
murmurhash
in favour of a small hand-rolled alternativeuseGlobals
will now accept an array of styles