If you are a developer, you can use the following JavaScript hooks to control dark mode easily.
- To activate Dark Mode, run this method using JavaScript (works on console too): WPDarkMode.activate()
- To deactivate Dark Mode use: WPDarkMode.deactivate()
- To check if currently Dark Mode is active or not, use this getter property: WPDarkMode.isActive
- To detect the user’s system preference, run this getter property: WPDarkMode.isDeviceDark
- To prevent CSS overrides on specific elements, simply apply the following line: .wp-dark-mode-ignore
- Also, we have event listeners for dark mode, and separately for dark mode switches. If you would like to do something automated when dark mode is changed: WPDarkMode.onChange( () => { // your automated task })
Hello,
the plugin is really great, as it solves the feature of a dark mode really fast.
Nevertheless it’s kind of useless for developers, as there is no possibility to stop the plugin overwriting CSS rules. This leads to effects, where buttons are getting black in black on black background – a super no-go for UX. There should be a general CSS class, that we can use, so that the plugin will not overwrite this elements.
And no, I will not pay 180$ per site for having just a dark mode with a stopping CSS class. As a developer I don’t need all the other things around.
Best, Jan
Thanks for sharing your feedback—we really appreciate it! Just to clarify, you can actually prevent the plugin from overriding styles by using the .wp-dark-mode-ignore CSS class on specific elements. This will stop dark mode styles from being applied, allowing you to maintain full control over their appearance.
We understand your concern regarding pricing. The goal of the Pro version is to offer a complete set of tools for a wide range of users, but we definitely take your input seriously and will consider ways to improve flexibility for developers.
Let us know if you need help implementing the ignore class!