| 开发者 | Milmor |
|---|---|
| 更新时间 | 2026年10月5日 18:00 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.0 及以上 |
| WordPress版本: | 7.2 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
prefers-color-scheme)browser_theme_color and browser_theme_color_darkbrowser-theme-color directory to the /wp-content/plugins/ directoryYou can set the color in the plugin settings screen (Settings -> Browser Theme Color), or via the "Settings" link in the plugins list.
Yes. Set the "Dark Mode Color" field: the plugin will output two theme-color tags with media="(prefers-color-scheme: light)" and media="(prefers-color-scheme: dark)". Leave it empty to use a single color.
Up to iOS 18, Safari uses the "theme-color" tag. Starting with iOS 26, Safari ignores it and tints its toolbars using the background color of your page or of fixed elements at the top and bottom edges (such as a fixed header). Version 2.0 adds two experimental options, "Tint the top bar" and "Tint the bottom bar" (Settings -> Browser Theme Color), disabled by default. They add a thin strip in your theme color at the top and/or bottom edge of the page, only on iOS Safari, so Safari can pick up the color. Apple does not document this behavior and may change it: if your theme has a fixed header Safari may use its color instead, so test it on a real iPhone. Tried it on an iPhone? Please share how it behaves (iOS version, theme, and whether the bars changed color) in the support forum: your feedback will help improve this feature.
Yes, use the filters:
add_filter( 'browser_theme_color', function( $color ) { return is_front_page() ? '#ff6600' : $color; } );
add_filter( 'browser_theme_color_dark', '__return_empty_string' );
prefers-color-scheme media queriesbrowser_theme_color and browser_theme_color_dark filters for developers<head>msapplication-navbutton-color (Windows Phone) and iOS web app meta tags (apple-mobile-web-app-capable, apple-mobile-web-app-status-bar-style), which no longer affect the browser color