capacitor-docs icon indicating copy to clipboard operation
capacitor-docs copied to clipboard

Add system theme preference support using respectPrefersColorScheme

Open KhanjarSingh opened this issue 1 month ago • 3 comments

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.

KhanjarSingh avatar Nov 11 '25 14:11 KhanjarSingh