Skip to content

Commit

Permalink
Firefox bug - fix contrast of <select> options in dark mode (#1981)
Browse files Browse the repository at this point in the history
* reverts select options colors to initial

* adds changeset

* rm unnecessary option style
  • Loading branch information
mperrotti authored Mar 17, 2022
1 parent 3b23604 commit e9bb595
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/healthy-cooks-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

Ensures select option text has acceptable contrast in Firefox when in dark mode
9 changes: 4 additions & 5 deletions src/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ const StyledSelect = styled.select`
outline: none;
width: 100%;
option {
color: initial;
}
/* colors the select input's placeholder text */
&:invalid {
color: ${get('colors.fg.subtle')};
}
/* For Firefox: reverts color of non-placeholder options in the dropdown */
&:invalid option:not(:first-child) {
color: ${get('colors.fg.default')};
}
`

const ArrowIndicatorSVG: React.FC<{className?: string}> = ({className}) => (
Expand Down

0 comments on commit e9bb595

Please sign in to comment.