{"id":15,"date":"2026-04-04T17:49:09","date_gmt":"2026-04-04T17:49:09","guid":{"rendered":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/2026\/04\/04\/dark-mode\/"},"modified":"2026-04-04T17:49:09","modified_gmt":"2026-04-04T17:49:09","slug":"dark-mode","status":"publish","type":"post","link":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/2026\/04\/04\/dark-mode\/","title":{"rendered":"Dark Mode &#038; Custom Logo"},"content":{"rendered":"<p>Dark mode is now expected. Browsers communicate user preference via <code>prefers-color-scheme<\/code>, and most modern sites either follow it silently or expose a toggle. Legal Pro gives you all three options \u2014 automatic, manual, or system-with-toggle \u2014 and pairs it with dual-logo support so your branding stays legible across both modes.<\/p>\n<h2>Three behaviour modes<\/h2>\n<p>Go to <strong>Appearance \u2192 Customize \u2192 Legal Pro \u2192 Light &amp; Dark Mode<\/strong>. The <em>Behavior<\/em> setting offers three options:<\/p>\n<h3>Auto (follow system, no toggle)<\/h3>\n<p>The site silently mirrors the visitor&#8217;s OS preference. No toggle button. No persistence \u2014 it just follows the system.<\/p>\n<p>Use this when:<\/p>\n<ul>\n<li>Your audience is technical enough to understand OS-level dark mode<\/li>\n<li>You don&#8217;t want to add a UI element to the header<\/li>\n<li>You want zero friction for visitors who&#8217;ve already chosen dark at the OS level<\/li>\n<\/ul>\n<h3>Manual (toggle, default light)<\/h3>\n<p>A toggle appears in the header (or floating, depending on position setting). The site defaults to light. The visitor&#8217;s choice is saved in <code>localStorage<\/code> as <code>lg_color_mode<\/code> and persists across sessions.<\/p>\n<p>Use this when:<\/p>\n<ul>\n<li>Your audience may not have a system-level preference<\/li>\n<li>You want every visitor to see the editorial light theme on first arrival (the brand-defining first impression)<\/li>\n<\/ul>\n<h3>System with toggle (recommended)<\/h3>\n<p>The toggle appears in the header. Initial state follows the OS preference. If the visitor explicitly toggles, that choice persists thereafter \u2014 overriding the OS preference for this site only.<\/p>\n<p>This is the default and the recommended setting. It respects the visitor&#8217;s OS preference but gives them site-level control.<\/p>\n<h2>Toggle position<\/h2>\n<p>For Manual and System modes, you can place the toggle in two places:<\/p>\n<ul>\n<li><strong>Header (next to CTA)<\/strong> \u2014 small circular button to the left of the &#8220;Schedule a consultation&#8221; CTA<\/li>\n<li><strong>Floating (bottom right)<\/strong> \u2014 fixed position, always visible. Useful for content-heavy sites where the toggle should stay accessible while reading<\/li>\n<\/ul>\n<h2>How no-flash works<\/h2>\n<p>Dark mode visitors are particularly sensitive to &#8220;flash of light content&#8221; \u2014 that 100ms flicker where the page renders in light mode before the script applies dark. Legal Pro avoids this by injecting a tiny script in <code>&lt;head&gt;<\/code> at priority 1 \u2014 before any stylesheet loads. This script:<\/p>\n<ol>\n<li>Reads the saved preference from <code>localStorage<\/code><\/li>\n<li>Reads the OS preference from <code>matchMedia<\/code><\/li>\n<li>Decides the initial state and applies <code>data-color-mode=\"dark\"<\/code> to <code>&lt;html&gt;<\/code> immediately<\/li>\n<\/ol>\n<p>By the time the first stylesheet renders, the dark variables are already in scope. No flash.<\/p>\n<h2>Reduced motion and accessibility<\/h2>\n<p>The dark mode system respects <code>prefers-reduced-motion<\/code> for the toggle&#8217;s transition animations, and the toggle button itself is keyboard-accessible (focus ring on focus, activates on Enter or Space).<\/p>\n<p>Color contrast in both modes meets WCAG AA for body text and AAA for headlines \u2014 verified during development against the actual rendered tokens, not just the variable definitions.<\/p>\n<h2>Dual-logo support<\/h2>\n<p>If you upload a single logo via WordPress&#8217;s standard <em>Site Identity \u2192 Logo<\/em> setting, that logo appears on both light and dark backgrounds. For most logos this is fine \u2014 a black or oxblood SVG mark reads on both.<\/p>\n<p>For some brands, though, the logo needs an alternate version on dark canvas \u2014 a light-on-dark variant. This is what Dual-Logo handles.<\/p>\n<h3>Setting up dual logos<\/h3>\n<ol>\n<li>Upload your light-mode logo (the one that goes on bone canvas) under <strong>Customize \u2192 Site Identity \u2192 Logo<\/strong>.<\/li>\n<li>Upload your dark-mode logo under <strong>Customize \u2192 Legal Pro \u2192 Dual Logo (Light\/Dark) \u2192 Dark-Background Logo<\/strong>.<\/li>\n<li>Optional: set <strong>Max Logo Width<\/strong> to constrain both logos to the same display size (default: 160px).<\/li>\n<\/ol>\n<p>The dark logo is automatically used in:<\/p>\n<ul>\n<li>The header when dark mode is active<\/li>\n<li>The footer (always dark canvas)<\/li>\n<li>Any section with the class <code>lg-section-dark<\/code><\/li>\n<\/ul>\n<h3>Logo file recommendations<\/h3>\n<p>For best results across modes:<\/p>\n<ul>\n<li>Use SVG when possible \u2014 sharp at any size, no resolution issues<\/li>\n<li>If you must use raster, PNG with transparent background at 2x intended display size (e.g., 320px wide for a 160px display)<\/li>\n<li>Light-mode logo: dark mark (oxblood, black, or charcoal) on transparent<\/li>\n<li>Dark-mode logo: light mark (cream, gold, or white) on transparent<\/li>\n<li>Don&#8217;t use a white-background block behind your logo. The transparency should let the canvas show through.<\/li>\n<\/ul>\n<h2>How the swap works (technical)<\/h2>\n<p>The plugin uses CSS <code>content: url()<\/code> to swap the displayed image on the existing <code>&lt;img&gt;<\/code> element. This works in all modern browsers and avoids needing JavaScript or a runtime image-set polyfill. The swap is triggered by the <code>data-color-mode=\"dark\"<\/code> attribute on <code>&lt;html&gt;<\/code>, the <code>.lg-footer<\/code> selector for footer use, and the <code>.lg-section-dark<\/code> class for any section you mark as dark.<\/p>\n<p>This means the dark logo even works for sites using a custom HTML logo via the <em>Site Identity \u2192 Logo<\/em> WP feature \u2014 no template overrides needed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Three ways to handle dark mode, plus dual-logo support so your firm mark stays legible on both light and dark backgrounds.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[30,28,29,12],"class_list":["post-15","post","type-post","status-publish","format-standard","hentry","category-pro-features","tag-accessibility","tag-dark-mode","tag-logo","tag-pro"],"_links":{"self":[{"href":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/wp-json\/wp\/v2\/posts\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/wp-json\/wp\/v2\/comments?post=15"}],"version-history":[{"count":0,"href":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/wp-json\/wp\/v2\/posts\/15\/revisions"}],"wp:attachment":[{"href":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/wp-json\/wp\/v2\/media?parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/wp-json\/wp\/v2\/categories?post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.fasterthemes.com\/legal-wordpress-theme\/wp-json\/wp\/v2\/tags?post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}