{"id":6826,"date":"2025-08-22T09:57:23","date_gmt":"2025-08-22T14:57:23","guid":{"rendered":"https:\/\/frontendmasters.com\/blog\/?p=6826"},"modified":"2025-08-22T09:57:24","modified_gmt":"2025-08-22T14:57:24","slug":"quick-dark-mode-toggles","status":"publish","type":"post","link":"https:\/\/frontendmasters.com\/blog\/quick-dark-mode-toggles\/","title":{"rendered":"Quick Dark Mode Toggles"},"content":{"rendered":"\n<p>I&#8217;ve moved off of Arc browser, but it had a browser-level feature of being able to toggle beween light and dark mode that I liked. I still have some muscle memory for that, so in the time I&#8217;m spending back on other Chrome-based browsers, I was looking for another browser-level toggle for it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Chrome<\/h2>\n\n\n\n<p>Chrome can do it, but it&#8217;s a little buried in DevTools. The main setting is under the &#8220;Rendering&#8221; tab (which I always remember how to get to be going under the main <strong>Console<\/strong> tab then pressing <strong>ESC<\/strong>, then choosing <strong>Rendering<\/strong> in the three-dot menu). In there, you&#8217;ll see an option for <strong>Emulate CSS media feature prefers-color-scheme<\/strong> where you can select light or dark.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"931\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.16.56-PM.png?resize=1024%2C931&#038;ssl=1\" alt=\"Screenshot of Chrome DevTools showing the 'Rendering' tab with options for emulating CSS media feature prefers-color-scheme.\" class=\"wp-image-6827\" style=\"width:531px;height:auto\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.16.56-PM.png?resize=1024%2C931&amp;ssl=1 1024w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.16.56-PM.png?resize=300%2C273&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.16.56-PM.png?resize=768%2C698&amp;ssl=1 768w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.16.56-PM.png?w=1118&amp;ssl=1 1118w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n<\/div>\n\n\n<p>Alternatively, it&#8217;s a bit quicker to use the Command Palette (Command-Shift-P) and starting typing <strong>emulate<\/strong> and you&#8217;ll see a quick option to toggle to the value you want. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"530\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.18.01-PM.png?resize=1024%2C530&#038;ssl=1\" alt=\"Screenshot of Chrome DevTools Command Palette with options for emulating CSS prefers-color-scheme.\" class=\"wp-image-6828\" style=\"width:681px;height:auto\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.18.01-PM.png?resize=1024%2C530&amp;ssl=1 1024w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.18.01-PM.png?resize=300%2C155&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.18.01-PM.png?resize=768%2C397&amp;ssl=1 768w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.18.01-PM.png?resize=1536%2C795&amp;ssl=1 1536w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.18.01-PM.png?w=1662&amp;ssl=1 1662w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n<\/div>\n\n\n<p>Or, use the little paintbrush icon under the <strong>Elements<\/strong> tab then in the <strong>Styles<\/strong> section.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"410\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-22-at-7.31.51-AM.png?resize=1024%2C410&#038;ssl=1\" alt=\"Screenshot of a browser's DevTools showing the Styles panel, with options to toggle between light and dark color schemes.\" class=\"wp-image-6847\" style=\"width:597px;height:auto\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-22-at-7.31.51-AM.png?resize=1024%2C410&amp;ssl=1 1024w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-22-at-7.31.51-AM.png?resize=300%2C120&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-22-at-7.31.51-AM.png?resize=768%2C308&amp;ssl=1 768w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-22-at-7.31.51-AM.png?w=1358&amp;ssl=1 1358w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\">The Non-Standard Chrome Thing<\/h3>\n\n\n\n<p>See in the first screenshot there is a setting called <strong>Enable automatic dark mode<\/strong> as well. I have made this mistake recently of thinking this was how you flip on dark mode testing, and it was pointed out to me, hence this blog post. <em>That<\/em> feature is some Chrome-specific thing which takes a page which may have been designed as light-mode-first (or only) and forces a dark mode on it whether it was designed to or not.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"612\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.26.22-PM.png?resize=1024%2C612&#038;ssl=1\" alt=\"Screenshot of a coding environment showing the Chrome DevTools interface with the Console and Rendering tabs open, highlighting options for enabling automatic dark mode and simulating CSS media features.\" class=\"wp-image-6831\" style=\"width:759px;height:auto\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.26.22-PM-scaled.png?resize=1024%2C612&amp;ssl=1 1024w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.26.22-PM-scaled.png?resize=300%2C179&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.26.22-PM-scaled.png?resize=768%2C459&amp;ssl=1 768w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.26.22-PM-scaled.png?resize=1536%2C918&amp;ssl=1 1536w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.26.22-PM-scaled.png?resize=2048%2C1223&amp;ssl=1 2048w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">This blog post in the WordPress editor with <em>forced<\/em> dark mode. This page doesn&#8217;t support a dark mode normally.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>The <strong>Enabled automatic dark mode<\/strong> feature isn&#8217;t particularly relevant. I think it&#8217;s some Chrome team idea that hasn&#8217;t gone anywhere yet. It&#8217;s not something you&#8217;d really need to test with\/for in my opinion.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Firefox<\/h2>\n\n\n\n<p>Firefox has some mutually exclusive buttons in DevTools under the <strong>Inspector<\/strong> panel. The little sun icon is simulating preferring light mode and the moon(ish) icon is preferring light mode. Or they can both be off defaulting to the system.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"217\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-22-at-7.35.52-AM.png?resize=1024%2C217&#038;ssl=1\" alt=\"Screenshot of Chrome DevTools, showing the Inspector panel with options for toggling dark color scheme simulation for web pages.\" class=\"wp-image-6849\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-22-at-7.35.52-AM.png?resize=1024%2C217&amp;ssl=1 1024w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-22-at-7.35.52-AM.png?resize=300%2C64&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-22-at-7.35.52-AM.png?resize=768%2C163&amp;ssl=1 768w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-22-at-7.35.52-AM.png?resize=1536%2C326&amp;ssl=1 1536w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-22-at-7.35.52-AM.png?resize=2048%2C434&amp;ssl=1 2048w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Safari<\/h2>\n\n\n\n<p>In Safari DevTools under the <strong>Elements<\/strong> panel there is an icon to control the color modes as well as some other accessibility media preference simulators. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"323\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/CleanShot-2025-08-22-at-07.42.46%402x.png?resize=1024%2C323&#038;ssl=1\" alt=\"A screenshot of browser developer tools displaying the appearance settings, specifically the color scheme set to dark, under the Elements tab.\" class=\"wp-image-6852\" style=\"width:685px;height:auto\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/CleanShot-2025-08-22-at-07.42.46%402x.png?resize=1024%2C323&amp;ssl=1 1024w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/CleanShot-2025-08-22-at-07.42.46%402x.png?resize=300%2C95&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/CleanShot-2025-08-22-at-07.42.46%402x.png?resize=768%2C242&amp;ssl=1 768w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/CleanShot-2025-08-22-at-07.42.46%402x.png?w=1408&amp;ssl=1 1408w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">OS<\/h2>\n\n\n\n<p>Other than the non-standard Chrome thing, all this is doing is pretending as if the user has set one of the modes specifically at their OS level.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"920\" height=\"306\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.23.38-PM.png?resize=920%2C306&#038;ssl=1\" alt=\"A user interface displaying color mode options for appearance settings, including Light, Dark, and Auto modes.\" class=\"wp-image-6829\" style=\"width:608px;height:auto\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.23.38-PM.png?w=920&amp;ssl=1 920w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.23.38-PM.png?resize=300%2C100&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-21-at-1.23.38-PM.png?resize=768%2C255&amp;ssl=1 768w\" sizes=\"auto, (max-width: 920px) 100vw, 920px\" \/><figcaption class=\"wp-element-caption\">The macOS version of setting Dark Mode.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Personally, I find it a little cumbersome to need DevTools or go into System Settings to test dark\/light mode on sites. It was nice in Arc to have a simple command to do it, but as I write, color modes aren&#8217;t really a browser-level settings for the most part (let alone site-specific settings). <\/p>\n\n\n\n<p>So I was happy to find <a href=\"https:\/\/github.com\/r-thomson\/Nightfall?tab=readme-ov-file\">Nightfall<\/a>, a little macOS menu bar utility for swapping out color modes. <\/p>\n\n\n\n\t\t<figure class=\"wp-block-jetpack-videopress jetpack-videopress-player\" style=\"\" >\n\t\t\t<div class=\"jetpack-videopress-player__wrapper\"> <iframe title=\"VideoPress Video Player\" aria-label='VideoPress Video Player' width='500' height='328' src='https:\/\/videopress.com\/embed\/JPr0tVH5?cover=1&amp;autoPlay=0&amp;controls=1&amp;loop=0&amp;muted=0&amp;persistVolume=1&amp;playsinline=0&amp;preloadContent=metadata&amp;useAverageColor=1&amp;hd=0' frameborder='0' allowfullscreen data-resize-to-parent=\"true\" allow='clipboard-write'><\/iframe><script src='https:\/\/v0.wordpress.com\/js\/next\/videopress-iframe.js?m=1739540970'><\/script><\/div>\n\t\t\t\n\t\t\t\n\t\t<\/figure>\n\t\t\n\n\n<p>There is something extra nice about doing the toggling at the system level as it feels like the &#8220;real&#8221; way to do it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>All the browsers DevTools have a way of emulating color modes. The are essentially faking the system preference at the application level. Here&#8217;s where those controls are located and another nice tool. <\/p>\n","protected":false},"author":1,"featured_media":6854,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[7,157,65],"class_list":["post-6826","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-post","tag-css","tag-dark-theme","tag-devtools"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/darktoggle.jpg?fit=2100%2C1500&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/6826","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/comments?post=6826"}],"version-history":[{"count":5,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/6826\/revisions"}],"predecessor-version":[{"id":6855,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/6826\/revisions\/6855"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media\/6854"}],"wp:attachment":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media?parent=6826"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/categories?post=6826"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/tags?post=6826"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}