Make WordPress Core

Changeset 65801


Ignore:
Timestamp:
11/26/2026 02:23:43 PM (4 days ago)
Author:
wildworks
Message:

Twenty Twenty-One: Keep button text visible on custom backgrounds.

Buttons in the Search, File, and Button blocks, and plain buttons, now keep readable text when placed inside a block with a custom background color.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13707

Follow-up to [49987].

Props dhruvang21, rishabhwp, sabernhardt, sourav08, wildworks.
Fixes #63245.

Location:
trunk/src/wp-content/themes/twentytwentyone
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwentyone/assets/css/style-editor.css

    r61490 r65801  
    543543
    544544.has-background .wp-block-button__link:not(:hover):not(:active):not(.has-text-color) {
    545         color: var(--local--color-background, var(--global--color-primary));
     545        color: var(--local--color-background, var(--global--color-background));
    546546}
    547547
    … …  
    886886
    887887.has-background .wp-block-file .wp-block-file__button:not(:hover):not(:active):not(.has-text-color) {
    888         color: var(--local--color-background, var(--global--color-primary));
     888        color: var(--local--color-background, var(--global--color-background));
    889889}
    890890
    … …  
    18911891
    18921892.has-background .wp-block-search .wp-block-search__button.wp-block-search__button:not(:hover):not(:active):not(.has-text-color) {
    1893         color: var(--local--color-background, var(--global--color-primary));
     1893        color: var(--local--color-background, var(--global--color-background));
    18941894}
    18951895
  • trunk/src/wp-content/themes/twentytwentyone/assets/sass/02-tools/mixins.scss

    r50972 r65801  
    4040                        // Nested
    4141                        .has-background & {
    42                                 color: var(--local--color-background, var(--global--color-primary));
     42                                color: var(--local--color-background, var(--global--color-background));
    4343
    4444                                &.has-background {
  • trunk/src/wp-content/themes/twentytwentyone/style-rtl.css

    r63211 r65801  
    16741674.has-background .wp-block-button .wp-block-button__link:not(:hover):not(:active):not(.has-text-color),
    16751675.has-background .wp-block-file a.wp-block-file__button:not(:hover):not(:active):not(.has-text-color) {
    1676         color: var(--local--color-background, var(--global--color-primary));
     1676        color: var(--local--color-background, var(--global--color-background));
    16771677}
    16781678
  • trunk/src/wp-content/themes/twentytwentyone/style.css

    r63211 r65801  
    16841684.has-background .wp-block-button .wp-block-button__link:not(:hover):not(:active):not(.has-text-color),
    16851685.has-background .wp-block-file a.wp-block-file__button:not(:hover):not(:active):not(.has-text-color) {
    1686         color: var(--local--color-background, var(--global--color-primary));
     1686        color: var(--local--color-background, var(--global--color-background));
    16871687}
    16881688
Note: See TracChangeset for help on using the changeset viewer.