Advanced: Create your own toggle button

Reading Time:< 1minute

Creating your own dark mode toggle buttons is possible, you need to read the document of the following two features first.

Then set the click event for the buttons you want as a toggle, the following button event handler code will help.

Toggle dark mode:

(() => {
  if (window.togglePloverThemeMode) {
    window.togglePloverThemeMode('dark');
  }
})();

Toggle light mode:

(() => {
  if (window.togglePloverThemeMode) {
    window.togglePloverThemeMode('light');
  }
})();

Leave a Reply

Your email address will not be published. Required fields are marked *

Catalog

Top ↑