How to Add Dark Mode to Blogger Blog (Step-by-Step Guide 2026)
Add dark mode to your Blogger blog in 2026 — step-by-step CSS method, a toggle button, and how to test it on mobile and desktop.
Dark mode turns your blog's bright white background dark and its dark text light, so it is easier to read at night and on phones in low light. Many readers now expect a dark option, and a blog that only ever shows a white page can feel harsh after sunset. The good news is that Blogger does not need a plugin for this: you can add dark mode with a small amount of CSS and a toggle button, and you can do it without changing your template.
This guide shows the simplest method that works on most Blogger templates: a CSS rule that follows the reader's device setting, plus an optional button so readers can switch it themselves. It also covers how to test it, and how to undo it if something looks wrong. Before you start, back up your blog — the steps are in our guide to backing up your Blogger blog completely. If you are also thinking of changing your whole template, read our guide to changing a Blogger template without losing content first.
What Dark Mode Does — and What It Does Not Do
Dark mode changes colours, not content. Your posts, images, links and layout stay exactly the same; only the background, text and link colours change. A good dark mode keeps the same contrast — light text on a dark background that is still easy to read — and keeps links and buttons clearly visible.
It does not make your blog faster, it does not change your search ranking on its own, and it does not fix a template that is hard to read in the first place. If your light theme already has pale grey text on a white background, fix that first. Dark mode is a comfort feature for your readers, and it works best on a theme that is already clean and readable, such as the themes in our guide to the best free Blogger templates for beginners.
Before You Start: Back Up Your Theme
You will be editing your template's HTML, so a backup is not optional. It takes about a minute and it is the only safe way to undo a mistake.
- Go to Theme, click the arrow next to Customise, and choose Backup.
- Save the XML file with today's date in its name, for example
theme-backup-22-nov-2026.xml. - Also back up your content: go to Settings, then Manage blog, then Back up content, and download the file.
If anything looks broken after your edit, restore the backup theme from step 1 and start again. Do not keep editing a broken template hoping it will fix itself.
Method 1: Follow the Reader's Device Setting (Easiest, No Button)
This is the simplest dark mode. It uses a CSS media query, which means the browser checks whether the reader's phone or computer is set to dark mode, and applies your dark colours automatically. Readers who use light mode see nothing change.
- Go to Theme, click the arrow next to Customise, and choose Edit HTML.
- Click inside the code box and press Ctrl + F (or Cmd + F on a Mac) to open the search box.
- Search for
</head>and click just before it, or search for a line near the end of your CSS that starts with/*— either spot works, as long as the code goes inside the<style>area or just before</head>. - Paste the code below, just before
</head>:
<style>
@media (prefers-color-scheme: dark) {
body { background: #121212; color: #e8e8e8; }
a { color: #8ab4f8; }
.post-body, .post-title, .post { background: #121212; color: #e8e8e8; }
}
</style>Step 5: Click Save, then open your blog in a new tab.Step 6: On your phone or computer, switch the device itself to dark mode, refresh the blog, and check the result. Switch the device back to light mode and check that the blog returns to normal.
This method has one limit: it only follows the device setting. A reader who uses light mode on their phone cannot switch your blog to dark on its own. That is fine for most blogs. If you want a button as well, use Method 2.
Method 2: Add a Dark Mode Toggle Button
A toggle button lets any reader switch your blog to dark mode, whatever their device setting is. It needs a little JavaScript as well as CSS, so follow the steps in order and test after each one.
Step 1: Add the dark-mode CSS
Follow steps 1 to 3 of Method 1, then paste this CSS just before </head>:
<style>
body.dark-mode { background: #121212; color: #e8e8e8; }
body.dark-mode a { color: #8ab4f8; }
body.dark-mode .post-body, body.dark-mode .post-title { background: #121212; color: #e8e8e8; }
</style>
Step 2: Add the button
Still in Edit HTML, search for <body and paste this line just after the opening <body> tag:
<button id="darkModeToggle" onclick="document.body.classList.toggle('dark-mode')">Dark mode</button>
The button will appear at the top of your blog. You can move it later by placing the same line in a gadget instead — go to Layout, click Add a Gadget in the header area, choose HTML/JavaScript, and paste the button code there.
Step 3: Save and test
Click Save, open your blog, and click the button. The page should switch to dark immediately; click it again and it should switch back. If nothing happens, check that you saved the theme, that the CSS and the button are both in place, and that your browser is not showing a cached copy — press Ctrl + Shift + R to force a fresh load.
If you want the choice to be remembered when the reader comes back, that needs a small script that saves the setting in the browser. That is an optional extra; the toggle on its own already works, and keeping it simple means fewer things that can break.
How to Pick Dark Mode Colours That Actually Read Well
The most common dark-mode mistake is making the background pure black and the text pure white. That combination is harsh and tiring to read. Use the softer values in the code above as a starting point, and check these rules:
- Background: a very dark grey such as
#121212or#1a1a1a, not pure black#000000. - Text: a soft off-white such as
#e8e8e8, not pure white#ffffff. - Links: a light blue such as
#8ab4f8, so links still stand out from the text. - Images: leave them alone. Photos and featured images should not be darkened; only the page around them changes.
- Contrast: read a full post in dark mode on your phone in a dim room. If you have to squint, the contrast is wrong — lighten the text or darken the background a little, then test again.
Our guide to Blogger image SEO covers image sizes and alt text, and our guide to speeding up a Blogger blog explains how to keep the page light — both still apply in dark mode.
Testing Dark Mode Properly
Do not test on one screen and call it done. Check all of these before you tell anyone about the new feature:
- Phone, dark device setting: open the homepage and two posts. Text should be readable, images should look normal, and nothing should overflow sideways.
- Phone, light device setting: the blog should look exactly as it did before. If it is dark when it should be light, your CSS is applying to everyone — check the media query or the toggle code.
- Laptop or desktop: open the homepage, a post with a table, and a post with a list. Tables and code blocks are the parts most likely to look wrong in dark mode, because their background colours are often set separately.
- Menu and sidebar: check that the menu, search box, labels and popular-posts widget are still readable. Sidebar widgets sometimes keep a white background in dark mode; if yours does, add that widget's class to your dark CSS, or accept a white widget on a dark page — do not leave grey text on a white widget that you cannot read.
- The toggle button: click it twice and confirm the page switches both ways. Check that the button itself is visible in both modes.
If a template already has its own dark mode, use that instead of adding your own code. Check Theme and Customise first — some templates, including magazine themes such as FutureMag, may already offer a dark option, and two dark-mode systems fighting each other is the fastest way to a broken-looking blog.
Common Problems and How to Fix Them
Nothing changes when I switch to dark mode. Your CSS may be in the wrong place, or your browser may be showing a cached copy. Force-refresh with Ctrl + Shift + R, check that you clicked Save in Edit HTML, and check that the code is inside the theme and not in a draft post.
Only some parts turn dark. Your template sets background colours on individual sections — the post area, the sidebar, the footer — and your CSS only covers the body. Add those section classes to your dark CSS, one at a time, and test after each addition.
Text becomes unreadable. A section has a dark background but dark text, or a light background but light text. Find that section's class in the theme code and set both its background and its text colour in your dark CSS.
The blog looks broken after editing. Restore your backup theme from the start of this guide, then try again with smaller steps: Method 1 first, test it, and only then add the toggle button.
The toggle button is in an ugly spot. Move it into a gadget in Layout, or style it with a little CSS — a small rounded button in the header is usually enough. Keep it simple; a button that is hard to find is no better than no button.
Once dark mode is set up, add social media buttons to Blogger so readers can follow you from any theme.
Frequently Asked Questions
Does Blogger have a built-in dark mode?
Blogger itself does not add a dark mode to your blog automatically. Some templates include one, and you can add one yourself with the CSS in this guide. Check your template's Customise options first before adding code.
Will dark mode slow down my blog?
No, not in any way your readers will notice. The CSS in this guide is a few lines long. A slow blog is almost always caused by large images or too many widgets, not by a colour change.
Will dark mode affect my AdSense approval?
A template or colour scheme alone does not decide AdSense approval. Google looks for original, helpful content, clear navigation and the required About, Contact, Privacy Policy and Disclaimer pages. A readable dark mode supports that; an unreadable one works against it. Our guide to AdSense approval requirements for Blogger explains what Google really checks.
Can I make dark mode the default for everyone?
You can, by applying the dark colours without a media query or a toggle — but most readers do not want that. Following the device setting, with a toggle for everyone else, is the friendlier choice.
Do I need to change my images for dark mode?
No. Photos and featured images should stay as they are. Only the page background, text and links change. If an image has a white background that looks odd on a dark page, replace that one image with a version that has a transparent or dark background.
Final Thoughts
Dark mode is a small change with a real payoff: readers who browse at night will stay longer, and readers who prefer dark interfaces will notice that you thought about them. Start with Method 1, test it on a phone and a laptop, and only add the toggle button when the automatic version works. And keep the backup you made at the start — it is the cheapest insurance in blogging.
Next, if your blog is ready for AdSense, read why applications get turned down: why AdSense rejected your Blogger blog — 10 reasons and how to fix them.
