Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site theme switcher (dark mode toggle) #4155

Open
Tracked by #3592
fcoveram opened this issue Apr 18, 2024 · 8 comments
Open
Tracked by #3592

Site theme switcher (dark mode toggle) #4155

fcoveram opened this issue Apr 18, 2024 · 8 comments
Labels
🖼️ aspect: design Concerns related to design design: ready Issue with a mockup ready for implementation ✨ goal: improvement Improvement to an existing user-facing feature 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: frontend Related to the Nuxt frontend ⛔ status: blocked Blocked & therefore, not ready for work

Comments

@fcoveram
Copy link
Contributor

Designs for Dark mode project (#3592)

Description

Given that users need to set the site theme from any part of the site, the most affordable area is the site footer. It already has the language selector, that behaves equally, and adding the action there is the more logical solution.

Mockups

For the current arrangement of pages in both footer content and internal, the following version is the one that convince me most.

New footer design in XS and LG breakpoints

The switcher is placed next to the language selector and it behaves equally. The options displayed are Light, Dark, and System in the OS/browser popover.

Footer

Content footer is on top and internal footer at the bottom.

Content and internal footers

Middle- and long-term idea

With the design explored (#3564) to make the internal pages area more simple, I would like to bring again the opportunity we have to make the footer even more simple by putting the general/site settings in a unique config menu.

Designs for the future footer

Site settings menu in XS and LG breakpoints

The benefits of this idea is twofold:

  • It puts Openverse in a better position with regards to privacy by making the toggle more visible
  • It's the first step towards placing settings in a single menu once user profile-related actions are needed in future features.

I personally would like to consider the implementation of this middle/long-term component. What do you think?

@fcoveram fcoveram added 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work ✨ goal: improvement Improvement to an existing user-facing feature 🖼️ aspect: design Concerns related to design labels Apr 18, 2024
@openverse-bot
Copy link
Collaborator

Subscribe to Label Action

cc @WordPress/gutenberg-design, @WordPress/openverse

This issue or pull request has been labeled: "🖼️ aspect: design"

Thus the following users have been cc'd because of the following labels:

  • WordPress/gutenberg-design: 🖼️ aspect: design
  • WordPress/openverse: 🖼️ aspect: design

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@fcoveram fcoveram added the design: in discussion Issue has a design that needs feedback label Apr 18, 2024
@jasmussen
Copy link

Generally looks good! Location seems good.

The border around the dropdown button makes it feel at home next to the language dropdown. But this button up here only has that same border type on hover:

Screenshot 2024-04-18 at 15 13 54

Is there some heuristic we can apply for when the dropdown button is outlined vs. not? Optical balance can be fine, but just noting the opportunity.

Entirely separate observations:

  • The dropdown chevrons feel a bit chunky and big to me, and the space between icon or label and chevron is a bit bigger than it might need to be. This is a bit more visible with the cog icon addition.
  • In the block editor core project, we put toggles on the left of the label, as opposed to the right. I'm aware that toggles on the right is a relatively common practice especially in mobile, and I think it can work, but in the core project we had to move them to the left in part because under the hood it's a re-skinned checkbox, and those are usually preceding the label.
@jasmussen
Copy link

Oh, and I quite like the dark mode switcher on Rich's site. I don't know that it entirely works for Openverse, but it's fun.

@obulat obulat added 🧱 stack: frontend Related to the Nuxt frontend and removed 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work labels Apr 18, 2024
@fcoveram fcoveram self-assigned this Apr 18, 2024
@AetherUnbound
Copy link
Contributor

I think I'd advocate for the mid/long-term solution myself too! I think, as you say, puts us in a better position going forward for anything else we'd like users to be able to configure. Both designs look excellent though!

@fcoveram
Copy link
Contributor Author

Thanks @jasmussen for your thoughts. Here my responses.

The header is the only component that buttons showing border in hover state. I designed the element aiming for simplicity and reduce visual elements as much as possible to prioritize results content and keep the surrounded area of search input clean. In that vein, the border style in inactive button competed with the gray background of search input.

This behavior detail captures my idea more accurately.

The dropdown chevrons feel a bit chunky and big to me, and the space between icon or label and chevron is a bit bigger than it might need to be. This is a bit more visible with the cog icon addition.

Reducing the spacing between icons sounds good. I made a quick test and the outcome is nice. In the case of icon and label, the reduction looks tight compared to the rest of the UI. It seems that a rule for "icon + label" and "icon + icon" can be applied easily. Adding this to my backlog.

In the block editor core project, we put toggles on the left of the label, as opposed to the right. I'm aware that toggles on the right is a relatively common practice especially in mobile, and I think it can work, but in the core project we had to move them to the left in part because under the hood it's a re-skinned checkbox, and those are usually preceding the label.

This is interesting. I didn't notice this position change between desktop and mobile. I quickly checked a few apps I used and they change the toggle position. I would add this to my backlog to discuss it with folks.

And yes! I also noticed Rich's implementation and it looks nice. The motion when switching style is great. I tried something similar for a toggle of three options, but it overloaded the screen.

@zackkrida
Copy link
Member

I'd personally like to start with the theme switcher directly in the footer. Since we plan to keep light mode enabled by default I think making the element prominent in the footer makes the feature more discoverable.

It also keeps the scope of the dark mode project smaller, as the new "settings" panel feels like a larger change that we may want to consider more carefully and/or spin into its own dedicated project to answer questions like "How does it scale if we have 4 more settings?", etc.

@fcoveram
Copy link
Contributor Author

True. Let's keep it simple and go with the basic version. I will update the design file and come back once assets are ready for dev.

This was referenced Apr 30, 2024
@fcoveram
Copy link
Contributor Author

fcoveram commented May 1, 2024

Mockups are ready for dev. Since the change involves mostly changes in components, I requested them in #4232

@fcoveram fcoveram removed their assignment May 1, 2024
@fcoveram fcoveram added design: ready Issue with a mockup ready for implementation and removed design: in discussion Issue has a design that needs feedback labels May 1, 2024
@krysal krysal added the 🟨 priority: medium Not blocking but should be addressed soon label May 6, 2024
@fcoveram fcoveram added this to the Dark Mode milestone May 6, 2024
@zackkrida zackkrida changed the title Site theme switcher May 10, 2024
@obulat obulat added the ⛔ status: blocked Blocked & therefore, not ready for work label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖼️ aspect: design Concerns related to design design: ready Issue with a mockup ready for implementation ✨ goal: improvement Improvement to an existing user-facing feature 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: frontend Related to the Nuxt frontend ⛔ status: blocked Blocked & therefore, not ready for work
7 participants