Open bfgeek opened 5 months ago
Sounds nice!
cc @pxlcoder @nt1m @whatwg/forms
Seems like a decent idea.
The button layout magic covers more than safe centering, do you intend to keep those as-is or try to remove them also?
good
The button layout magic covers more than safe centering, do you intend to keep those as-is or try to remove them also?
@zcorpan - Blink M126 just rolled out with block-layout buttons enabled by default. And we didn't include the anonymous block described by that part of the spec. (I suspect this was added just for centering purposes, but you really don't need it). So I intend to remove that also.
I'll prepare a PR so we can see what this looks like.
@bfgeek is there an easy way that I can opt in to the new behavior, in my local Chrome 127 "dev channel" installation? (You mentioned enabled by default in 126, but I don't think I'm seeing the behavior, if I understand the proposal correctly. I did also try "Experimental Web Platform Features:enabled" in chrome://flags
but I don't think that does it.)
RE webcompat risk: if I'm understanding correctly, this proposal does mean that buttons with display:flex
or grid
will start vertically aligning their content where they didn't previous do so, correct? That seems probably-fine, but it is a behavior change and could conceivably break some content. Here's a testcase to illustrate what buttons look like without vs. with align-content: safe center
:
https://jsfiddle.net/dholbert/cds9jxa5/
(There's no difference for display:block,
but the button's label moves from the top to the center for display:flex
and display:grid
. Cosmetically, it does seem like an improvement, but it is notable as a behavior-change.)
My understanding is that the way blink implemented this doesn't affect grid or flex, which is a bit unfortunate because it's replacing some magic for another.
@bfgeek is the idea to eventually apply this to all buttons as proposed in your comment? Or something else?
What is the issue with the HTML Standard?
Now that align-content is more widely implemented we can switch the control centering magic to just use align-content instead.
We are starting to get some bug reports that web developers would desire to control this behaviour in form controls, e.g. https://issues.chromium.org/issues/344643705
This would basically mean adding something like:
And removing all the special text for the centering behaviour in the form control part of the spec.
There is a small compat risk, but we'd be happy to take on that risk.
cc/ @dholbert @emilio