dequelabs / cauldron

https://cauldron.dequelabs.com/
Mozilla Public License 2.0
86 stars 20 forks source link

Merge `className` prop with existing classes for the `Notice` component #1609

Open thuey opened 1 month ago

thuey commented 1 month ago

I would like to be able to pass a className directly to the Notice component. Example:

<Notice className="customClass">
  I have custom styling
</Notice>

However, when I do this, it replaces the default Notice classes: https://github.com/dequelabs/cauldron/blob/f1f016388543360dc6a525037d583dc3b8f72835/packages/react/src/components/Notice/index.tsx#L26-L32

It would be nice if this custom class was merged in to the existing classes, like Tooltip and other components do. Example: https://github.com/dequelabs/cauldron/blob/f1f016388543360dc6a525037d583dc3b8f72835/packages/react/src/components/Tooltip/index.tsx#L218-L227

scurker commented 1 month ago

@thuey Yup, this looks like an oversight on Cauldron's part this would be in line with how we compose className elsewhere.