Skip to content

v2.4.1

Choose a tag to compare

@ItsJonQ ItsJonQ released this 25 Apr 21:06
· 7 commits to master since this release

Change data-cy to data-cy-styled. Add displayLabel for namespacing

This update changes the auto-generated data-cy to data-cy-styled to
reduce conflict with the HOC from HSDS: React.

The Styled Component generator is now paying attention to a special
static property (displayLabel), which can customize the autogenerated
className + data-cy-styled results. This borrows the label convention
introduced in Emotion 10.

Example
const MyComponent = () => <div />
MyComponent.displayLabel = 'hello'

const StyledComponent = styled(MyComponent)()

// Autogenerated CSS className will be something like
// .css-1jjidj3-hello

  • Change data-cy to data-cy-styled. Add displayLabel for namespacing (#45) cd30f28

v2.4.0...v2.4.1