Webstudio Dark Theme Switcher

The easiest way to add dark mode to your Webstudio site.
Smart theme switcher. Just plug and play. Color Pallette

Get Template
Dark mode that just works:

This website is using Craft method for color naming.
But you can use whatever you want.

background primary
foreground primary
background secondary
foreground secondary
background tertiary
foreground tertiary
background quaternary
foreground quaternary
foreground border
foreground muted
background accent
foreground accent
background card
focus color

Light Theme by Default.
Dark Theme become active by adding .dark-theme class.

Basic Light Theme
Walter White
High-converting landing page
button
Our Features
Feature A
Light & dark values built in, user can switch anytime.
button
Feature B
Light & dark values built in.
Feature C
User can switch anytime.
Reviews
Respects OS settings, works out of the box
Card A.
Updates when system theme changes
Terti P.
Light & dark values built in, user can switch anytime.
Quad I.
Call to Accent
Light & dark values built in, user can switch anytime. Respects OS settings
button
<footer>
Basic Dark Theme
Walter Night
High-converting landing page
button
Our Features
Feature A
Light & dark values built in, user can switch anytime.
button
Feature B
Light & dark values built in.
Feature C
User can switch anytime.
Reviews
Respects OS settings, works out of the box
Sam A.
Updates when system theme changes
Peter P.
Light & dark values built in, user can switch anytime.
Jony I.
Call to Action
Light & dark values built in, user can switch anytime. Respects OS settings
button
<footer>

Different types of switchers:

List of text titles

Only current theme text. Switch on click.

List of Icons

Only current theme icon. Switch on click.

What’s inside:

🌓
Auto / Light / Dark modes
User can switch anytime
💾
Local Storage support
Remembers user’s choice
🖥️
System theme detection
Respects OS settings
🔄
Real-time sync
Updates when system theme changes
⚙️
No dependencies
Pure HTML, CSS & JS
🎨
Craft CSS variable palette
Light & dark values comes from Open Props.
Webstudio-ready
Works out of the box

How it works

  • On your first visit, the theme is set to Auto.
  • In Auto mode, the website matches your device’s light or dark theme.
  • If you switch to Light or Dark, your choice is saved for future visits.
  • Your theme stays the same across all pages of the site.

Use it as a starting point – or plug it into your existing project.

option A

Starting from this template

No setup needed.
The color tokens are already connected in :root, and the theme switcher code is in the header and footer. Place switchers where you want.

Just start building your site – dark mode will work out of the box.

option b

Adding to your existing project

1. Go to the Global Root

2. Copy OP Colors Light Theme tokens and paste it into your project’s :root.

3. Grab the <script> codes from the header and footer of this template. Use Slot for all pages.

4. Place switchers where you want.

5. Change your projects colors to prebuilt colors via variables.

Done!
Your site now supports Light, Dark, and Auto modes.

Dark mode shouldn't be hard

Adding dark mode often means hours of setup, complex scripts, and unexpected behavior across devices.

Too many tutorials... 😥

This template solves it!

With a clean color system and drop-in theme logic – designed for Webstudio.

Just start building your site – dark mode will work out of the box.

Looks nice 😎

Light & Dark – WebStudio Template
Purchase Template

Designed by:
khimanin.com
Website Theme:
Built with Webstudio