-
Notifications
You must be signed in to change notification settings - Fork 669
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-ui] Pseudo-element for select's UA button #10717
Comments
The fact that you can do Maybe a stupid question, but why introduce a new |
https://open-ui.org/components/customizableselect/#customizing-basic-styles The explainer has:
I think that is a really unfortunate developer experience to have to specify both selectors. I really think this "fallback button" should only visible to the user agent. I don't think engineering wise it's an insurmountable challenge and it preserves backwards compatibility, which is nice. Maybe consider making the fallback button full size, but "invisible" (deferring all of its styling to the parent select):
Then the |
It's also worth noting that:
doesn't actually work in older browsers, because the whole declaration will be dropped as a result of not being able to parse
I think it would be really good to try to make styling on |
Thanks for the feedback! I like the idea of setting a bunch of properties to
The way I've been designing this so far is to try to make the If we make the fallback button "invisible", then when the author provides their own button should we make that one "invisible" too? Or should we make the author apply more styles to make the I'm also worried about the focus ring being rendered around the invisible fallback button inside the visible select, which would for example make the focus ring get rendered inside of the border and look wrong. I suppose that's something I could try adding a bunch of special casing for in the rendering of focus rings but I'd prefer not to try that. Is there a way we could make the non-inherited properties that would affect the box of the |
You could put the select box
If the fallback button has the full size of the select in-page box, it's likely not super noticeable. Though I think you'd want to defer focus to the parent select in this case, since authors who've previously defined styles for |
is what I can think of, but it wouldn't pass over the |
I'm starting to think that it might be better to remove the fallback UA We would then have to do some other fixes though:
With this in mind, I like your display:contents idea more. Thanks for the suggestion! I'll try implementing it and see what happens. |
This is more of implementation question at this point, but I think you're better off with a div/span or a text node than my |
This seems a bit weird, why not just
? |
I tried prototyping this and there were no focus rings, so I'd have to additionally try making changes to how focus rings get rendered. I imagine there would also be other issues since this puts display:contents on the element which is actually getting focused.
I'll try prototyping this next to see what it looks like |
I started prototyping this and it looks appealing so far, but I need to finish it to make sure there aren't any gaps. |
I'm still working on the prototype, but so far it seems promising. I filed an openui issue to get feedback from them on this later today: openui/open-ui#1086 Proposed resolution: Don't create a pseudo-element for select's UA "fallback" button |
This patch removes customizable <select>'s fallback <button> element in the UA shadowroot by replacing it with the same "InnerElement" <div> which is used for appearance:auto. Several supporting changes were made in order to implement this: - Also remove ::select-fallback-button-text - Add -internal-appearance-auto-base-select() support for the following properties: - min-block-size - min-inline-size - padding-block-start - padding-block-end - padding-inline-start - padding-inline-end - content in select::after - Make <select> focusable again when there is no child <button> element - Remove dependency on popover triggering code in HTMLFormControlElement now that we aren't always opening the popover with a <button> This is in response to feedback here: w3c/csswg-drafts#10717 This also addresses additional feedback I received privately that author styles applied to the select element itself weren't applying to the in-page portion of the element. Change-Id: I0a833b370babe9a8ab937822a3578d839510a8fc
This patch removes customizable <select>'s fallback <button> element in the UA shadowroot by replacing it with the same "InnerElement" <div> which is used for appearance:auto. Several supporting changes were made in order to implement this: - Also remove ::select-fallback-button-text - Add -internal-appearance-auto-base-select() support for the following properties: - min-block-size - min-inline-size - padding-block-start - padding-block-end - padding-inline-start - padding-inline-end - content in select::after - Make <select> focusable again when there is no child <button> element - Remove dependency on popover triggering code in HTMLFormControlElement now that we aren't always opening the popover with a <button> This is in response to feedback here: w3c/csswg-drafts#10717 This also addresses additional feedback I received privately that author styles applied to the select element itself weren't applying to the in-page portion of the element. Change-Id: I0a833b370babe9a8ab937822a3578d839510a8fc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5786670 Reviewed-by: David Baron <[email protected]> Commit-Queue: Joey Arhar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1356701}
This patch removes customizable <select>'s fallback <button> element in the UA shadowroot by replacing it with the same "InnerElement" <div> which is used for appearance:auto. Several supporting changes were made in order to implement this: - Also remove ::select-fallback-button-text - Add -internal-appearance-auto-base-select() support for the following properties: - min-block-size - min-inline-size - padding-block-start - padding-block-end - padding-inline-start - padding-inline-end - content in select::after - Make <select> focusable again when there is no child <button> element - Remove dependency on popover triggering code in HTMLFormControlElement now that we aren't always opening the popover with a <button> This is in response to feedback here: w3c/csswg-drafts#10717 This also addresses additional feedback I received privately that author styles applied to the select element itself weren't applying to the in-page portion of the element. Change-Id: I0a833b370babe9a8ab937822a3578d839510a8fc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5786670 Reviewed-by: David Baron <[email protected]> Commit-Queue: Joey Arhar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1356701}
This patch removes customizable <select>'s fallback <button> element in the UA shadowroot by replacing it with the same "InnerElement" <div> which is used for appearance:auto. Several supporting changes were made in order to implement this: - Also remove ::select-fallback-button-text - Add -internal-appearance-auto-base-select() support for the following properties: - min-block-size - min-inline-size - padding-block-start - padding-block-end - padding-inline-start - padding-inline-end - content in select::after - Make <select> focusable again when there is no child <button> element - Remove dependency on popover triggering code in HTMLFormControlElement now that we aren't always opening the popover with a <button> This is in response to feedback here: w3c/csswg-drafts#10717 This also addresses additional feedback I received privately that author styles applied to the select element itself weren't applying to the in-page portion of the element. Change-Id: I0a833b370babe9a8ab937822a3578d839510a8fc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5786670 Reviewed-by: David Baron <[email protected]> Commit-Queue: Joey Arhar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1356701}
The CSS Working Group just discussed
The full IRC log of that discussion<chrishtr> jarhar: I finished implementing the removal of the buttons and replacing with div w/text in Chromium. Then fonts are inherited well. So I think it works well.<chrishtr> jarhar: propose not to create a pseudo-element for the select button <fantasai> +1 <ntim> +1 <chrishtr> RESOLVED: do not add a pseudo-element for the user-agent fallback select button |
Automatic update from web-platform-tests Remove ::select-fallback-button This patch removes customizable <select>'s fallback <button> element in the UA shadowroot by replacing it with the same "InnerElement" <div> which is used for appearance:auto. Several supporting changes were made in order to implement this: - Also remove ::select-fallback-button-text - Add -internal-appearance-auto-base-select() support for the following properties: - min-block-size - min-inline-size - padding-block-start - padding-block-end - padding-inline-start - padding-inline-end - content in select::after - Make <select> focusable again when there is no child <button> element - Remove dependency on popover triggering code in HTMLFormControlElement now that we aren't always opening the popover with a <button> This is in response to feedback here: w3c/csswg-drafts#10717 This also addresses additional feedback I received privately that author styles applied to the select element itself weren't applying to the in-page portion of the element. Change-Id: I0a833b370babe9a8ab937822a3578d839510a8fc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5786670 Reviewed-by: David Baron <[email protected]> Commit-Queue: Joey Arhar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1356701} -- wpt-commits: 580c17ae11cbcffe0ee3cc44f521dddf77120f0f wpt-pr: 48228
Automatic update from web-platform-tests Remove ::select-fallback-button This patch removes customizable <select>'s fallback <button> element in the UA shadowroot by replacing it with the same "InnerElement" <div> which is used for appearance:auto. Several supporting changes were made in order to implement this: - Also remove ::select-fallback-button-text - Add -internal-appearance-auto-base-select() support for the following properties: - min-block-size - min-inline-size - padding-block-start - padding-block-end - padding-inline-start - padding-inline-end - content in select::after - Make <select> focusable again when there is no child <button> element - Remove dependency on popover triggering code in HTMLFormControlElement now that we aren't always opening the popover with a <button> This is in response to feedback here: w3c/csswg-drafts#10717 This also addresses additional feedback I received privately that author styles applied to the select element itself weren't applying to the in-page portion of the element. Change-Id: I0a833b370babe9a8ab937822a3578d839510a8fc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5786670 Reviewed-by: David Baron <dbaronchromium.org> Commit-Queue: Joey Arhar <jarharchromium.org> Cr-Commit-Position: refs/heads/main{#1356701} -- wpt-commits: 580c17ae11cbcffe0ee3cc44f521dddf77120f0f wpt-pr: 48228 UltraBlame original commit: 565c005e9f4b9f6d742715e1f5f084b72a6d0e54
Automatic update from web-platform-tests Remove ::select-fallback-button This patch removes customizable <select>'s fallback <button> element in the UA shadowroot by replacing it with the same "InnerElement" <div> which is used for appearance:auto. Several supporting changes were made in order to implement this: - Also remove ::select-fallback-button-text - Add -internal-appearance-auto-base-select() support for the following properties: - min-block-size - min-inline-size - padding-block-start - padding-block-end - padding-inline-start - padding-inline-end - content in select::after - Make <select> focusable again when there is no child <button> element - Remove dependency on popover triggering code in HTMLFormControlElement now that we aren't always opening the popover with a <button> This is in response to feedback here: w3c/csswg-drafts#10717 This also addresses additional feedback I received privately that author styles applied to the select element itself weren't applying to the in-page portion of the element. Change-Id: I0a833b370babe9a8ab937822a3578d839510a8fc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5786670 Reviewed-by: David Baron <dbaronchromium.org> Commit-Queue: Joey Arhar <jarharchromium.org> Cr-Commit-Position: refs/heads/main{#1356701} -- wpt-commits: 580c17ae11cbcffe0ee3cc44f521dddf77120f0f wpt-pr: 48228 UltraBlame original commit: 565c005e9f4b9f6d742715e1f5f084b72a6d0e54
Automatic update from web-platform-tests Remove ::select-fallback-button This patch removes customizable <select>'s fallback <button> element in the UA shadowroot by replacing it with the same "InnerElement" <div> which is used for appearance:auto. Several supporting changes were made in order to implement this: - Also remove ::select-fallback-button-text - Add -internal-appearance-auto-base-select() support for the following properties: - min-block-size - min-inline-size - padding-block-start - padding-block-end - padding-inline-start - padding-inline-end - content in select::after - Make <select> focusable again when there is no child <button> element - Remove dependency on popover triggering code in HTMLFormControlElement now that we aren't always opening the popover with a <button> This is in response to feedback here: w3c/csswg-drafts#10717 This also addresses additional feedback I received privately that author styles applied to the select element itself weren't applying to the in-page portion of the element. Change-Id: I0a833b370babe9a8ab937822a3578d839510a8fc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5786670 Reviewed-by: David Baron <dbaronchromium.org> Commit-Queue: Joey Arhar <jarharchromium.org> Cr-Commit-Position: refs/heads/main{#1356701} -- wpt-commits: 580c17ae11cbcffe0ee3cc44f521dddf77120f0f wpt-pr: 48228 UltraBlame original commit: 565c005e9f4b9f6d742715e1f5f084b72a6d0e54
Automatic update from web-platform-tests Remove ::select-fallback-button This patch removes customizable <select>'s fallback <button> element in the UA shadowroot by replacing it with the same "InnerElement" <div> which is used for appearance:auto. Several supporting changes were made in order to implement this: - Also remove ::select-fallback-button-text - Add -internal-appearance-auto-base-select() support for the following properties: - min-block-size - min-inline-size - padding-block-start - padding-block-end - padding-inline-start - padding-inline-end - content in select::after - Make <select> focusable again when there is no child <button> element - Remove dependency on popover triggering code in HTMLFormControlElement now that we aren't always opening the popover with a <button> This is in response to feedback here: w3c/csswg-drafts#10717 This also addresses additional feedback I received privately that author styles applied to the select element itself weren't applying to the in-page portion of the element. Change-Id: I0a833b370babe9a8ab937822a3578d839510a8fc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5786670 Reviewed-by: David Baron <[email protected]> Commit-Queue: Joey Arhar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1356701} -- wpt-commits: 580c17ae11cbcffe0ee3cc44f521dddf77120f0f wpt-pr: 48228
Automatic update from web-platform-tests Remove ::select-fallback-button This patch removes customizable <select>'s fallback <button> element in the UA shadowroot by replacing it with the same "InnerElement" <div> which is used for appearance:auto. Several supporting changes were made in order to implement this: - Also remove ::select-fallback-button-text - Add -internal-appearance-auto-base-select() support for the following properties: - min-block-size - min-inline-size - padding-block-start - padding-block-end - padding-inline-start - padding-inline-end - content in select::after - Make <select> focusable again when there is no child <button> element - Remove dependency on popover triggering code in HTMLFormControlElement now that we aren't always opening the popover with a <button> This is in response to feedback here: w3c/csswg-drafts#10717 This also addresses additional feedback I received privately that author styles applied to the select element itself weren't applying to the in-page portion of the element. Change-Id: I0a833b370babe9a8ab937822a3578d839510a8fc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5786670 Reviewed-by: David Baron <[email protected]> Commit-Queue: Joey Arhar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1356701} -- wpt-commits: 580c17ae11cbcffe0ee3cc44f521dddf77120f0f wpt-pr: 48228
I proposed a bunch of pseudo-elements in this issue, and I'd like to split each pseudo into a separate issue: #10462
The pseudo-element would target the
<button>
element in the UA shadowroot as described in the original issue as well as the draft HTML spec: whatwg/html#10548Here are some options for a name:
::select-button
::select-fallback-button
The text was updated successfully, but these errors were encountered: