Once upon a time, dark mode was not an option — it was the only option in early UIs. We especially remember coding green on black, and writing white on blue, before the radical switch to black on white. And following that, for the last twenty years or so, developers everywhere have been setting up their own environments to revert back to a preferred dark mode.
But, now, it’s not just developers who are keen for this mod. More people want to flick the switch on their devices and go dark.
I'll stop wearing black when they make a darker color.
Dark mode has been growing in popularity, being one of the most common customizations of 2019. It’s been introduced in loads of apps including Microsoft Outlook, Gmail for Android, Twitter, Facebook Messenger, Reddit, Slack, and YouTube.
Three reasons people say they want to use dark mode:
- It’s easier on your eyes (especially at night)
- For improved readability of text
- To save battery life when using a mobile device
We also think it’s just plain cool. 😎
But, more importantly, we want to make sure we're providing our developers with what they need to keep delighting their end users.
TinyMCE dark mode
To keep up with the growing trend, we now provide options to configure dark mode for the TinyMCE rich text editor to match your applications and user preferences.
Configure dark mode for TinyMCE
There are two ways to configure dark mode for TinyMCE.
You can initialize the editor with the following settings:
skin: "oxide-dark", content_css: "dark"
Alternatively, you can initialize the mode depending on the user’s preference as specified in their operating system:
skin: (window.matchMedia("(prefers-color-scheme: dark)").matches ? "oxide-dark" : ""), content_css: (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "")
Try it now
Paste the following code into a TinyMCE fiddle and click Run:
While you’re here, find out more about the Tiny Skins and Icon Packs premium plugin.
By the way, did you see the wicked Halloween skin we put out this year? It was developed with our skin tool, which is currently under development. Stay tuned for its release...