Skip to content

[css-forms-1] Add field-sizing to base select styles #11879

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

Merged
merged 1 commit into from
Mar 9, 2025

Conversation

lukewarlow
Copy link
Member

@lukewarlow lukewarlow commented Mar 9, 2025

Base select is always sized based on its content size rather than using the legacy fixed styling, so we set field-sizing to content !important.

See #11838 (comment)

Base select is always sized based on its content size rather than using the legacy fixed styling, so we set field-sizing to content !important.
@lukewarlow lukewarlow requested a review from nt1m March 9, 2025 17:14
@@ -695,6 +695,11 @@ input[type=radio]::checkmark {
## Selects & buttons

```css
select {
/* Base appearance select always sizes based on its contents. */
field-sizing: content !important;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!important for now but if we decided to enable the legacy layout (size based on layout of longest option) we could remove that modifier and allow authors to set to fixed to enable it.

@@ -695,6 +695,11 @@ input[type=radio]::checkmark {
## Selects & buttons

```css
select {
/* Base appearance select always sizes based on its contents. */
field-sizing: content !important;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We maybe only want this for dropdown select and not for listbox select but we can handle that once we have a selector to choose between them.

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

Successfully merging this pull request may close these issues.

2 participants