Skip to main content
Use this page when you want your website to control widget theme in real time.

How it works

Website sync requires this widget setting:
  • Theme = Auto
In Auto mode:
  • Remapdb detects your website theme.
  • It sends the resolved theme (light or dark) to the widget.
  • Widget applies it without reloading.

Automatic theme detection

Remapdb resolves your website theme using this priority:
  1. data-bs-theme on <html>
  2. data-bs-theme on <body>
  3. Computed color-scheme on page root
  4. Explicit theme classes (dark, light, theme-dark, theme-light, etc.)
  5. Rendered page background luminance
  6. prefers-color-scheme media query fallback

Programmatic control from your theme switcher

Option A: API call

Target a specific widget:

Option B: Custom event

Typical integration with a website theme switcher

Debug checklist

  • Ensure widget setting is Theme = Auto.
  • Confirm your page actually exposes a theme signal (data-bs-theme, classes, or clear light/dark surface styles).
  • Enable debug logs in widget settings and inspect browser console.
  • If using custom switchers, always call window.RDBWidget.setTheme(...) after your site theme changes.