Make WordPress Core

Changeset 52550


Ignore:
Timestamp:
01/10/2022 06:31:11 PM (5 years ago)
Author:
jorgefilipecosta
Message:

Fix: Update some default presets in use by default themes to the new format.

Themes that use the same preset slugs as WordPress uses need to be updated.
From the devnote https://make.wordpress.org/core/2022/01/08/updates-for-settings-styles-and-theme-json/
The CSS for some of the presets defined by WordPress (font sizes, colors, and gradients) was loaded twice for most themes in WordPress 5.8: in the block-library stylesheet plus in the global stylesheet. Additionally, there were slight differences in the CSS in both places.
In WordPress 5.9 those were consolidated into a single place, the global stylesheet whose name is global-styles-inline-css that is now loaded for all themes in the front-end.
For themes to override the default values they can use the theme.json and provide the same slug. Themes that do not use a theme.json can still override the default values by enqueuing some CSS that sets the corresponding CSS Custom Property. This commit does the second for the twenty twenty theme.

Props oandregal.
Merges [52549] to the 5.9 branch.
Fixes #54782.

Location:
branches/5.9
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/5.9

  • branches/5.9/src/wp-content/themes/twentytwenty/assets/css/editor-style-block-rtl.css

    r52271 r52550  
    352352
    353353.editor-styles-wrapper p.has-small-font-size {
    354         font-size: 0.842em;
     354        --wp--preset--font-size--small: 0.842em;
    355355}
    356356
    357357.editor-styles-wrapper p.has-normal-font-size,
    358358.editor-styles-wrapper p.has-regular-font-size {
    359         font-size: 1em;
     359        --wp--preset--font-size--normal: 1em;
    360360}
    361361
    362362.editor-styles-wrapper p.has-medium-font-size {
    363         font-size: 1.1em;
     363        --wp--preset--font-size--medium: 1.1em;
    364364}
    365365
    366366.editor-styles-wrapper p.has-large-font-size {
    367         font-size: 1.25em;
     367        --wp--preset--font-size--large: 1.25em;
    368368}
    369369
  • branches/5.9/src/wp-content/themes/twentytwenty/assets/css/editor-style-block.css

    r52271 r52550  
    207207
    208208.has-black-background-color {
    209         background-color: #000;
     209        --wp--preset--color--black: #000;
    210210        color: #fff;
    211211}
    212212
    213213.has-white-background-color {
    214         background-color: #fff;
     214        --wp--preset--color--white: #fff;
    215215        color: #000;
    216216}
    217217
    218218.has-black-color {
    219         color: #000;
     219        --wp--preset--color--black: #000;
    220220}
    221221
    222222.has-white-color {
    223         color: #fff;
     223        --wp--preset--color--white: #fff;
    224224}
    225225
     
    352352
    353353.editor-styles-wrapper p.has-small-font-size {
    354         font-size: 0.842em;
     354        --wp--preset--font-size--small: 0.842em;
    355355}
    356356
    357357.editor-styles-wrapper p.has-normal-font-size,
    358358.editor-styles-wrapper p.has-regular-font-size {
    359         font-size: 1em;
     359        --wp--preset--font-size--normal: 1em;
    360360}
    361361
    362362.editor-styles-wrapper p.has-medium-font-size {
    363         font-size: 1.1em;
     363        --wp--preset--font-size--medium: 1.1em;
    364364}
    365365
    366366.editor-styles-wrapper p.has-large-font-size {
    367         font-size: 1.25em;
     367        --wp--preset--font-size--large: 1.25em;
    368368}
    369369
  • branches/5.9/src/wp-content/themes/twentytwenty/style-rtl.css

    r52221 r52550  
    28372837
    28382838.entry-content .has-small-font-size {
    2839         font-size: 0.842em;
     2839        --wp--preset--font-size--small: 0.842em;
    28402840}
    28412841
    28422842.entry-content .has-normal-font-size,
    28432843.entry-content .has-regular-font-size {
    2844         font-size: 1em;
     2844        --wp--preset--font-size--normal: 1em;
    28452845}
    28462846
    28472847.entry-content .has-medium-font-size {
    2848         font-size: 1.1em;
     2848        --wp--preset--font-size--medium: 1.1em;
    28492849        line-height: 1.45;
    28502850}
    28512851
    28522852.entry-content .has-large-font-size {
    2853         font-size: 1.25em;
     2853        --wp--preset--font-size--large: 1.25em;
    28542854        line-height: 1.4;
    28552855}
  • branches/5.9/src/wp-content/themes/twentytwenty/style.css

    r52221 r52550  
    28552855
    28562856.entry-content .has-small-font-size {
    2857         font-size: 0.842em;
     2857        --wp--preset--font-size--small: 0.842em;
    28582858}
    28592859
    28602860.entry-content .has-normal-font-size,
    28612861.entry-content .has-regular-font-size {
    2862         font-size: 1em;
     2862        --wp--preset--font-size--normal: 1em;
    28632863}
    28642864
    28652865.entry-content .has-medium-font-size {
    2866         font-size: 1.1em;
     2866        --wp--preset--font-size--medium: 1.1em;
    28672867        line-height: 1.45;
    28682868}
    28692869
    28702870.entry-content .has-large-font-size {
    2871         font-size: 1.25em;
     2871        --wp--preset--font-size--large: 1.25em;
    28722872        line-height: 1.4;
    28732873}
Note: See TracChangeset for help on using the changeset viewer.