Skip to content

[css-forms-1] use calc-size() for improved sizing of <button> and <select> #12085

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
dbaron opened this issue Apr 15, 2025 · 4 comments
Open

Comments

@dbaron
Copy link
Member

dbaron commented Apr 15, 2025

In #12019 (comment) and in the related presentation I proposed that we change the styles that are currently (for <button> and <select>):

  min-block-size: max(24px, 1lh);
  min-inline-size: 24px;

into:

  min-block-size: calc-size(auto, max(24px, 1lh, size));
  min-inline-size: calc-size(auto, max(24px, size));

This has the advantage that (as described in the examples in the presentation) we no longer override the intrinsic size of the text in the button or select, and thus it defaults to reasonable sizing behavior in flexbox and grid (rather than being willing to shrink down very small).

We didn't resolve on doing that in that issue, and this separate issue is to discuss whether we should in fact make that change. (I think we probably should.)

@nt1m
Copy link
Member

nt1m commented Apr 15, 2025

Seems like an improvement over status quo, although I wonder if there's ways we can avoid setting min-block-size / min-inline-size altogether and still meet accessibility requirements (e.g. setting a minimum padding for instance).

Min sizes within UA styles always irked me a bit, especially if the developer has a good reason to make something smaller. It often feels like the last thing you would think about overriding, whereas padding is more common to override.

@nt1m
Copy link
Member

nt1m commented Apr 15, 2025

(Not necessarily suggesting we should use padding, but I'm just saying that default UA min sizes are often overlooked)

@lukewarlow
Copy link
Member

While that might be true I guess if we have a baseline stylesheet people will have, well a baseline to think about. Adjusting minimum sizing will become second nature eventually.

josepharhar added a commit to josepharhar/html that referenced this issue Apr 18, 2025
aarongable pushed a commit to chromium/chromium that referenced this issue Apr 18, 2025
…id context.

This makes the change proposed in
w3c/csswg-drafts#12085

whatwg/html#10670 has been updated with this
change.

Change-Id: I046d73477e15ce6342f2c00193f8131d025c8e2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6462875
Reviewed-by: Joey Arhar <[email protected]>
Commit-Queue: David Baron <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1448995}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Apr 18, 2025
…id context.

This makes the change proposed in
w3c/csswg-drafts#12085

whatwg/html#10670 has been updated with this
change.

Change-Id: I046d73477e15ce6342f2c00193f8131d025c8e2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6462875
Reviewed-by: Joey Arhar <[email protected]>
Commit-Queue: David Baron <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1448995}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Apr 18, 2025
…id context.

This makes the change proposed in
w3c/csswg-drafts#12085

whatwg/html#10670 has been updated with this
change.

Change-Id: I046d73477e15ce6342f2c00193f8131d025c8e2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6462875
Reviewed-by: Joey Arhar <[email protected]>
Commit-Queue: David Baron <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1448995}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Apr 24, 2025
…select work better in flex/grid context., a=testonly

Automatic update from web-platform-tests
Make default min sizes for customizable select work better in flex/grid context.

This makes the change proposed in
w3c/csswg-drafts#12085

whatwg/html#10670 has been updated with this
change.

Change-Id: I046d73477e15ce6342f2c00193f8131d025c8e2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6462875
Reviewed-by: Joey Arhar <[email protected]>
Commit-Queue: David Baron <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1448995}

--

wpt-commits: 0eb7694e58ce18fa3a1b130e4fe3fe65f2b3627c
wpt-pr: 52064
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this issue Apr 29, 2025
…select work better in flex/grid context., a=testonly

Automatic update from web-platform-tests
Make default min sizes for customizable select work better in flex/grid context.

This makes the change proposed in
w3c/csswg-drafts#12085

whatwg/html#10670 has been updated with this
change.

Change-Id: I046d73477e15ce6342f2c00193f8131d025c8e2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6462875
Reviewed-by: Joey Arhar <[email protected]>
Commit-Queue: David Baron <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1448995}

--

wpt-commits: 0eb7694e58ce18fa3a1b130e4fe3fe65f2b3627c
wpt-pr: 52064
shtrom pushed a commit to mozilla-firefox/infra-testing that referenced this issue Apr 29, 2025
…select work better in flex/grid context., a=testonly

Automatic update from web-platform-tests
Make default min sizes for customizable select work better in flex/grid context.

This makes the change proposed in
w3c/csswg-drafts#12085

whatwg/html#10670 has been updated with this
change.

Change-Id: I046d73477e15ce6342f2c00193f8131d025c8e2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6462875
Reviewed-by: Joey Arhar <[email protected]>
Commit-Queue: David Baron <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1448995}

--

wpt-commits: 0eb7694e58ce18fa3a1b130e4fe3fe65f2b3627c
wpt-pr: 52064
@nt1m nt1m reopened this May 1, 2025
@nt1m
Copy link
Member

nt1m commented May 1, 2025

@lukewarlow This change is ok but we should record a resolution first.

gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue May 1, 2025
…select work better in flex/grid context., a=testonly

Automatic update from web-platform-tests
Make default min sizes for customizable select work better in flex/grid context.

This makes the change proposed in
w3c/csswg-drafts#12085

whatwg/html#10670 has been updated with this
change.

Change-Id: I046d73477e15ce6342f2c00193f8131d025c8e2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6462875
Reviewed-by: Joey Arhar <jarharchromium.org>
Commit-Queue: David Baron <dbaronchromium.org>
Cr-Commit-Position: refs/heads/main{#1448995}

--

wpt-commits: 0eb7694e58ce18fa3a1b130e4fe3fe65f2b3627c
wpt-pr: 52064

UltraBlame original commit: 36be9fc6d979f374344ff81539e36aff23161361
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue May 1, 2025
…select work better in flex/grid context., a=testonly

Automatic update from web-platform-tests
Make default min sizes for customizable select work better in flex/grid context.

This makes the change proposed in
w3c/csswg-drafts#12085

whatwg/html#10670 has been updated with this
change.

Change-Id: I046d73477e15ce6342f2c00193f8131d025c8e2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6462875
Reviewed-by: Joey Arhar <jarharchromium.org>
Commit-Queue: David Baron <dbaronchromium.org>
Cr-Commit-Position: refs/heads/main{#1448995}

--

wpt-commits: 0eb7694e58ce18fa3a1b130e4fe3fe65f2b3627c
wpt-pr: 52064

UltraBlame original commit: 36be9fc6d979f374344ff81539e36aff23161361
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue May 1, 2025
…select work better in flex/grid context., a=testonly

Automatic update from web-platform-tests
Make default min sizes for customizable select work better in flex/grid context.

This makes the change proposed in
w3c/csswg-drafts#12085

whatwg/html#10670 has been updated with this
change.

Change-Id: I046d73477e15ce6342f2c00193f8131d025c8e2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6462875
Reviewed-by: Joey Arhar <jarharchromium.org>
Commit-Queue: David Baron <dbaronchromium.org>
Cr-Commit-Position: refs/heads/main{#1448995}

--

wpt-commits: 0eb7694e58ce18fa3a1b130e4fe3fe65f2b3627c
wpt-pr: 52064

UltraBlame original commit: 36be9fc6d979f374344ff81539e36aff23161361
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

3 participants