Skip to content
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

[css-ui] Can we standardize the behavior of appearance:auto/none as it relates to a control and its pseudo-elements? #4041

Open
BoCupp-Microsoft opened this issue Jun 18, 2019 · 5 comments

Comments

@BoCupp-Microsoft
Copy link
Contributor

https://drafts.csswg.org/css-ui/#appearance-switching

Can we standardize the behavior of appearance:auto/none as it relates to a control and its pseudo-elements?

Sorry if I'm late to the discussion, but I spent some time looking through this spec today and experimenting with the level of interop browsers currently have for -webkit-appearance. My conclusions are:

  1. the primary value of appearance is in specifying 'none' for built-in controls so that authors can build a custom look on top of a base set of styles using CSS.
  2. interop of -webkit-appearance:none is poor between browsers

Here's a JSBin with some samples and notes on the interop issues I'm talking about.

And here are some questions about what can be specified to help address those interop issues:

  • Can we specify whether fallback content should appear when the control has appearance:none set?
  • Can we specify whether all psuedo-elements of a control and the control itself should "disappear" when the control has appearance:none set?
  • Can we specify what CSS should be used to make a control disappear: display, height/width, visibility?
  • Some controls, like button, fallback to a base rule set to enable incremental styling by the author instead of "zeroing" the CSS to such an extent that the author must effectively style all aspects of the control. Can we specify a consistent behavior for all controls, i.e. pick one of the zeroing or base rule set behaviors?
  • Some controls (e.g. checkbox, range, meter and I'm sure others) require that appearance:none be set before styling of a control has any effect. Can we specify that this is required behavior for controls (maybe new ones will be invented) and which existing controls are exempted due to web compat.

Thanks in advance for your thoughts!

@jonjohnjohnson
Copy link

@zcorpan
Copy link
Member

zcorpan commented Jun 19, 2019

@zcorpan
Copy link
Member

zcorpan commented Jun 19, 2019

I think the answer to your questions is mostly "yes" - we can certainly specify things to help improve interop, and there has been some work already towards this. For example whatwg/html#4322

There's more to do of course. But also, we may not be able to (or want to) specify all aspects of controls, since we may want to allow for differences between platforms and kinds of devices, and allow for innovation for controls. But web developers also want to style them, and want consistent behavior.

@zcorpan zcorpan added the css-ui-4 Current Work label Jun 19, 2019
@SebastianZ
Copy link
Contributor

See also #1018.

Sebastian

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

No branches or pull requests

6 participants