Linux 软件免费装

Dark Mode for WP Dashboard

开发者 naiches
更新时间 2026年9月23日 20:02
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

dashboard accessibility admin theme dark mode night mode

下载

1.0.4 1.0.5 1.0.6 1.2.0 1.1.0 1.1.2 1.0.1 1.0.7 1.1.1 1.1.3 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.0.0 1.3.3 1.3.4 1.3.2 1.3.5 1.3.6 1.3.7 1.0.2 1.3.9 1.0.3 1.3.10

详情介绍:

No settings page, no bloat — just activate and go. Dark mode for every corner of your WordPress admin. Supported plugins: The plugin adds a dark-mode class to the admin body when active, and provides three filters for customization:

安装:

  1. Upload the plugin package to the plugins directory.
  2. Activate the plugin.
  3. Done! Your WordPress dashboard is now in dark mode :)
Use the toggle in the admin bar to switch between dark and light mode instantly. You can also set your preference to Auto in your user profile to follow your system's dark mode setting.

屏幕截图:

  • Plugins
  • Pages

常见问题:

How do I add my own CSS to the admin?

Don't edit the files inside the plugin — an update overwrites them. And dark_mode_dashboard_css is not the filter for this: it replaces the plugin's admin stylesheet rather than adding to it, and it does not reach the post editor's content area, which is a separate stylesheet. To add rules of your own, enqueue your own stylesheet from your theme's functions.php: add_action( 'admin_enqueue_scripts', function () { wp_enqueue_style( 'my-admin-tweaks', get_stylesheet_directory_uri() . '/admin-tweaks.css', array( 'dark-mode-dashboard' ), '1.0' ); } ); Naming dark-mode-dashboard as a dependency makes your file load after the plugin's, so your rules win without needing !important. Note that a dependency also pulls the plugin's stylesheet in for users who have dark mode switched off, who would otherwise download almost nothing. If that matters to you, drop the dependency and hook in at a later priority instead: add_action( 'admin_enqueue_scripts', function () { wp_enqueue_style( 'my-admin-tweaks', get_stylesheet_directory_uri() . '/admin-tweaks.css', array(), '1.0' ); }, 20 );

How do I change the font or size in the post editor?

The post content renders inside an iframe, and only styles enqueued on enqueue_block_assets are carried into it: add_action( 'enqueue_block_assets', function () { if ( ! is_admin() ) { return; } wp_enqueue_style( 'my-editor-fonts', get_stylesheet_directory_uri() . '/editor-fonts.css', array(), '1.0' ); } ); One thing catches people out. Inside that iframe the body element is itself the .editor-styles-wrapper element — not its parent. So write the selector as a single compound with no space between the two classes: body.editor-styles-wrapper p { font: 22px/1.5 Georgia, serif; } Written as body.dark-mode .editor-styles-wrapper p, with a space, it looks for a wrapper nested inside the body, finds nothing, and silently does nothing. Use body.dark-mode.editor-styles-wrapper p to apply a rule in dark mode only, or leave .dark-mode out to apply it in both modes.

Which class does the plugin add?

dark-mode on the admin body when dark mode is on, and dark-mode-auto when the preference is Auto. Auto deliberately does not also get dark-mode, so that it can follow the operating system.

更新日志:

1.3.10 1.3.9 1.3.8 1.3.7 1.3.6 1.3.5 1.3.4 1.3.3 1.3.2 1.3.1 1.3.0 1.2.4 1.2.3 1.2.2 1.2.1 1.2.0 1.1.3 1.1.2 1.1.1 1.1.0 1.0.7 1.0.6 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 1.0.0