Skip to content

[css-forms-1] Add UA styles for listbox select elements #12511

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
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions css-forms-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -870,14 +870,14 @@ input[type=radio]:checked::checkmark {
## Selects & buttons ## {#stylesheet-select-button}

```css
select {
select:has-picker {
/* Base appearance select always sizes based on its contents. */
field-sizing: content !important;
}

button,
::file-selector-button,
select,
select:has-picker,
input:is([type="color"], [type="button"], [type="reset"], [type="submit"]) {
border: 1px solid currentColor;
background-color: transparent;
Expand Down Expand Up @@ -913,19 +913,27 @@ input:is([type="color"], [type="button"], [type="reset"], [type="submit"]) {
text-align: initial;
text-indent: initial;
}
:is(button, select, input:is([type="color"], [type="button"], [type="reset"], [type="submit"])):enabled:hover,
:is(button, select:has-picker, input:is([type="color"], [type="button"], [type="reset"], [type="submit"])):enabled:hover,
:enabled::file-selector-button:hover {
background-color: color-mix(in lab, currentColor 10%, transparent);
}
:is(button, select, input:is([type="color"], [type="button"], [type="reset"], [type="submit"])):enabled:active,
:is(button, select:has-picker, input:is([type="color"], [type="button"], [type="reset"], [type="submit"])):enabled:active,
:enabled::file-selector-button:active {
background-color: color-mix(in lab, currentColor 20%, transparent);
}
:is(button, select, input:is([type="color"], [type="button"], [type="reset"], [type="submit"])):disabled,
:is(button, select:has-picker, input:is([type="color"], [type="button"], [type="reset"], [type="submit"])):disabled,
:disabled::file-selector-button {
color: color-mix(in srgb, currentColor 50%, transparent);
}

select:not(:has-picker) {
display: inline-block;
overflow-block: auto;
overflow-inline: auto;
border: 1px solid currentColor;
user-select: none;
}

select > button:first-child {
/* Prevents button from setting font, color, or background-color */
all: unset;
Expand Down