-
Notifications
You must be signed in to change notification settings - Fork 110
Fixes #7: make option list readable in Firefox when parent has dark b… #14
Fixes #7: make option list readable in Firefox when parent has dark b… #14
Conversation
…nt has dark background
|
Nice. Thanks @brendanfalkowski. We'll try to pick this up in the next few days. |
|
@toddparker Any chance of getting this PR accepted? Would like to see the additional dark-background case handled so it's more robust. |
|
Looking! |
|
@brendanfalkowski Just to confirm—this only modifies the demo styles. Is this what you intended? Is the bug reproducible when the demo styles are not used? |
|
@zachleat Thanks for picking this up! It totally depends how you style the As-is, the demo code doesn't produce a readable option list if used on a dark page in Firefox. You can test by modifying the Firefox repurposes the background on the
You can short-circuit this behavior by providing a solid fallback color on the Note: if the gradient depends on rgba() for transparency, setting a background might spoil a design that has the page background bleeding through the UI (someone's glassy skeuomorphantasy) — but having a readable option list matters more. So the pull request updates the demo with a solid fallback color to the background gradient on |
|
@brendanfalkowski Yes—I’m definitely on board with merging this. I wonder if it’s also worth adding one or two sentences describing the problem as a note to the readme as well? Since it’s a demo style, it’s worth documenting the problem/solution in case others run into it. Maybe even something as simple as short description and a link to the issue? |
|
(on mobile) I added this in an earlier commit/PR to On Thursday, July 21, 2016, Zach Leatherman [email protected]
|
|
Great, thanks @brendanfalkowski! |
|
It’s beautiful—thanks! |
|
gh-pages updated: http://filamentgroup.github.io/select-css/demo/ |
|
Released with 1.0.4 and updated on NPM |

Resolves issue #7. In Firefox the option list inherits the background color of the closest ancestor that has a solid background color. If the
.custom-selectwrapper uses a dark solid background or only uses a gradient, then Firefox traces up through its ancestors until a solid color is found. If that color is dark then the option list is unreadable in Firefox (black text on dark background).By setting a solid fallback of
#fffon the.custom-select(or in the demo's case:.button) Firefox will render the option list readably (black text on white background).I updated the demo to include a dark parent example. The issue can be reproduced by modifying the CSS for
.buttonto remove the solid background fallback in the gradient declaration.