Light / Dark mode utilities

Show / hide element on dark/light mode

Use this classes to show and element only on light mode or only on dark mode.

Here are the supported classes and an example:

  • .show-on-light - visible only on light mode
  • .show-on-dark - visible only on dark mode
Show logo on light mode: Visma logo Show logo on dark mode: Visma logo

Light / Dark mode switcher

The Mode switch/toggle is used to switch between Standard (light) mode and Dark mode. It should be easily accessible via the user profile dropdown in the top menu.

The .light-dark-toggle class renders the refreshed flat switch with a sun glyph on the thumb. Check the code from the right section to add this switcher into your app.

Example in the top navigation

Legacy animated switch

The .light-dark-toggle-legacy class preserves the previous animated sky / sun / clouds / stars switch. The inner markup is identical to .light-dark-toggle, so switching back is a single class change.