Skip to content

Make the Help dropdown and Light/Dark Mode dropdown UI consistent#30575

Open
ahaywood wants to merge 2 commits intoproductionfrom
ad/consistent-dropdowns
Open

Make the Help dropdown and Light/Dark Mode dropdown UI consistent#30575
ahaywood wants to merge 2 commits intoproductionfrom
ad/consistent-dropdowns

Conversation

@ahaywood
Copy link
Copy Markdown
Contributor

@ahaywood ahaywood commented May 4, 2026

Summary

Before:

The Help dropdown menu and the light / dark mode dropdown did not match:

Dark Light
CleanShot 2026-05-04 at 14 19 40@2x CleanShot 2026-05-04 at 14 19 30@2x
CleanShot 2026-05-04 at 14 19 18@2x CleanShot 2026-05-04 at 14 19 27@2x

After:

The items were displayed differently because the Gelp dropdown implemented a React dropdown menu. The light/dark mode dropdown utilized a standard HTML select.

This PR moves the light/dark mode dropdown to a React dropdown (ThemeSelectDropdown) that matches the help menu and replaces the Starlight ThemeSelect component.

I kept a hidden select input within the new React component so that the code continues to leverage the pre-existing JavaScript listener and StarlightThemeProvider.

Screenshots

Dark Light
CleanShot 2026-05-04 at 14 12 12@2x CleanShot 2026-05-04 at 14 12 27@2x
CleanShot 2026-05-04 at 14 12 04@2x CleanShot 2026-05-04 at 14 12 25@2x

In the video, the content flash signals a page refresh:
https://github.com/user-attachments/assets/79ffe65f-fda5-47a3-84ba-a39a4e5e9fd9

Replace the Starlight ThemeSelect component with a custom ThemeSelectDropdown React component. Add width constraint wrapper and remove associated CSS rules for the old component. Add React JSX type definition for starlight-theme-select custom element. Format multi-property transition declarations across multiple lines for consistency.
@ahaywood ahaywood requested review from a team and kodster28 as code owners May 4, 2026 19:28
@github-actions github-actions Bot added the size/m label May 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
*.astro @cloudflare/content-engineering, @kodster28
/src/components/ @cloudflare/content-engineering, @kodster28
*.ts @cloudflare/content-engineering, @kodster28

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants