cauldron icon indicating copy to clipboard operation
cauldron copied to clipboard

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

Open thuey opened this issue 1 year ago • 1 comments

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

thuey avatar Aug 02 '24 15:08 thuey

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

scurker avatar Aug 02 '24 19:08 scurker