Skip to content

Commit dd9a261

Browse files
committed
Customizer: Add admin color scheme class to body element.
This changeset injects a CSS class called `admin-color-{slug}` into the `body` element in the Customizer screen based on the admin color scheme setting. Props soyebsalar01, westonruter, wildworks. Fixes #64415. git-svn-id: https://develop.svn.wordpress.org/trunk@61385 602fd350-edb4-49c9-b593-d223f7449a82
1 parent d9c53e1 commit dd9a261

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/wp-admin/customize.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@
147147
$body_class .= ' rtl';
148148
}
149149
$body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
150+
$admin_color = get_user_option( 'admin_color' );
151+
$body_class .= ' admin-color-' . sanitize_html_class( is_string( $admin_color ) ? $admin_color : '', 'fresh' );
150152

151153
if ( wp_use_widgets_block_editor() ) {
152154
$body_class .= ' wp-embed-responsive';

0 commit comments

Comments
 (0)