Skip to content

[css-forms-1] Add fieldset and legend #11981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lukewarlow
Copy link
Member

@lukewarlow lukewarlow commented Mar 22, 2025

See #11983

This is by no means all that we need to do for these elements but it's a start.

@nt1m
Copy link
Member

nt1m commented Mar 22, 2025

I think we should spend some time thinking about what kind of improvements we want to give to fieldset/legend, and whether it makes sense for them to follow the appearance: base pattern.

e.g. for fieldset, if the main thing we want to change is the border to also be currentColor to match the rest, it might just be possible to change the existing border: 2px groove threedface to border: 1px solid currentColor directly everywhere with negligible/no web compat breakage. We've changed the border-color before for things like table or hr successfully, so I don't think this is infeasible.

For legend, I've heard valid complaints about the layout being hardcoded and not overridable, and there was some attempt from @zcorpan to previously address it using appearance: none. I would consider filing an issue against the css-forms-1 to explore this further. Maybe appearance: base would also make sense here, but I wouldn't rush into it without having the discussion first.

@lukewarlow
Copy link
Member Author

#11983

@zcorpan
Copy link
Member

zcorpan commented Mar 26, 2025

See whatwg/html#3912

The conclusion in whatwg/html#4035 (comment) was that appearance is not the right mechanism to control the magic of fieldset rendering.

@zcorpan
Copy link
Member

zcorpan commented Mar 26, 2025

The rendering rules are defined here https://html.spec.whatwg.org/#the-fieldset-and-legend-elements (this could probably be moved to a CSS spec though).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants