Skip to content

Commit 7a93a56

Browse files
committed
Add UA stylesheet for <select> base appearance
Discussion here: w3c/csswg-drafts#10857
1 parent 8c74909 commit 7a93a56

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

source

+88
Original file line numberDiff line numberDiff line change
@@ -3953,6 +3953,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
39533953
<li>The concept <dfn data-x-href="https://drafts.csswg.org/css-ui/#widget">widget</dfn></li>
39543954
<li>The concept <dfn data-x-href="https://drafts.csswg.org/css-ui/#native-appearance">native appearance</dfn></li>
39553955
<li>The concept <dfn data-x-href="https://drafts.csswg.org/css-ui/#primitive-appearance">primitive appearance</dfn></li>
3956+
<li>The concept <dfn data-x-href="https://drafts.csswg.org/css-ui/#base-appearance">base appearance</dfn></li>
39563957
<li>The concept <dfn data-x-href="https://drafts.csswg.org/css-ui/#element-with-default-preferred-size">element with default preferred size</dfn></li>
39573958
<li>The <dfn data-x-href="https://drafts.csswg.org/css-ui/#non-devolvable">non-devolvable widget</dfn> and
39583959
<dfn data-x-href="https://drafts.csswg.org/css-ui/#devolvable">devolvable widget</dfn> classification, and the related
@@ -135710,6 +135711,93 @@ progress { appearance: auto; }</code></pre>
135710135711

135711135712
</div>
135712135713

135714+
<!-- TODO should this go at the top of the section right below "the select element"? -->
135715+
<p>The following styles are expected to apply to <code>select</code> elements when they are being
135716+
rendered as a <span>drop-down box</span> with <span>base appearance</span>:</p>
135717+
135718+
<pre><code class="css">@namespace "http://www.w3.org/1999/xhtml";
135719+
135720+
select {
135721+
border: 1px solid currentColor;
135722+
background-color: color-mix(in lab, currentColor 10%, transparent);
135723+
color: inherit;
135724+
font: inherit;
135725+
padding: 0.25em .5em;
135726+
text-box: trim-both;
135727+
135728+
border-radius: 0.25em;
135729+
display: inline-block;
135730+
box-sizing: border-box;
135731+
min-block-size: max(24px, 1.2em);
135732+
min-inline-size: 24px;
135733+
white-space: normal;
135734+
}
135735+
135736+
select:enabled:hover {
135737+
background-color: color-mix(in lab, currentColor 20%, transparent);
135738+
}
135739+
135740+
select:enabled:active {
135741+
background-color: color-mix(in lab, currentColor 30%, transparent);
135742+
}
135743+
135744+
select::picker(select) {
135745+
box-sizing: border-box;
135746+
overflow: auto;
135747+
border: 1px solid rgba(0, 0, 0, 0.15);
135748+
border-radius: 0.25em;
135749+
padding-block: 0.25em;
135750+
padding-inline: 0;
135751+
background-color: Field;
135752+
margin: 0;
135753+
inset: auto;
135754+
min-inline-size: anchor-size(self-inline);
135755+
min-block-size: 1lh;
135756+
position-area: block-end span-inline-end;
135757+
position-try-fallbacks:
135758+
block-start span-inline-end,
135759+
block-end span-inline-start,
135760+
block-start span-inline-start;
135761+
}
135762+
135763+
select option {
135764+
min-inline-size: 24px;
135765+
min-block-size: 24px;
135766+
align-content: center;
135767+
display: block;
135768+
padding-block-start: 0;
135769+
padding-block-end: 1px;
135770+
padding-inline: 2px;
135771+
white-space: nowrap;
135772+
}
135773+
135774+
select option:hover {
135775+
background-color: SelectedItem;
135776+
color: SelectedItemText;
135777+
}
135778+
135779+
select option::check {
135780+
content: '\2713' / '';
135781+
}
135782+
select option:not(:checked)::check {
135783+
visibility: hidden;
135784+
}
135785+
135786+
select::select-arrow {
135787+
padding-inline-start: 0.5em;
135788+
display: block;
135789+
content: counter(fake-counter-name, disclosure-open);
135790+
}
135791+
135792+
select optgroup {
135793+
padding-inline: 2px;
135794+
}
135795+
135796+
select optgroup option {
135797+
padding-inline-start: 20px;
135798+
}</code></pre>
135799+
135800+
135713135801

135714135802
<div w-nodev>
135715135803

0 commit comments

Comments
 (0)