Huntsman Dark Mode Site Icon

外掛說明

Huntsman Dark Mode Site Icon allows you to set a separate site icon for light and dark mode.

Upload one icon for light mode using WordPress’s built-in Site Icon, and upload a separate icon for dark mode using this plugin. The appropriate icon is then displayed automatically based on the visitor’s system theme.

No code or configuration is required. If no dark mode icon is set, WordPress behaves exactly as normal.

Key Features

  • Separate site icons for light mode and dark mode
  • Simple upload interface in the WordPress admin
  • Works on the frontend, admin area, and login screen
  • Optional enable/disable toggle
  • Does not replace or override the core WordPress Site Icon
  • Accessable via the WP API

Usage

  • Site Icon (WordPress)
    This is the default WordPress Site Icon and is still managed by WordPress.

  • Dark Mode Site Icon
    This icon is only used when the user’s system is in dark mode and the browser supports prefers-color-scheme.

If the Dark Mode Site Icon is not set, the plugin does nothing and WordPress behaves normally.

REST API

The plugin exposes a public REST endpoint for accessing the Dark Mode Site Icon:

/wp-json/hdmsi/v1/icons

Example response:
{
“enabled”: true,
“dark”: {
“id”: 123,
“url”: “https://example.com/icon-dark.png”
}
}
A dark-mode Web App Manifest is also available at:

/wp-json/hdmsi/v1/manifest?mode=dark

螢幕擷圖

安裝方式

  1. Upload the huntsman-dark-mode-site-icon folder to the /wp-content/plugins/ directory, or install via the WordPress plugin uploader.
  2. Activate the plugin through the Plugins menu.
  3. Go to Settings Dark Mode Icon.
  4. Set your Dark Mode Site Icon.
  5. (Optional) Enable or disable output using the toggle.

常見問題集

Does this replace the WordPress Site Icon?

No. The WordPress Site Icon remains the default. This plugin only adds additional dark-mode-specific tags.

What happens if I don’t set a Dark Mode Site Icon?

Nothing. The plugin outputs no additional tags and WordPress behaves exactly as normal.

Does this work in wp-admin and on the login screen?

Yes. The plugin outputs dark-mode favicon tags in the frontend, admin area, and login screen.

Does this support SVG icons?

Yes, but SVG uploads may be blocked by default in WordPress. You may need an SVG upload plugin.

What browsers support dark-mode favicons?

Most modern browsers support including recent versions of Chrome, Edge, Firefox, and Safari, but support can vary by platform and OS. If a browser does not support dark mode icons, the default WordPress Site Icon is used.

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈Huntsman Dark Mode Site Icon〉的開發相關工作。

參與者

將〈Huntsman Dark Mode Site Icon〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.0.1

  • Uses the dark mode icon as the default fallback when no default or light mode icon is configured.
  • Tested with WordPress 7.0.

1.0.0

  • Initial release
  • Dark Mode Site Icon support
  • prefers-color-scheme favicon output
  • REST API and manifest support
  • Admin, login, and frontend compatibility