Skip to content

Add support for ::picker, ::picker-icon and ::checkmark #957

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

Merged
merged 2 commits into from
Apr 25, 2025

Conversation

lucasweng
Copy link
Contributor

src/selector.rs Outdated
@@ -1213,6 +1229,14 @@ where
part.to_css(dest)?;
dest.write_char(')')
}
Picker => dest.write_str("::picker"),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we can support the non-functional form of ::picker for now, though it won’t work until other form controls beyond <select> support it per https://drafts.csswg.org/css-forms-1/#picker-pseudo.

Note

The non-functional form of ::picker() currently doesn’t work to prevent unintended styling of pickers as new pickers become supported. Once styling for all form control pickers is finalized, this non-functional form will work for all pickers.

@pouyakary
Copy link

@lucasweng thank you!

src/selector.rs Outdated
@@ -953,6 +958,17 @@ pub enum PseudoElement<'i> {
/// A part name selector.
part: ViewTransitionPartSelector<'i>,
},
/// The [::picker](https://drafts.csswg.org/css-forms-1/#the-picker-pseudo-element) pseudo element.
Copy link
Member

Choose a reason for hiding this comment

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

Is this actually supported? The spec seems to suggest that only the functional form is allowed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only the functional form works for now, so I’ll remove the non-functional form to avoid confusion. I originally added support for it because the spec suggests it may be supported in the future. 😬
CleanShot 2025-04-22 at 11 33 26@2x

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the non-functional form and added tests for ::picker. Thanks! afac67a

@devongovett devongovett merged commit 3e27005 into parcel-bundler:master Apr 25, 2025
3 checks passed
@lucasweng lucasweng deleted the picker branch April 25, 2025 23:02
@equinusocio
Copy link

equinusocio commented May 11, 2025

Lightningcss shouldn’t add work in progress or non-standard spec. These pseudo selectors are experimental and might change in the future. Chrome isn’t the only web engine out there.

@devongovett
Copy link
Member

It's in an official w3c spec, and one of the editors is from Apple so presumably they will support it in the future? I don't see any harm here.

@equinusocio
Copy link

equinusocio commented May 11, 2025

Just to clarify, even if a spec is officially recognized, it doesn’t mean that core editing and changes won’t happen. “official” doesn’t necessarily mean “standard.” In fact, many times in the past, CSS properties have been renamed just before becoming a standard and leaving the working draft stage.

So, any spec document marked as Working Draft (WD) status is subject to change at any time without any prior notice. In this case, all the above specs are also pretty new and unstable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for picker pseudo-element
4 participants