Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const decorateProps = stylingProps => {
const decoratedStylingProps = defaultPropsDecorator(stylingProps)
const { style, className: baseClassName, ...rest } = decoratedStylingProps
if (!style) {
return decoratedStylingProps
}
const ruleName = hash(style)
// prepend rule to the sheet if it does not already exist
const rule =
sheet.getRule(ruleName) ||
sheet.addRule(ruleName, mapPseudoSelectors(style), { index: 0 })
const className = rule.options.classes[ruleName]
return {
export const decorateAsDataAttributes = props => {
const { style, className } = defaultPropsDecorator(props)
return {
...css(style),
className,
}
}