digdir / designsystemet

Designsystemet
https://designsystemet.no
MIT License
68 stars 34 forks source link

Should `CardHeading` extend `Heading`? #2127

Closed mimarz closed 1 week ago

mimarz commented 2 weeks ago

We do this for our other heading sub-components, any reason not to for Card? Its currently hard-coded to one heading size.

Barsnes commented 2 weeks ago

CardHeading is a wrapper div with some padding. We excpect users to add a heading inside. This is because the header can have other non-text elements - like a button.

Maybe we should rename the component something that does not make it sound like a heading element. Though, "Header" is a common word for this, and our heading component is called Heading.

From our own storybook: image

mimarz commented 2 weeks ago

Card naming is semantically correct.

We also decided to rename AccordionHeader to AccordionHeading so its semantically correct.

mimarz commented 1 week ago

This will be released in #2130