When developing a site with a
dark modes, it gets bothersome to change your settings to see results.
Especially if you're testing
I work on a MacBook and would open settings to do this, i'd miss the
css transitions. It was annoying.
But there's a fix for this. You can set up a keyboard shortcut to toggle between
dark mode with
automator, here's how:
Add workflow to Automator #
- Select "workflow receives current
any application" from the dropdown options.
- In the long list of
actionson the left find
Run AppleScript. Then Double-Click to add it to your workflow.
- Paste the following commands in your workflow:
tell application "System Events" tell appearance preferences set dark mode to not dark mode end tell end tell
- Save the Workflow, call it something sensible like "toggle dark mode"
Click the the play button
▶️ to see the script in action.
Add the shortcut #
serviceson the left.
- Scroll down and find
general, your workflow is there.
- Double Click on the right hand side of your workflow, where it says
- Type the shortcut you want to use. I use
I have my
appearance preferences set to
auto and this shortcut doesn't interfere with it. When the time comes, it sets itself to the correct setting.
Source: I found this tip by googling it then finding this post on lifehacker
- 24 Dec 20
- 24 Dec 20