Make WordPress Core


Ignore:
Timestamp:
02/26/2024 04:25:28 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Twenty Nineteen: Further adjust CSS selectors used to change the primary color.

This aims to make the file, button, quote, pullquote, and search block selectors work on multiple WordPress versions.

Follow-up to [57637].

Props poena, mukesh27.
Fixes #59922.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentynineteen/inc/color-patterns.php

    r57637 r57712  
    213213                 * - blockquote
    214214                 * - pullquote (solid color)
    215                  * - buttons
     215                 * - buttons, including buttons in the file and search blocks.
    216216                 */
    217217                .editor-styles-wrapper .wp-block a,
    218                 .editor-styles-wrapper .wp-block .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color),
    219                 .editor-styles-wrapper .wp-block .wp-block-button.is-style-outline:hover .wp-block-button__link:not(.has-text-color),
    220                 .editor-styles-wrapper .wp-block .wp-block-button.is-style-outline:focus .wp-block-button__link:not(.has-text-color),
    221                 .editor-styles-wrapper .wp-block .wp-block-button.is-style-outline:active .wp-block-button__link:not(.has-text-color),
    222                 .editor-styles-wrapper .wp-block .wp-block-file .wp-block-file__textlink {
     218                .editor-styles-wrapper .wp-block .wp-block-file .wp-block-file__textlink, /* Before 5.8 */
     219                .editor-styles-wrapper .wp-block .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color), /* Before 5.8 */
     220                .editor-styles-wrapper .wp-block.wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color),
     221                /* Before 5.8, the following hover style is needed to override the default color when the block is selected. */
     222                .editor-styles-wrapper .wp-block .wp-block-button.is-style-outline:hover .wp-block-button__link:not(.has-text-color) {
    223223                        color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
    224224                }
    225225
    226226                .editor-styles-wrapper .wp-block.wp-block-quote:not(.is-large):not(.is-style-large),
    227                 .editor-styles-wrapper .wp-block .wp-block-freeform blockquote {
     227                .editor-styles-wrapper .wp-block .wp-block-freeform blockquote, /* Before 5.8 */
     228                .editor-styles-wrapper .wp-block.wp-block-freeform blockquote {
    228229                        border-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
    229230                }
    230231
    231                 .editor-styles-wrapper .wp-block.wp-block-pullquote.is-style-solid-color:not(.has-background-color) {
    232                         background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
    233                 }
    234 
     232                /* Pullquote: The solid color variation was removed in 5.9, the CSS is kept for backwards compatibility. */
     233                .editor-styles-wrapper .wp-block .wp-block-pullquote.is-style-solid-color:not(.has-background-color), /* Before 5.8 */
     234                .editor-styles-wrapper .wp-block.wp-block-pullquote.is-style-solid-color:not(.has-background-color),
     235                .editor-styles-wrapper .wp-block .wp-block-file .wp-block-file__button, /* Before 5.8, and when the block is aligned. */
    235236                .editor-styles-wrapper .wp-block.wp-block-file .wp-block-file__button,
    236237                .editor-styles-wrapper .wp-block .wp-block-button:not(.is-style-outline) .wp-block-button__link,
    237                 .editor-styles-wrapper .wp-block .wp-block-button:not(.is-style-outline) .wp-block-button__link:active,
    238                 .editor-styles-wrapper .wp-block .wp-block-button:not(.is-style-outline) .wp-block-button__link:focus,
    239                 .editor-styles-wrapper .wp-block .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
     238                .editor-styles-wrapper .wp-block .wp-block-search .wp-block-search__button, /* Before 5.8, and when the block is aligned. */
     239                .editor-styles-wrapper .wp-block.wp-block-search .wp-block-search__button {
    240240                        background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
    241241                }
    242242
    243                 /* Hover colors */
     243                /* Link hover colors */
    244244                .editor-styles-wrapper .wp-block a:hover,
    245245                .editor-styles-wrapper .wp-block a:active,
    … …  
    249249
    250250                /* Do not overwrite solid color pullquote or cover links */
     251                .editor-styles-wrapper .wp-block .wp-block-pullquote.is-style-solid-color a,  /* Before 5.8 */
    251252                .editor-styles-wrapper .wp-block.wp-block-pullquote.is-style-solid-color a,
    252253                .editor-styles-wrapper .wp-block.wp-block-cover a {
Note: See TracChangeset for help on using the changeset viewer.