Online Tools Toolshu.com Log In Sign Up

Darkmode.js Darkmode.js

https://github.com/sandoche/Darkmode.js

automatic jump after -s...

Website Introduction

Darkmode.js is an open-source, lightweight JavaScript plugin designed to help developers add a dark mode or night mode toggle to their websites in just a few seconds.

Key Features

  • Automatically displays a toggle widget
  • Remembers user preferences using localStorage
  • Auto-detects OS theme preference (supports prefers-color-scheme)
  • Supports programmatic control without UI
  • Uses CSS mix-blend-mode for dark mode effect

Usage

Supports both CDN and NPM installation, offers extensive customization options (e.g., button position, colors, animation duration), and integrates with platforms like WordPress, Drupal, and Nuxt.js.

Compatibility

Due to the use of mix-blend-mode, some older browsers (like IE and legacy Edge) may not support it. The plugin automatically hides the button in such cases to ensure compatibility.