Detect Light or Dark Mode and Display Both Variations In Previews
Daily Coding Tip 216
There is an environment variable that lets you access the currently selected colour scheme. There is currently only a light and dark mode, but it’s not impossible that new schemes will be introduced in the future.
For this reason I’ve used a switch on the variable with an @unknown default, so that I am prepared for th…
Keep reading with a 7-day free trial
Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.

