| 开发者 | fmojibur |
|---|---|
| 更新时间 | 2026年11月25日 21:19 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
scm-show-light: visible only in light mode (for example a dark logo).scm-show-dark: visible only in dark mode (for example a white logo).scm-no-swap: the element keeps its original colors in both modes.html[data-color-mode="dark"] CSS hook, scm:change JavaScript event, ShilpiColorModes.set( 'dark' ) API, and PHP filters.Turn on the floating toggle in Appearance > Color Modes > Toggle, or place it yourself with the [shilpi_color_toggle] shortcode, the "Dark Mode Toggle" block, the "Dark Mode Toggle" Elementor widget, or a menu location.
Search for "Dark Mode Toggle" in the Elementor widget panel and drag it into your header or any section.
Yes. Choose "Dark design" in the Overview tab. The plugin then creates the light mode from your color pairs.
No. Only the colors you list are replaced. Images are never inverted. You can optionally dim photos a little in dark mode.
Add both logos next to each other. Give the normal logo the class scm-show-light and the white logo the class scm-show-dark. In Elementor use Advanced > CSS Classes. Only the logo for the active mode is shown.
Yes. Add the class scm-no-swap to it, or list its selector under Advanced > Exclusions. Note that hover colors and ::before / ::after decorations inside that section can still change if they use a swapped color.
Yes. Set "Visitors see first" to Automatic. The toggle works at any time. By default a toggle choice lasts while the visitor browses your site; turn on Smart memory to keep it for future visits. Either way, if the device later switches between light and dark (for example a phone that turns dark at night), the site follows the device again. This smart memory means visitors never get stuck in the wrong mode.
No. The bootstrap script is under 1 KB, the engine is a small file loaded in the footer, and there are no external requests.
Yes. The mode is chosen in the browser, so cached pages work. The plugin also excludes its tiny head script from JS delay and defer in WP Rocket, LiteSpeed Cache, Autoptimize, Perfmatters and SiteGround Optimizer.
Scan the page again and add the missing color. If your theme uses many slightly different shades, raise the "Color matching tolerance" slider in the Colors tab. Stylesheets loaded from another domain are swapped too when that server allows it.
Add ?color-mode=dark or ?color-mode=light to any URL on your site.
Yes. ShilpiColorModes.get(), ShilpiColorModes.set( 'dark' ), ShilpiColorModes.toggle() and ShilpiColorModes.reset(). Listen for changes with document.addEventListener( 'scm:change', function ( e ) { console.log( e.detail.mode ); } ).