cfpb / design-system

CFPB's work-in-progress design system
https://cfpb.github.io/design-system
Creative Commons Zero v1.0 Universal
37 stars 12 forks source link

Fieldsets: Legend element is outside the fieldset #1961

Closed contolini closed 6 days ago

contolini commented 4 months ago

Our recommended fieldset pattern involves a <legend> element outside the <fieldset> element. This is invalid, the legend needs to be a child of the fieldset.

See https://validator.w3.org/nu/?doc=https%3A%2F%2Fcfpb.github.io%2Fdesign-system%2Fcomponents%2Ffieldsets

image
sonnakim commented 2 months ago

We should fix this. There may be consequences to this depending on whether we depend on the current <legend> structure. I'll add it to our internal backlog.

sonnakim commented 2 months ago

This needs investigation to see if we are depending in some way on this broken pattern, and if we are, refactoring so that the pattern is both accessible and works as intended. @anselmbradford will look at this next sprint

anselmbradford commented 6 days ago

PR --> https://github.com/cfpb/design-system/pull/2009