Make WordPress Core


Ignore:
Timestamp:
02/13/2024 09:22:35 PM (2 years ago)
Author:
hellofromTonya
Message:

Bundled Themes: Support pullquote block typography options in Twenty Twenty-One.

Pullquotes were not inheriting the correct styling from the block
editor. This commit resolves the issue by supporting typography options.

  1. The font-family variable remains on the paragraph (both editor and front) so the citation continues to use the body font even when the site redefines var(--pullquote--font-family).
  1. The font-size, font-style, font-weight, letter-spacing and line-height are set on the Pullquote block to allow overriding with the sidebar settings. Then the block's paragraph element inherits those styles.
  1. When the settings do not give a custom line-height from the sidebar, these stylesheets set the paragraph to var(--pullquote--line-height) instead of inheriting 1.6 from the block styles. This patch uses :where() to avoid increasing specificity.

Moving styles from the paragraph element to the block should not affect the citation, which has had its own styles for font-size, font-style, font-weight and letter-spacing.

Follow-up to [56959], [56451], [55089], [55088], [49574], [49320], [49216].

Props sabernhardt, poena, darshitrajyaguru97, harshgajipara, shailu25, skyakash12.
Fixes #57854.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwentyone/assets/sass/05-blocks/pullquote/_style.scss

    r56959 r57631  
    88    border-color: currentColor;
    99    position: relative;
     10    font-size: var(--pullquote--font-size);
     11    font-style: var(--pullquote--font-style);
     12    font-weight: 700;
     13    letter-spacing: var(--pullquote--letter-spacing);
    1014
    1115    blockquote::before {
     
    2226    p {
    2327        font-family: var(--pullquote--font-family);
    24         font-size: var(--pullquote--font-size);
    25         font-style: var(--pullquote--font-style);
    26         font-weight: 700;
    27         letter-spacing: var(--pullquote--letter-spacing);
     28        font-size: inherit;
     29        font-style: inherit;
     30        font-weight: inherit;
     31        letter-spacing: inherit;
     32        line-height: inherit;
     33        margin: 0;
     34    }
     35
     36    &:where(:not([style*="line-height"])) p {
    2837        line-height: var(--pullquote--line-height);
    29         margin: 0;
    3038    }
    3139
Note: See TracChangeset for help on using the changeset viewer.