Skip to content

Releases: danieldelcore/trousers

@trousers/[email protected]

30 Apr 09:24
6cb9544
Compare
Choose a tag to compare

Major Changes

  • e6a3323: # Version 3 🎉

    This is Trousers' biggest update yet!

    Including:

    • Support for the CSS prop 👩‍🎤
    • Mono-repo setup and decomposition 📦
    • Object notation CSS 🍞
    • Theme CSS var package 🎨
    • insertRule 🏹
    • Smaller bundles 🐭
    • Custom style collectors 🕺
    • Trousers package with all exports for backwards compatibility

    Removed

    • withStyles HOC (please use css prop for class components)

    Developer experience

  • c9c8187: Trousers v3!

    • CSS prop 👩‍🎤
    • Mono-repo setup and decomposition 📦
    • Object notation CSS 🍞
    • Theme CSS var package 🎨
    • prod mode support for insertRule 🏹
    • Smaller bundles 🐭
    • Support for custom style collectors 🕺
    • Trousers package with all exports for backwards compatibility

    Dev

Patch Changes

Minor rerender fixes

14 Dec 09:07
Compare
Choose a tag to compare

🐛Fixes issues with unwanted rerenders #38
🔧 Removes the elementName getter, in favour of a name property on the style definition #36
📃 Minor changes to the misc storybook example #36

Modifier names ✨

01 Oct 00:41
Compare
Choose a tag to compare

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;
  `;

v2.0.0

20 Aug 12:15
Compare
Choose a tag to compare

Improvements 💪

🌏 Reworked globals ✅
⚡️ Performance improvements ✅
🎨 Fix paint flashing ✅
👾 Improved SSR API ✅
🐭 Reduced bundle size ✅
📃 Better docs ✅
⚔️ Battle tested ✅

Breaking changes 💥

  • 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 Nodes

Misc 🎁

  • TypeScript users no longer have to pass all generic types to useStyles, css and styleCollector
  • Render flashing is now gone, courtesy of useLayoutEffect
  • Removed murmurhash in favour of a small hand-rolled alternative
  • useGlobals will now accept an array of styles
  • Unit tests everywhere!