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

[css-forms-1] Add new pseudo-elements for customizable select #10986

Merged
merged 10 commits into from
Nov 27, 2024
28 changes: 27 additions & 1 deletion css-pseudo-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1634,6 +1634,32 @@ Styling form control pickers: the ''::picker()'' pseudo-element</h3>
&lt;/style>
</pre>

<h3 id="select-arrow">
Select dropdown icon: the ''::select-arrow'' pseudo-element</h3>

The ''::select-arrow'' pseudo-element only matches when the <a>originating
element</a> is a <{select}> element.

''::select-arrow'' is a [=part-like pseudo-element=], so there is no
restriction on which properties apply to the ''::select-arrow'' pseudo-element.

''::select-arrow'' generates a box as if it was an immediate child of its
josepharhar marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there conditions on when this generates a box? Does it only do something for appearance: base-select?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I added the restriction that there must be a select element with base appearance.

<a>originating element</a>, preceding any boxes generated by the ''::before''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I'm wondering if the idea that it precedes the ::before is incompatible with being part-like. I'm a little worried that it might be.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made it not part like anymore. Does that resolve this?

pseudo-element, with content as specified by 'content'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also worried about allowing content here when it doesn't (in reality) work on elements, which part-like pseudo-elements should fully behave like.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made it not part like anymore. Does that resolve this?


<h3 id="check">
Option checkmark icon: the ''::check'' pseudo-element</h3>

The '::check'' pseudo-element only matches when the <a>originating
element</a> is a <{option}> element.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I commented in the chromium prototype CL, should this instead say that the pseudo-element is only generated for option elements? That's an observable difference for getComputedStyle(div, '::check').

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to say generated instead of matches


''::check'' is a [=part-like pseudo-element=], so there is no restriction on
which properties apply to the ''::check'' pseudo-element.

''::check'' generates a box as if it was an immediate child of its
<a>originating element</a>, preceding any boxes generated by the ''::before''
pseudo-element, with content as specified by 'content'.


<h2 id="interactions">
Overlapping Pseudo-element Interactions</h2>
Expand Down Expand Up @@ -1986,4 +2012,4 @@ Acknowledgements</h2>
get-computed-style-crash.html
svg-text-selection-002.html
text-selection.html
</wpt>
</wpt>