Skip to content

Modifier names ✨

Compare
Choose a tag to compare
@danieldelcore danieldelcore released this 01 Oct 00:41
· 102 commits to master since this release

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