Make WordPress Core


Ignore:
Timestamp:
12/01/2020 07:25:43 PM (4 years ago)
Author:
desrosj
Message:

Twenty Twenty-One: Sync the latest changes for 5.6 RC2.

This will be the final sync from GitHub before placing that repository into read-only mode. All further changes should now flow entirely through Trac.

For a full list of changes since [49633], see https://github.com/WordPress/twentytwentyone/compare/1d5a895...53acd9b.

Props poena, luminuu, kjellr, ryelle, allancole, melchoyce, felipeelia, aljullu, kebbet, chaton666, Clorith, mkaz, ingereck, paaljoachim.
Reviewed by desrosj, SergeyBiryukov.
Merges [49726] to the 5.6 branch.
Fixes #51526.

Location:
branches/5.6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.6

  • branches/5.6/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-custom-colors.php

    r49574 r49728  
    169169    public function body_class( $classes ) {
    170170        $background_color = get_theme_mod( 'background_color', 'D1E4DD' );
    171         if ( 127 > self::get_relative_luminance_from_hex( $background_color ) ) {
     171        $luminance        = self::get_relative_luminance_from_hex( $background_color );
     172
     173        if ( 127 > $luminance ) {
    172174            $classes[] = 'is-dark-theme';
    173175        } else {
     
    175177        }
    176178
    177         if ( 'ffffff' === strtolower( $background_color ) ) {
     179        if ( 225 <= $luminance ) {
    178180            $classes[] = 'has-background-white';
    179181        }
Note: See TracChangeset for help on using the changeset viewer.