You appear to be a bot. Output may be restricted
Description
Adds a class to the <body> element in the editor to accommodate dark-mode.
Usage
$string = Twenty_Twenty_One_Dark_Mode::admin_body_classes( $classes );
Parameters
- $classes
- ( string ) required – The admin body-classes.
Returns
string
Source
File name: twentytwentyone/classes/class-twenty-twenty-one-dark-mode.php
Lines:
1 to 21 of 21
public function admin_body_classes( $classes ) { if ( ! $this->switch_should_render() ) { return $classes; } global $current_screen; if ( empty( $current_screen ) ) { set_current_screen(); } if ( $current_screen->is_block_editor() ) { $should_respect_color_scheme = get_theme_mod( 'respect_user_color_preference', false ); $background_color = get_theme_mod( 'background_color', 'D1E4DD' ); if ( $should_respect_color_scheme && Twenty_Twenty_One_Custom_Colors::get_relative_luminance_from_hex( $background_color ) > 127 ) { $classes .= ' twentytwentyone-supports-dark-theme'; } } return $classes; }