Skip to content

Commit aefd6f0

Browse files
Replace base-select svg with disclosure-open
This was suggested here: w3c/csswg-drafts#10380 (comment) This patch also adds min-inline-size and min-block-size to ::select-fallback-button because changing the icon caused the total size of the button to decrease which revealed the lack of min sizing which is already tested by select-accessibility-minimum-target-size.tentative.html Bug: 1511354 Change-Id: Id7b3b0aa6c9c79299240a7212023f849f3703fb0
1 parent 1680062 commit aefd6f0

File tree

4 files changed

+17
-33
lines changed

4 files changed

+17
-33
lines changed

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

+11-15
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,20 @@
5959
align-items: center;
6060
overflow-x: hidden;
6161
overflow-y: hidden;
62+
/* min-size rules ensure that we meet accessibility guidelines for minimum target size.
63+
* https://github.com/openui/open-ui/issues/1026
64+
* https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html */
65+
min-inline-size: 24px;
66+
min-block-size: max(24px, 1.2em);
6267
}
6368

64-
.stylable-select-button-icon {
65-
opacity: 1;
66-
outline: none;
67-
margin-inline-start: 0.25em;
68-
padding-block: 2px;
69-
padding-inline: 3px;
70-
block-size: 1.0em;
71-
inline-size: 1.2em;
72-
min-inline-size: 1.2em;
73-
max-inline-size: 1.2em;
74-
display: block;
69+
.stylable-select-button::after {
70+
padding-inline-start: 0.5em;
71+
content: counter(fake-counter-name, disclosure-closed);
72+
}
7573

76-
color: light-dark(black, white);
77-
stroke: currentColor;
78-
stroke-width: 3;
79-
stroke-linejoin: round;
74+
.stylable-select-button.open::after {
75+
content: counter(fake-counter-name, disclosure-open);
8076
}
8177

8278
.stylable-select-selectedoption {

html/semantics/forms/the-select-element/stylable-select/resources/stylable-select-utils.js

-8
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
<!DOCTYPE html>
22
<link rel=stylesheet href="resources/stylable-select-styles.css">
3-
<script src="resources/stylable-select-utils.js"></script>
43

54
<style>
6-
.stylable-select-button-icon svg {
7-
stroke: red !important;
5+
.stylable-select-selectedoption::after {
6+
padding-inline-start: 0.5em;
7+
content: counter(fake-counter-name, disclosure-closed);
8+
color: red;
89
}
910
</style>
1011

1112
<div class=stylable-select-container>
1213
<button class=stylable-select-button popovertarget=popover id=button>
1314
<span class=stylable-select-selectedoption>option</span>
14-
<div class=stylable-select-button-icon></div>
1515
</button>
1616
</div>
17-
18-
<script>
19-
populateFallbackButtonIcon();
20-
</script>

html/semantics/forms/the-select-element/stylable-select/select-icon-color.tentative.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
select {
88
appearance: base-select;
99
}
10-
select::select-fallback-button-icon {
11-
stroke: red;
10+
select::select-fallback-button::after {
11+
color: red;
1212
}
1313
</style>
1414

0 commit comments

Comments
 (0)