Dark Mode in Oxygen

YouTube video

This easy to follow tutorial will show you how to set up Dark Mode on your Oxygen Builder website. Dark Mode is incredibly popular lately and having the ability to give your users a viewing option like dark mode is a great UX bonus.

Steps via FTP 

  1. Make sure you have My Custom Functionality plugin installed on your WordPress Website:
  2. Right click this link and save to your computer ("save link as"):
  3. Login via FTP to your website
  4. Browse to /wp-content/plugins/my-custom-functionality/assets/js
  5. Add the JS file you downloaded in step 2 to the above directory
  6. Browse to /wp-content/plugins/my-custom-functionality/ and edit plugin.php
  7. Add the following code towards the bottom inside the custom_enqueue_files section:
    wp_register_script( 'darkmode', plugin_dir_url( __FILE__ ) . 'assets/js/dark-mode-switch.min.js', '', '1.0', true );

Steps inside Oxygen

Add a code block and add the below code:


<div class="custom-control custom-switch">
  <input type="checkbox" class="custom-control-input" id="darkSwitch" />
  <label class="custom-control-label" for="darkSwitch">Dark Mode</label>

<script src="<?php wp_enqueue_script( 'darkmode' );?>"></script>


[data-theme="dark"] {
  background-color: #111 !important;
  color: #fff;

[data-theme="dark"] .bg-light {
  background-color: #777 !important;

[data-theme="dark"] .bg-white {
  background-color: #000 !important;

[data-theme="dark"] .bg-black {
  background-color: #444 !important;


Lastly, add the classes you've defined in the CSS section of the code block to whatever elements on your page to be adjusted when the toggle switch is clicked.


Signup For Emails

Want to be notified when new tutorials are released? Signup below for our roundup emails. We promise not to spam and won't blow up your inbox. 
  • This field is for validation purposes and should be left unchanged.
Jonathan Jernigan, Founder
Permaslug and APEX Web Solutions

Join Permaslug

Membership Benefits Include:

  • Ultimate Oxygen Course
  • Ultimate Woocommerce Course
  • ACF Pro Course
  • Material Design Lite
  • Template Downloads
  • Community
  • And more!

More Posts

Create a Multi Row Footer in Oxygen Builder

In this second episode of our Oxygen Build Series, we're working on creating a multi-row footer for our website. This is similar to the website and incorporates elements of both Grid and Flexbox. We'll also…
READ post

Oxygen Builder 3.9 Alpha First Look

This is my very first look at Oxygen Builder 3.9 Alpha 1, which includes a number of performance fixes and adds support for MetaBox, just like Advanced Custom Fields is baked directly into Oxygen Builder.…
READ post

Creating a Multi-Row Header - Aletha's Legacy Part 1

Welcome to the first full episode of this series where we will be building a website in Oxygen Builder from the ground up, start to finish. The project is for an organization called Aletha's Legacy…
READ post
menu linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram