WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/07/2019 10:36:58 PM (2 years ago)
Author:
allancole
Message:

Twenty Nineteen: Improve custom color behavior for InnerBlocks

Currently, if a parent block has a custom background color assigned, its child blocks will inherit the parent's text colors — even if the child block has its own custom text color assigned to it.

This update changes the following:

  • Adjusts Twenty Nineteen's custom background color defaults to target direct children only which fixes the issue

Props kjellr.

See #46432.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss

    r44739 r44818  
    839839        color: $color__background-body;
    840840
    841         p,
    842         h1,
    843         h2,
    844         h3,
    845         h4,
    846         h5,
    847         h6,
    848         a {
     841        > p,
     842        > h1,
     843        > h2,
     844        > h3,
     845        > h4,
     846        > h5,
     847        > h6,
     848        > a {
    849849            color: $color__background-body;
    850850        }
     
    855855
    856856        // Use dark gray text against this background by default.
    857         p,
    858         h1,
    859         h2,
    860         h3,
    861         h4,
    862         h5,
    863         h6,
    864         a {
     857        > p,
     858        > h1,
     859        > h2,
     860        > h3,
     861        > h4,
     862        > h5,
     863        > h6,
     864        > a {
    865865            color: $color__text-main;
    866866        }
     
    895895    .has-primary-color,
    896896    .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color,
    897     .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color p {
     897    .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color > p {
    898898        color: $color__link;
    899899    }
     
    901901    .has-secondary-color,
    902902    .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color,
    903     .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color p {
     903    .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color > p {
    904904        color: $color__border-link-hover;
    905905    }
     
    907907    .has-dark-gray-color,
    908908    .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color,
    909     .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color p {
     909    .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color > p {
    910910        color: $color__text-main;
    911911    }
     
    913913    .has-light-gray-color,
    914914    .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color,
    915     .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color p {
     915    .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color > p {
    916916        color: $color__text-light;
    917917    }
Note: See TracChangeset for help on using the changeset viewer.