capacitor-docs
capacitor-docs copied to clipboard
Add system theme preference support using respectPrefersColorScheme
This PR enables automatic theme detection based on the user's operating system settings.
By adding:
respectPrefersColorScheme: true
he site now respects the user's system-level dark or light mode on their first visit, aligning with the “System Default” theme behavior.
✅ What’s Already Working
Theme toggle button (enabled by default) Light/Dark mode switching localStorage persistence Dark mode logos configured
🔧 What’s New Added respectPrefersColorScheme: true to automatically set theme based on OS preference
🧪 Testing
Open the site in an incognito/private window. Change your system theme to dark/light mode. Reload the page — it should match your OS theme automatically.