Skip to content

Restyled the theme switcher in the nav to a switch rather than a button for improved UX#173

Draft
AlexanderChernyshev wants to merge 1 commit intocloudflare:mainfrom
AlexanderChernyshev:theme-toggle-restyling
Draft

Restyled the theme switcher in the nav to a switch rather than a button for improved UX#173
AlexanderChernyshev wants to merge 1 commit intocloudflare:mainfrom
AlexanderChernyshev:theme-toggle-restyling

Conversation

@AlexanderChernyshev
Copy link
Contributor

Changing the theme switcher element in the top-nav from a button to a switch to improve UX by adjusting the design to be intuitive to the user. This way it is clearer what change will happen when "throwing" the switch without the user needing to interact with it.

Changes were made with the assistance of Google's Gemini AI.

@AlexanderChernyshev AlexanderChernyshev requested a review from a team March 4, 2026 01:15
Copy link
Member

@sergeychernyshev sergeychernyshev left a comment

Choose a reason for hiding this comment

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

Looks like server-side rendering for the switch is not working, it only switches when JS kicks in.

@sergeychernyshev sergeychernyshev marked this pull request as draft March 4, 2026 02:01
@sergeychernyshev
Copy link
Member

It might be a good idea to try to see if it can use radio buttons and apply CSS based on the value of a button rather than a class on the :root element which would allow the switch to work without JS at all.

You will still need to set the cookie using JS when it loads though.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants