Title: Dark Mode Toggle Block
Author: Rich Tabor
Published: <strong>2024 年 8 月 27 日</strong>
Last modified: 2024 年 11 月 21 日

---

搜索插件

![](https://ps.w.org/dark-mode-toggle-block/assets/banner-772x250.png?rev=3141962)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/dark-mode-toggle-block/assets/icon-256x256.png?rev=3141962)

# Dark Mode Toggle Block

 作者：[Rich Tabor](https://profiles.wordpress.org/richtabor/)

[下载](https://downloads.wordpress.org/plugin/dark-mode-toggle-block.1.0.5.zip)

 * [详情](https://cn.wordpress.org/plugins/dark-mode-toggle-block/#description)
 * [评价](https://cn.wordpress.org/plugins/dark-mode-toggle-block/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/dark-mode-toggle-block/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/dark-mode-toggle-block/#developers)

 [支持](https://wordpress.org/support/plugin/dark-mode-toggle-block/)

## 描述

A WordPress block for toggling between between light and dark appearance on your
site.

## 区块

该插件提供了 1 个区块.

 *   Dark Mode Toggle Allow visitors to switch between light and dark appearances.

## 安装

 1. Upload the plugin files to the `/wp-content/plugins/` directory, or install the
    plugin through the WordPress plugins screen directly (if available).
 2. Activate the plugin through the ‘Plugins’ screen in WordPress
 3. Add the block from the inserter within the WordPress editor.
 4. If necessary, add CSS variables using .theme-dark to assign dark mode colors. [Learn more](https://rich.blog/dark-mode-toggle-block/)

## 常见问题

### Can the Dark Mode Toggle block be used with my theme?

Yes! You will need to add CSS variables to map existing coor values to a dark style
though. [Learn more](https://rich.blog/dark-mode-toggle-block/).

### Where can I send feedback or ideas?

Please reach out via the official [plugin support forum](https://wordpress.org/support/plugin/dark-mode-toggle-block).

### Where can I find the development files?

You can find the development files for the block on [GitHub](https://github.com/richtabor/dark-mode-toggle-block).

## 评价

![](https://secure.gravatar.com/avatar/bc0d648bb0bd29ce0902dc00b17a649e400f87b2603fc44e7e171647daf6885a?
s=60&d=retro&r=g)

### 󠀁[Perfect solution](https://wordpress.org/support/topic/perfect-solution-283/)󠁿

 [Emily](https://profiles.wordpress.org/wilkinsone/) 2025 年 3 月 27 日 1 回复

This is absolutely perfect for what I needed! Nice light plugin, slider looks neat
with good customisation options, and ensured I could get my site displaying exactly
as I want it in dark mode. I didn’t find it clear from the plugin description how
the plugin works, so it might be useful to add a direct link to the readme file 
where you can find that information github[dot]com/richtabot/dark-mode-toggle-block/
blob/main/README.md

![](https://secure.gravatar.com/avatar/42f27770a0a33184f22077f7e87fde8a279ef8f998e4c0ef41dfa05ea056eb6c?
s=60&d=retro&r=g)

### 󠀁[One of the most imp block plugin for block themes, Simple and ease to use](https://wordpress.org/support/topic/one-of-the-most-imp-block-plugin-for-block-themes-simple-and-ease-to-use/)󠁿

 [Ratnesh Sonar](https://profiles.wordpress.org/ratneshsonar/) 2024 年 11 月 21 
日 1 回复

I have tried many dark mode toggle plugins, this is one of the best and easiest 
plugin to work with. Just install it and add the block where ever you want. As simple
as that. Thank you.

 [ 阅读所有1条评价 ](https://wordpress.org/support/plugin/dark-mode-toggle-block/reviews/)

## 贡献者及开发者

「Dark Mode Toggle Block」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Rich Tabor ](https://profiles.wordpress.org/richtabor/)

[帮助将「Dark Mode Toggle Block」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/dark-mode-toggle-block)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/dark-mode-toggle-block/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/dark-mode-toggle-block/)，或通过
[RSS](https://plugins.trac.wordpress.org/log/dark-mode-toggle-block/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/dark-mode-toggle-block/)。

## 更新日志

#### 1.0.5

 * Improve accessibility.
 * Updated tested up to.

#### 1.0.4

 * Improve default colors.

#### 1.0.3

 * Update readme.

#### 1.0.2

 * Improve block example.

#### 1.0.1

 * Update prefix.
 * Improve inline script.
 * Use apiVersion 3.

#### 1.0.0

 * Initial release.

## 额外信息

 *  版本 **1.0.5**
 *  最后更新：**2 年前**
 *  活跃安装数量 **200+**
 *  WordPress 版本 ** 6.4 或更高版本 **
 *  已测试的最高版本为 **6.7.5**
 *  PHP 版本 ** 7.0 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/dark-mode-toggle-block/)
 * 标签
 * [block](https://cn.wordpress.org/plugins/tags/block/)
 *  [高级视图](https://cn.wordpress.org/plugins/dark-mode-toggle-block/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  2 条 5 星评价     ](https://wordpress.org/support/plugin/dark-mode-toggle-block/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/dark-mode-toggle-block/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/dark-mode-toggle-block/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/dark-mode-toggle-block/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/dark-mode-toggle-block/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/dark-mode-toggle-block/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/dark-mode-toggle-block/reviews/)

## 贡献者

 *   [ Rich Tabor ](https://profiles.wordpress.org/richtabor/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/dark-mode-toggle-block/)