You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This could be useful, but might also be tricky to deliver in the plugin because it would be very difficult to guarantee that it would work for all themes.
How would you see it working, especially in terms of styles?
@ramonjd I could see the default being the toggle, if there are multiple styles available then I could see a possible setting to allow it to be a dropdown that lets the user choose the style.
Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.
This light mode/dark mode toggle is becoming more common across websites today. As a website visitor if my browser/os is set to dark mode, they may still wish to see the website in light mode. At the moment I don't think theme.json has a way to set a "style" as dark mode or light mode specific, nor does it support "prefer-color-scheme".
Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.
Just a note that mainstream browsers have JS and CSS support for detecting the user preference on dark-mode.
It's nothing but sparkling laziness to use a physical toggle if the default is not to respect the standards-based API's.
I'm also not 100% sold that it matters if the editing experience needs to be in lock-step with the display presentation theme. There is a preview button if someone needs to see what content looks like on their frontend as a visitor would see it.
I Created Automattic/blocks-everywhere#27 for Gutenberg outside of WordPress. Which presently describes a hack, which "works for me". This hack is predicated on the visual editor not being a WYSIWYG website editor; which honestly neither TinyMCE or Gutenberg are capable of achieving despite a lot of sunk effort and painful engineering to that end.
Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.
@Lewiscowles1986 So the original request is for a new toggle block. Browsing a lot of templates, I do see a lot of sites doing a drop-down that has light, dark, and system (default) as the options. And I feel this is probably best, as it defaults to system, but site visitors can then choose to see light and dark when they wish.
Example:
Based on the comments, I do see some work that may need to be completed first, such as let developers define "prefers-color-scheme" for color palette's set within the theme.json file. It might also make sense to have this as a site option stored in the wp_options table, with default being system, but allowing site owners to override the default for the site globally.
@Lewiscowles1986 wp_options is not user-specific. But I was thinking its more for site owners to choose the default for their site, if they choose to not have it be "system". The idea being a user can always use this toggle or drop-down to then change on the front-end of the site.
Thanks for this discussion here. In reviewing this in light of a push for new blocks in Core #71026, I'm going to close this out as a duplicate of a broader issue here with more discussion #48249 As you can see in that discussion too, there is not a clear way forward nor easy solution for this to core. For now, check out https://developer.wordpress.org/news/2025/09/building-a-light-dark-toggle-with-the-interactivity-api/ which offers a way to do this for theme authors.
Great question! When triaging and noticing similar issues, a judgement has to be made around what to keep open. Sometimes this means keeping open an issue that was created later but that, for whatever reason, has more traction and discussion. When that happens, in order to better preserve where momentum and context is (including the number of folks who’ve engaged and are following the issue), we’ll close the older issue. It’s ultimately a judgment call.
With that context in mind, what is missing from the other issue? I see a clear reference to having a high contrast and dark mode.
The other ticket is about implementing a block for end-users controlling the dark / light theme, as I believe this one may have originally been about.
Missing for that use case would be respecting the system theme and what current or future wordpress mechanisms to leverage for that.
I Should also create a separate issue for dark mode within the backend Gutenberg experience, but I don't know if there is any desire beyond my own for it; and I have a hack that gets me dark-mode looking Gutenberg.
I Should also create a separate issue for dark mode within the backend Gutenberg experience, but I don't know if there is any desire beyond my own for it; and I have a hack that gets me dark-mode looking Gutenberg.
Oh! At a broad level, this is being thought of right now with upcoming Admin Design efforts. Check out the parts around "Theming": #71196
Missing for that use case would be respecting the system theme and what current or future wordpress mechanisms to leverage for that.
I think this is where there's not a clear path forward for this as sites aren't applications and would likely need to be handled on a per site basis. It's complex, that's for sure.
Activity
ramonjd commentedon Jul 31, 2022
This could be useful, but might also be tricky to deliver in the plugin because it would be very difficult to guarantee that it would work for all themes.
How would you see it working, especially in terms of styles?
bhubbard commentedon Aug 8, 2022
@ramonjd I could see the default being the toggle, if there are multiple styles available then I could see a possible setting to allow it to be a dropdown that lets the user choose the style.
scruffian commentedon Aug 22, 2022
I think we'd need to add some tools for themes to be able to define "light" and "dark" colors.
bhubbard commentedon Aug 22, 2022
@scruffian I agree, maybe this needs to be supported in theme.json for styles?
github-actions commentedon Sep 7, 2022
Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.
bhubbard commentedon Sep 7, 2022
Any suggestions on how to move this forward?
ramonjd commentedon Sep 7, 2022
Isn't this already possible with global style variations?
See: https://fullsiteediting.com/lessons/global-style-variations/
Given that light/dark modes will be very theme-specific, it makes sense that a theme could have 2 x global style variations to cater.
bhubbard commentedon Sep 7, 2022
A theme can have many styles. The original request is to have a dark mode/light mode toggle button block, such as this one for example: https://www.w3schools.com/howto/howto_js_toggle_dark_mode.asp
This light mode/dark mode toggle is becoming more common across websites today. As a website visitor if my browser/os is set to dark mode, they may still wish to see the website in light mode. At the moment I don't think theme.json has a way to set a "style" as dark mode or light mode specific, nor does it support "prefer-color-scheme".
Further Reading:
Prefers Color Scheme
github-actions commentedon Sep 24, 2022
Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.
Lewiscowles1986 commentedon Oct 22, 2022
Just a note that mainstream browsers have JS and CSS support for detecting the user preference on dark-mode.
It's nothing but sparkling laziness to use a physical toggle if the default is not to respect the standards-based API's.
I'm also not 100% sold that it matters if the editing experience needs to be in lock-step with the display presentation theme. There is a preview button if someone needs to see what content looks like on their frontend as a visitor would see it.
I Created Automattic/blocks-everywhere#27 for Gutenberg outside of WordPress. Which presently describes a hack, which "works for me". This hack is predicated on the visual editor not being a WYSIWYG website editor; which honestly neither TinyMCE or Gutenberg are capable of achieving despite a lot of sunk effort and painful engineering to that end.
15 remaining items
github-actions commentedon Dec 28, 2022
Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.
bhubbard commentedon Jun 7, 2024
@richtabor made a block for this: https://rich.blog/dark-mode-toggle-block/
Lewiscowles1986 commentedon Jun 8, 2024
So is this asking for a block for websites to add a toggle, or for Gutenberg itself to support dark-mode?
All my posts were for the latter, not the former.
bhubbard commentedon Jun 10, 2024
@Lewiscowles1986 So the original request is for a new toggle block. Browsing a lot of templates, I do see a lot of sites doing a drop-down that has light, dark, and system (default) as the options. And I feel this is probably best, as it defaults to system, but site visitors can then choose to see light and dark when they wish.
Example:

Based on the comments, I do see some work that may need to be completed first, such as let developers define "prefers-color-scheme" for color palette's set within the theme.json file. It might also make sense to have this as a site option stored in the wp_options table, with default being system, but allowing site owners to override the default for the site globally.
Lewiscowles1986 commentedon Jun 15, 2024
@bhubbard are wp_options user-specific?
I thought it was not https://codex.wordpress.org/Database_Description#Table:_wp_options
To add complexity, I'm not 100% certain, that a user wanting dark-mode, would wish to do so for all of their devices.
bhubbard commentedon Jun 17, 2024
@Lewiscowles1986 wp_options is not user-specific. But I was thinking its more for site owners to choose the default for their site, if they choose to not have it be "system". The idea being a user can always use this toggle or drop-down to then change on the front-end of the site.
annezazu commentedon Oct 12, 2025
Thanks for this discussion here. In reviewing this in light of a push for new blocks in Core #71026, I'm going to close this out as a duplicate of a broader issue here with more discussion #48249 As you can see in that discussion too, there is not a clear way forward nor easy solution for this to core. For now, check out https://developer.wordpress.org/news/2025/09/building-a-light-dark-toggle-with-the-interactivity-api/ which offers a way to do this for theme authors.
Lewiscowles1986 commentedon Oct 12, 2025
@annezazu how can 42828 be a duplicate of 48249; the latter, was created nearly 1 year later.
Thank you for linking it. As I see it, at least what I was hoping for wasn't captured in this issue or the new one.
annezazu commentedon Oct 12, 2025
Great question! When triaging and noticing similar issues, a judgement has to be made around what to keep open. Sometimes this means keeping open an issue that was created later but that, for whatever reason, has more traction and discussion. When that happens, in order to better preserve where momentum and context is (including the number of folks who’ve engaged and are following the issue), we’ll close the older issue. It’s ultimately a judgment call.
With that context in mind, what is missing from the other issue? I see a clear reference to having a high contrast and dark mode.
Lewiscowles1986 commentedon Oct 13, 2025
Thank you, for your answer, and patience.
The other ticket is about implementing a block for end-users controlling the dark / light theme, as I believe this one may have originally been about.
Missing for that use case would be respecting the system theme and what current or future wordpress mechanisms to leverage for that.
I Should also create a separate issue for dark mode within the backend Gutenberg experience, but I don't know if there is any desire beyond my own for it; and I have a hack that gets me dark-mode looking Gutenberg.
annezazu commentedon Oct 13, 2025
Of course. Thanks for engaging so kindly.
Oh! At a broad level, this is being thought of right now with upcoming Admin Design efforts. Check out the parts around "Theming": #71196
I think this is where there's not a clear path forward for this as sites aren't applications and would likely need to be handled on a per site basis. It's complex, that's for sure.