Skip to content

Legibility problem with Theme select in Windows Firefox #3426

@InertSloth

Description

@InertSloth

What version of starlight are you using?

0.35.3

What version of astro are you using?

5.13.7

What package manager are you using?

pnpm

What operating system are you using?

Windows 11 Pro

What browser are you using?

Firefox 142.0.1 (64-bit)

Describe the Bug

In firefox, the theme select menu while in dark mode has numerous problems. It is fine in light mode. The background around the options is white when it should be dark. The text on the current hover / checked option is white, instead of inverted.

Image

See the following screenshot. This is true of all new starlight installs and has for at least since starlight 0.35.2, but likely much older. You can see it on the official https://docs.astro.build astro docs website as well.

My workaround was to make a custom css file in my install to fix it with the following:

	[data-theme='dark'] starlight-theme-select {
		& select,
		& select option,
		& select option:checked {
			background-color: var(--sl-color-gray-6);
			color: var(--sl-color-text);
		}
		
		& select option:hover {
			background-color: var(--sl-color-accent-high);
			color: var(--sl-color-text-invert);
		}
	}

My workaround produces the following in firefox dark mode. I did not extensively test this workaround in other browsers:

Image

While I believe it maintains functionality in light mode.

Link to Minimal Reproducible Example

https://astro.new/latest/preview/starlight-basics/

Participation

  • I am willing to submit a pull request for this issue.

- 🦥

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions