Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/healthy-cooks-draw.md
Original file line numberDiff line numberDiff 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 numberDiff line numberDiff line change
Expand Up@@ -16,15 +16,14 @@ const StyledSelect = styled.select`
outline: none;
width: 100%;

option {
color: initial;
}

@colebemiscolebemisMar 17, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Now that the color of option is set to initial, do we still need the rule on line 28?

/* For Firefox: reverts color of non-placeholder options in the dropdown */&:invalidoption:not(:first-child) {
color: ${get('colors.fg.default')};
}

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I believe so. Let me test it out...

/* 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