Make WordPress Core


Ignore:
Timestamp:
10/27/2020 01:58:37 AM (4 years ago)
Author:
desrosj
Message:

Twenty Twenty-One: Import the latest changes for 5.6 beta 2.

For a full list of changes since beta 1, see https://github.com/WordPress/twentytwentyone/compare/9e34dca...e580895.

Props poena, melchoyce, luminuu, aristath, justinahinon, jffng, ryelle, kishanjasani, rolfsiebers.
See #51526.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-custom-colors.php

    r49247 r49320  
    121121            wp_add_inline_style( 'twenty-twenty-one-custom-color-overrides', $this->generate_custom_color_variables( 'editor' ) );
    122122        }
    123 
    124         $should_respect_color_scheme = get_theme_mod( 'respect_user_color_preference', true ); // @phpstan-ignore-line. Passing true instead of default value of false to get_theme_mod.
    125         if ( $should_respect_color_scheme && self::get_relative_luminance_from_hex( $background_color ) > 127 ) {
    126             // Add dark mode variable overrides.
    127             wp_add_inline_style( 'twenty-twenty-one-custom-color-overrides', '@media (prefers-color-scheme: dark) { :root .editor-styles-wrapper { --global--color-background: var(--global--color-dark-gray); --global--color-primary: var(--global--color-light-gray); --global--color-secondary: var(--global--color-light-gray); } }' );
    128         }
    129123    }
    130124
     
    176170        $background_color = get_theme_mod( 'background_color', 'D1E4DD' );
    177171        if ( 127 > self::get_relative_luminance_from_hex( $background_color ) ) {
    178             $classes[] = 'is-background-dark';
     172            $classes[] = 'has-background-dark';
    179173        } else {
    180             $classes[] = 'is-background-light';
     174            $classes[] = 'has-background-light';
    181175        }
    182176
Note: See TracChangeset for help on using the changeset viewer.