Skip to content

Use align-content for form control centering instead of html "magic" #10396

@bfgeek

Description

@bfgeek

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:

button {
  align-content: safe center
}

input[type="button" i],
input[type="color" i],
input[type="reset" i],
input[type="submit" i] {
  align-content: safe center;
}

input:not([type]),
input[type="date" i],
input[type="datetime-local" i],
input[type="email" i],
input[type="month" i],
input[type="number" i],
input[type="range" i],
input[type="search" i],
input[type="password" i],
input[type="search" i],
input[type="tel" i],
input[type="text" i],
input[type="time" i],
input[type="url" i],
input[type="week" i] {
  align-content: unsafe center;
}

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions