w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.5k stars 664 forks source link

[css-ui] appearance: base to enable interoperable styling of controls/components #5998

Open gregwhitworth opened 3 years ago

gregwhitworth commented 3 years ago

The below comment is in reference to an explainer level proposal regarding a new pseudo element and a way for an author to opt-in to a standardized DOM and styles, currently being proposed is appearance: base.

@gregwhitworth why not make the proposed behavior for appearance: base be the behavior for appearance: none for radio buttons and checkboxes? Would it not be web compatible? There are likely some sites that use appearance: none plus a background image to show the checkmark, so this would show a double checkmark, though I don't know how common it is. Maybe it's even an acceptable change? The content would still work, just not rendered as originally intended. When styling form controls, that shouldn't come as a huge surprise I would think.

CSS UI says that widgets should be usable even with appearance: none, but checkboxes and radio buttons as implemented today aren't. https://drafts.csswg.org/css-ui/#appearance-semantics

(Feel free to split this into a new issue if you want to separate the discussion around appearance from ::indicator.)

cc @frivoal

Originally posted by @zcorpan in https://github.com/w3c/csswg-drafts/issues/5914#issuecomment-778089292

josepharhar commented 4 months ago

I opened this issue with the intention of bikeshedding naming as a next step, as well as a couple other issues for what it will mean for <select>: https://github.com/w3c/csswg-drafts/issues/10333 We also have the ::picker() issue here: https://github.com/w3c/csswg-drafts/issues/10440 I'm not opposed to leaving this open, but I'm also not sure exactly what direction to take this issue in for a discussion tomorrow.

josepharhar commented 4 months ago

The "needs edits" label was added so that we can spec this, and we will keep this issue open until the spec is written

josepharhar commented 3 months ago

I created a PR to define appearance:base here: https://github.com/w3c/csswg-drafts/pull/10691