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

Add: "color" and "background-color" CSS on <option> elements #5885

Open
pythoncoder42 opened this issue May 5, 2021 · 4 comments
Open

Add: "color" and "background-color" CSS on <option> elements #5885

pythoncoder42 opened this issue May 5, 2021 · 4 comments

Comments

@pythoncoder42
Copy link

pythoncoder42 commented May 5, 2021

This is a suggestion to add an entry for the ability to change the text color and background color inside dropdown boxes, via setting the "color"/"background-color" in CSS. On Mac, this feature is only supported by Firefox (tested in v88 but probably in other versions).

@Schweinepriester
Copy link
Contributor

Is there a specification or a link or something?
Part of https://www.w3.org/TR/css-ui-4/ maybe?

@pythoncoder42
Copy link
Author

MDN link: https://developer.mozilla.org/en-US/docs/Learn/Forms/Advanced_form_styling#selects_and_datalists

"The second, slightly more major issue is that you don't have control over the box that appears containing the options when you click on the box to open it. You'll notice that the options don't inherit the font set on the parent. You also can't consistently set things like spacing and colors. For example, Firefox will apply color and background-color when set on the elements, Chrome won't. Neither of them will apply any kind of spacing (e.g. padding). The same is also true of the autocomplete list that appears for the datalist." Seems to be based on browser renderer's decision rather than any specification. Setting color/background-color also does not work in Safari.

@GPHemsley
Copy link

GPHemsley commented Jan 17, 2022

Is this related to the notes on label, as provided by MDN data?
https://caniuse.com/mdn-html_elements_option_label

(via mdn/browser-compat-data#373)

@pythoncoder42
Copy link
Author

Is this related to the notes on label, as provided by MDN data? https://caniuse.com/mdn-html_elements_option_label

(via mdn/browser-compat-data#373)

I think so.

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

No branches or pull requests

4 participants