Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Olivero Dark Switch

13 sites Security covered
View on drupal.org

This module adds a dark mode toggle to the Olivero theme, allowing users to switch between light and dark modes. It seamlessly integrates with Olivero's design and uses local storage to remember user preferences, also respecting browser settings for dark mode.

Ever wanted to view your Drupal site in dark mode but love Olivero too much to give it up? This module adds a Drupal Block with a dark mode toggle themed to blend into Olivero. Simply place the block where you want the toggle on your site to enable optional dark theme!

Features

  • Provides a block containing the theme toggle. This block can be configured to float the toggle within the block region.
  • Alters Olivero's core CSS variables in order to seamlessly integrate with Olivero's colour picking functionality. More specifically, it reverses any gradient variables with small modifications in order to meet accessibility contrast standards.
  • Uses local storage to keep track of the toggle position chosen by a user.
  • Detects (prefers-color-scheme: dark) to provide the dark theme to users who have their browser preference set to dark mode.

Post-Installation

Once you have installed this module you will want to place the toggle block somewhere on your site. More Specifically,

  1. Go to Admin > Structure > Block Layout (admin/structure/block)
  2. Click on "Place Block" beside the region you want to place the dark theme toggle. We suggest "Hero (full width)"
  3. Now scroll down to "Olivero Dark Switch" in the list of potential blocks to place and click "Place block" beside it.
  4. Turn off "Display title" and set "Float" to "Right" before saving the block.
  5. Now go to the home page or any other Olivero themed page in your site and notice the toggle in the top right hand corner!

Additional Requirements

This module does not need any external libraries although it does assume you are using the Drupal Core Olivero theme 😉.

Similar projects

Olivero Dark Mode

This module provides a full dark mode subtheme of Olivero. Note: Drupal core itself does not recommend subthemeing Olivero, specifically because it does not promise backwards compatibility.. This is why my module takes the approach of supplying a block that alters the theme instead.

Activity

Total releases
2
First release
Oct 2025
Latest release
9 months ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Slowing

Releases

Version Type Release date
1.0.x-dev Dev Oct 8, 2025
1.0.0-alpha1 Pre-release Oct 8, 2025