Make WordPress Core


Ignore:
Timestamp:
06/23/2024 02:36:37 PM (6 months ago)
Author:
karmatosed
Message:

Twenty Twenty-One: Fixes font size difference in latest comments block.

The font size was different in the last comments block depending on if it was in the editor or front. This resolves that by checking block for special font size before applying default and using inherit for nested elements.

Props pitamdey, sabernhardt.
Fixes #61082.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwentyone/assets/sass/05-blocks/latest-comments/_editor.scss

    r49574 r58464  
    11.wp-block-latest-comments {
    22    padding-left: 0;
     3
     4    &:where(:not([class*="-font-size"]):not([style*="font-size"])) .wp-block-latest-comments__comment {
     5        font-size: var(--global--font-size-sm);
     6    }
     7
     8    .wp-block-latest-comments__comment {
     9        line-height: var(--global--line-height-body);
     10
     11        /* Vertical margins logic */
     12        margin-top: var(--global--spacing-vertical);
     13        margin-bottom: var(--global--spacing-vertical);
     14
     15        &:first-child {
     16            margin-top: 0;
     17        }
     18
     19        &:last-child {
     20            margin-bottom: 0;
     21        }
     22    }
     23
     24    .wp-block-latest-comments__comment-meta {
     25        font-family: var(--heading--font-family);
     26    }
     27
     28    .wp-block-latest-comments__comment-date {
     29        color: inherit;
     30        font-size: inherit;
     31    }
     32
     33    .wp-block-latest-comments__comment-excerpt p {
     34        font-size: inherit;
     35        line-height: var(--global--line-height-body);
     36        margin: 0;
     37    }
    338}
Note: See TracChangeset for help on using the changeset viewer.