Skip to content
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

Update customizable select styles #49746

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@

.customizable-select-button {
color: inherit;
background-color: color-mix(in lab, currentColor 10%, transparent);
background-color: transparent;
appearance: none;
padding-block: 0.25em;
padding-inline: 0.5em;
border: 1px solid currentColor;
border-radius: 0.25em;
border-radius: 0.5em;
cursor: default;
text-align: inherit;
/* TODO(crbug.com/41483940): Make display match the UA stylesheet. */
Expand All @@ -71,6 +71,14 @@
min-block-size: max(24px, 1lh);
}

.customizable-select-button.hover {
background-color: color-mix(in lab, currentColor 10%, transparent);
}

.customizable-select-button.active {
background-color: color-mix(in lab, currentColor 20%, transparent);
}

.customizable-select-button::after {
content: counter(fake-counter-name, disclosure-open);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
<!DOCTYPE html>
<link rel=stylesheet href="resources/customizable-select-styles.css">

<div class=customizable-select-button popovertarget=popover id=button>
<div class="customizable-select-button active" popovertarget=popover id=button>
<span class=customizable-select-selectedoption>option</span>
</div>
<div id=popover popover=auto anchor=button class=customizable-select-popover>
<div class="customizable-select-option selected">option</div>
</div>

<style>
.customizable-select-button {
background-color: color-mix(in lab, currentColor 30%, transparent);
}
</style>

<script>
document.getElementById('popover').showPopover();
</script>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html class=reftest-wait>
<meta name=fuzzy content="maxDifference=0-29;totalPixels=0-1">
<meta name=fuzzy content="maxDifference=0-33;totalPixels=0-1">
<link rel=author href="mailto:[email protected]">
<link rel=help href="https://github.com/w3c/csswg-drafts/issues/10909">
<link rel=match href="select-appearance-active-ref.html">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html class=reftest-wait>
<meta name=fuzzy content="maxDifference=0-1;totalPixels=0-12">
<meta name=fuzzy content="maxDifference=0-1;totalPixels=0-15">
<link rel=author href="mailto:[email protected]">
<link rel=help href="https://github.com/whatwg/html/issues/9799">
<link rel=match href="select-appearance-dark-mode-ref.html">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html class=reftest-wait>
<meta name=fuzzy content="maxDifference=0-37;totalPixels=0-1">
<meta name=fuzzy content="maxDifference=0-41;totalPixels=0-1">
<link rel=author href="mailto:[email protected]">
<link rel=help href="https://github.com/whatwg/html/issues/9799">
<link rel=match href="select-appearance-disabled-option-ref.html">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html class=reftest-wait>
<meta name=fuzzy content="maxDifference=0-50;totalPixels=0-8">
<meta name=fuzzy content="maxDifference=0-55;totalPixels=0-8">
<link rel=author href="mailto:[email protected]">
<link rel=help href="https://github.com/whatwg/html/issues/9799">
<link rel=match href="select-appearance-font-inheriting-ref.html">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
<!DOCTYPE html>
<link rel=stylesheet href="resources/customizable-select-styles.css">

<div class=customizable-select-button popovertarget=popover id=button>
<div class="customizable-select-button hover" popovertarget=popover id=button>
<span class=customizable-select-selectedoption>option</span>
</div>

<style>
.customizable-select-button {
background-color: color-mix(in lab, currentColor 20%, transparent);
}
</style>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html class=reftest-wait>
<meta name=fuzzy content="maxDifference=0-33;totalPixels=0-1">
<meta name=fuzzy content="maxDifference=0-37;totalPixels=0-1">
<link rel=author href="mailto:[email protected]">
<link rel=help href="https://github.com/w3c/csswg-drafts/issues/10909">
<link rel=match href="select-appearance-hover-ref.html">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html class=reftest-wait>
<meta name=fuzzy content="maxDifference=0-40;totalPixels=0-2">
<meta name=fuzzy content="maxDifference=0-41;totalPixels=0-2">
<link rel=author href="mailto:[email protected]">
<link rel=help href="https://github.com/whatwg/html/issues/9799">
<link rel=match href="select-appearance-switching-invalidation-ref.html">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html class=reftest-wait>
<meta name=fuzzy content="maxDifference=0-40;totalPixels=0-2">
<meta name=fuzzy content="maxDifference=0-41;totalPixels=0-2">
<link rel=author href="mailto:[email protected]">
<link rel=help href="https://github.com/whatwg/html/issues/9799">
<link rel=match href="select-open-invalidation-ref.html">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
await new Promise(requestAnimationFrame);
assert_equals(getComputedStyle(optionOne).color, 'rgb(0, 0, 0)',
'Option color while hovering.');
assert_equals(getComputedStyle(optionOne).backgroundColor, 'lab(0 0 0 / 0.2)',
assert_equals(getComputedStyle(optionOne).backgroundColor, 'lab(0 0 0 / 0.1)',
'Option background-color while hovering.');

await (new test_driver.Actions()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html class=reftest-wait>
<meta name=fuzzy content="maxDifference=0-40;totalPixels=0-2">
<meta name=fuzzy content="maxDifference=0-41;totalPixels=0-2">
<link rel=author href="mailto:[email protected]">
<link rel=help href="https://github.com/whatwg/html/issues/9799">
<link rel=match href="select-option-images-ref.html">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html class=reftest-wait>
<meta name=fuzzy content="maxDifference=0-37;totalPixels=0-1">
<meta name=fuzzy content="maxDifference=0-41;totalPixels=0-1">
<link rel=author href="mailto:[email protected]">
<link rel=help href="https://github.com/whatwg/html/pull/10629">
<link rel=match href="select-second-child-button-ref.html">
Expand Down