Skip to content

evoYTMode: first steps

Before you start

With the plugin installed and enabled, the button is already on your site. Three things are left to decide: how your site looks without the plugin, which mode a visitor who has not chosen yet sees, and who supplies the colours of the opposite mode (your theme or the plugin’s generic skin).

See the button and try the cycle

  1. Open a public page. The button is in the header corner (next to the menu on mobile).
  2. Press it. With three states it goes through automatic, light and dark, then back to automatic. The tooltip (title) gives the current state and the next one.
  3. Inspect the html tag with your browser’s developer tools. It carries data-evo-pref (what the visitor chose: auto, light or dark) and data-evo-mode (what is shown: light or dark).

In automatic mode the visitor’s system or browser preference is followed, and the page reacts live if it changes. If the system expresses no preference, the Native look of the site setting is used.

Tell the plugin what your theme is like

Open System → Plugins → System - evoYTMode, Plugin tab.

Settings of the System - evoYTMode plugin in Joomla, with the default mode, the native look of the site, the button states and the button positionSettings of the System - evoYTMode plugin in Joomla, with the default mode, the native look of the site, the button states and the button position

  • Native look of the site. Choose “Light” if your site is light without the plugin, or “Dark” if the theme is already dark. This setting decides which mode the generic skin applies to, and which mode is used in automatic when the system has no preference.
  • Default mode. What a visitor who has not pressed the button yet sees. “Automatic” follows their system.

Choose how the opposite mode is coloured

There are two ways.

With your own CSS. Your theme reacts to the attributes on html:

html[data-evo-mode="dark"] body { background: #0f1115; color: #c9ced6; }

With the generic skin. If your theme has no dark style of its own, turn on Enable the generic skin in the Generic skin tab. The skin changes background, text, headings, links, cards, menu, buttons and forms of UIkit, only in the mode opposite to the native look of the site. The seven colours can be changed in hexadecimal. If you already have your own CSS for data-evo-mode, leave it off.

The skin does not touch images, videos or background images.

Place the button where you want

The automatic position is set in Button position: header corner, four floating corners or none.

To place it yourself:

  1. Set Button position to “None (I use the element)”.
  2. In the YOOtheme Pro builder, add the Colour mode element (evoAddons group) in the header, the menu, the footer or a column.
  3. In the element, choose the Style (button, link or icon only), whether to show the name of the mode and your own Accessible name.

Any link or button with the data-evo-mode-toggle attribute also works, as does a link to #evo-mode.

Decide what the browser remembers

In the Privacy tab, Remember the choice has three values: in the browser with an expiry (the default, 12 months), only for the session, or remember nothing. What exactly is stored is in data it handles.

Check that it works

  • Change the mode and reload the page: the chosen mode stays and the page does not flash on load.
  • Change the operating system mode while the button is on automatic: the page follows without reloading.
  • Press the button from the keyboard (Enter or Space).
  • With evoMCP, the evoytmode_status tool tells you whether the plugin is enabled, whether the element and assets are complete on disk, and which position, default mode and skin are set. See the reference.