Skip to content
Open
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
22 changes: 22 additions & 0 deletions packages/starlight/components/Select.astro
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,28 @@ interface Props {
color: var(--sl-color-gray-1);
}

/*
* Firefox on Windows renders native select option dropdowns with
* incorrect colors in dark mode — option backgrounds appear white
* and checked/hovered text is invisible. Use @supports to target
* Firefox (-moz-appearance) so other browsers are unaffected.
* Only fix option backgrounds, not the select itself, to preserve
* transparent backgrounds on pages like the homepage.
* See: https://github.com/withastro/starlight/issues/3426
*/
@supports (-moz-appearance: none) {
:global([data-theme='dark']) select option,
:global([data-theme='dark']) select option:checked {
background-color: var(--sl-color-bg-nav);
color: var(--sl-color-text);
}

:global([data-theme='dark']) select option:hover {
background-color: var(--sl-color-accent-high);
color: var(--sl-color-text-invert);
}
}

@media (min-width: 50rem) {
select {
font-size: var(--sl-text-sm);
Expand Down