Detect Dark Mode Preference

Demo to preview the plugin:

Introduction

This is a simple plugin that allows you to detect the current users operating systems preferred color scheme (darkmode or lightmode).
You can then show the user the correct version of your bubble app using conditionals.
Image without caption

How to setup

  1. Add the Element to the Page
      • Go to the Design tab in your Bubble editor.
      • Search for the element called Detect Theme Preference.
      • Drag this element anywhere on your page .
      Element → Detect Theme Preference.
      Element → Detect Theme Preference.
  1. Use the Exposed State to Detect User Theme
    1. This element exposes a boolean state:
      • This Detect Theme Preference's is dark mode
      It returns yes if the user's system prefers dark mode, and no if it prefers light mode.

Plugin Element Properties

Detect Theme Preference

Element properties → Detect Theme Preference.
Element properties → Detect Theme Preference.

Exposed states

Title
Description
Type
Theme Preference
Returns the value “darkmode” or “lightmode”
Text
Image without caption

Changelogs