-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Core Block suggestion: Theme Style Toggle #48249
Comments
We discussed this in the accessibility bug scrub today, and think that this would be a great feature to standardize. A few questions to consider:
|
I’m shocked there isn’t a suitable plugin on the market to address this, given how smoothly Style Variations operate within the Site Editor (“Browse Styles” pane) and the growing client expectations on Dark Mode. Considerations
Related conversations: |
Good afternoon |
@richtabor built such a block: See Dark Mode Toggle Block |
I don't think this block would be suitable for core, as we'd need a way to effectively apply a dark mode style to any theme (not feasible). My dark mode toggle block is is block, along with instructions for setting up CSS on your end. I propose we close this. |
I recently came upon this variation style switcher block in this video. Looks like a pretty simple plugin that accomplishes the main feature in this suggested feature for block themes. |
@dhanson-wp Tried the last plugin out with my custom styles and it did not work as expected. Also it creates an annoying menu in the backend instead of hiding. |
I believe it should support any number and not be limited to something like dark vs. light mode. I think the best course of action would be to integrate with the existing style variations system so that we're not introducing a new concept for themers to learn. Under the hood, there's probably some things to work out with the way variations are stored. For example, users can't make per-variation style overrides, and style variations themselves are stored as user customizations (see: #62661). |
Reminder: |
Throwing in my two cents, I'd love to see this become a core feature. |
What problem does this address?
The site owner can't easily let visitors change the appearance of the site, which could improve accessibility. Think "high contrast" style or "dark mode". Also the theme styles are such a nice addition, but there's way more potential hidden behind a really simple block. Right now only the site owner can change the style, but the other styles stay "hidden" and inactive.
What is your proposed solution?
Add a simple toggle block which you could e.g. add to your site header, where you select one of your Theme Styles to toggle to. As soon as you click the toggle, the styles toggle to the chosen style. This way you can easily add a High Contrast style, Big Fonts style, Dark Mode style, etc. to your site, making it more accessible and/or providing a better user experience.
Can be as easy as this example.
The text was updated successfully, but these errors were encountered: