Skip to content

Commit 89dd48f

Browse files
Update customizable select styles
This patch updates background-color and border-radius to the latest proposal here: w3c/csswg-drafts#10857 Change-Id: Icc6ec70d27cc9f1131f5e164b1db66e63e8847fb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072270 Commit-Queue: Joey Arhar <[email protected]> Reviewed-by: Mason Freed <[email protected]> Auto-Submit: Joey Arhar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1397608}
1 parent 343a084 commit 89dd48f

13 files changed

+22
-26
lines changed

html/semantics/forms/the-select-element/customizable-select/resources/customizable-select-styles.css

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@
5151

5252
.customizable-select-button {
5353
color: inherit;
54-
background-color: color-mix(in lab, currentColor 10%, transparent);
54+
background-color: transparent;
5555
appearance: none;
5656
padding-block: 0.25em;
5757
padding-inline: 0.5em;
5858
border: 1px solid currentColor;
59-
border-radius: 0.25em;
59+
border-radius: 0.5em;
6060
cursor: default;
6161
text-align: inherit;
6262
/* TODO(crbug.com/41483940): Make display match the UA stylesheet. */
@@ -71,6 +71,14 @@
7171
min-block-size: max(24px, 1lh);
7272
}
7373

74+
.customizable-select-button.hover {
75+
background-color: color-mix(in lab, currentColor 10%, transparent);
76+
}
77+
78+
.customizable-select-button.active {
79+
background-color: color-mix(in lab, currentColor 20%, transparent);
80+
}
81+
7482
.customizable-select-button::after {
7583
content: counter(fake-counter-name, disclosure-open);
7684
}
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
<!DOCTYPE html>
22
<link rel=stylesheet href="resources/customizable-select-styles.css">
33

4-
<div class=customizable-select-button popovertarget=popover id=button>
4+
<div class="customizable-select-button active" popovertarget=popover id=button>
55
<span class=customizable-select-selectedoption>option</span>
66
</div>
77
<div id=popover popover=auto anchor=button class=customizable-select-popover>
88
<div class="customizable-select-option selected">option</div>
99
</div>
1010

11-
<style>
12-
.customizable-select-button {
13-
background-color: color-mix(in lab, currentColor 30%, transparent);
14-
}
15-
</style>
16-
1711
<script>
1812
document.getElementById('popover').showPopover();
1913
</script>

html/semantics/forms/the-select-element/customizable-select/select-appearance-active.tentative.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<html class=reftest-wait>
3-
<meta name=fuzzy content="maxDifference=0-29;totalPixels=0-1">
3+
<meta name=fuzzy content="maxDifference=0-33;totalPixels=0-1">
44
<link rel=author href="mailto:[email protected]">
55
<link rel=help href="https://github.com/w3c/csswg-drafts/issues/10909">
66
<link rel=match href="select-appearance-active-ref.html">

html/semantics/forms/the-select-element/customizable-select/select-appearance-dark-mode.tentative.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<html class=reftest-wait>
3-
<meta name=fuzzy content="maxDifference=0-1;totalPixels=0-12">
3+
<meta name=fuzzy content="maxDifference=0-1;totalPixels=0-15">
44
<link rel=author href="mailto:[email protected]">
55
<link rel=help href="https://github.com/whatwg/html/issues/9799">
66
<link rel=match href="select-appearance-dark-mode-ref.html">

html/semantics/forms/the-select-element/customizable-select/select-appearance-disabled-option.tentative.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<html class=reftest-wait>
3-
<meta name=fuzzy content="maxDifference=0-37;totalPixels=0-1">
3+
<meta name=fuzzy content="maxDifference=0-41;totalPixels=0-1">
44
<link rel=author href="mailto:[email protected]">
55
<link rel=help href="https://github.com/whatwg/html/issues/9799">
66
<link rel=match href="select-appearance-disabled-option-ref.html">

html/semantics/forms/the-select-element/customizable-select/select-appearance-font-inheriting.tentative.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<html class=reftest-wait>
3-
<meta name=fuzzy content="maxDifference=0-50;totalPixels=0-8">
3+
<meta name=fuzzy content="maxDifference=0-55;totalPixels=0-8">
44
<link rel=author href="mailto:[email protected]">
55
<link rel=help href="https://github.com/whatwg/html/issues/9799">
66
<link rel=match href="select-appearance-font-inheriting-ref.html">
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
<!DOCTYPE html>
22
<link rel=stylesheet href="resources/customizable-select-styles.css">
33

4-
<div class=customizable-select-button popovertarget=popover id=button>
4+
<div class="customizable-select-button hover" popovertarget=popover id=button>
55
<span class=customizable-select-selectedoption>option</span>
66
</div>
7-
8-
<style>
9-
.customizable-select-button {
10-
background-color: color-mix(in lab, currentColor 20%, transparent);
11-
}
12-
</style>

html/semantics/forms/the-select-element/customizable-select/select-appearance-hover.tentative.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<html class=reftest-wait>
3-
<meta name=fuzzy content="maxDifference=0-33;totalPixels=0-1">
3+
<meta name=fuzzy content="maxDifference=0-37;totalPixels=0-1">
44
<link rel=author href="mailto:[email protected]">
55
<link rel=help href="https://github.com/w3c/csswg-drafts/issues/10909">
66
<link rel=match href="select-appearance-hover-ref.html">

html/semantics/forms/the-select-element/customizable-select/select-appearance-switching-invalidation.tentative.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<html class=reftest-wait>
3-
<meta name=fuzzy content="maxDifference=0-40;totalPixels=0-2">
3+
<meta name=fuzzy content="maxDifference=0-41;totalPixels=0-2">
44
<link rel=author href="mailto:[email protected]">
55
<link rel=help href="https://github.com/whatwg/html/issues/9799">
66
<link rel=match href="select-appearance-switching-invalidation-ref.html">

html/semantics/forms/the-select-element/customizable-select/select-open-invalidation.tentative.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<html class=reftest-wait>
3-
<meta name=fuzzy content="maxDifference=0-40;totalPixels=0-2">
3+
<meta name=fuzzy content="maxDifference=0-41;totalPixels=0-2">
44
<link rel=author href="mailto:[email protected]">
55
<link rel=help href="https://github.com/whatwg/html/issues/9799">
66
<link rel=match href="select-open-invalidation-ref.html">

0 commit comments

Comments
 (0)