Make WordPress Core

Changeset 58960


Ignore:
Timestamp:
08/31/2024 10:52:04 AM (2 years ago)
Author:
karmatosed
Message:

Twenty Twenty: Correct font-size for Code block and other preformatted elements.

The code block font-size was not the same in the editor and front. This sets it to 1em and corrects the value for preformatted elements along with adding border and padding in the editor for pre elements.

Props viralsampat, mi5t4n, brobken, sabernhardt.
Fixes #61845.

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

Legend:

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

    r58908 r58960  
    326326.editor-styles-wrapper samp {
    327327        border-radius: 0;
    328         font-size: 0.75em;
     328        font-size: 0.9em;
    329329        padding: 4px 6px;
    330330}
     
    335335        line-height: 1.5;
    336336        padding: 1em;
     337}
     338
     339.editor-styles-wrapper pre code {
     340        font-size: 1em;
    337341}
    338342
     
    716720}
    717721
    718 .editor-styles-wrapper .wp-block-code,
    719 .editor-styles-wrapper .wp-block-preformatted pre,
    720 .editor-styles-wrapper .wp-block-verse pre {
     722.editor-styles-wrapper pre,
     723.editor-styles-wrapper .wp-block-code {
    721724        border: 1px solid #dcd7ca;
    722725        border-radius: 0;
     
    731734        color: inherit;
    732735        font-family: monospace;
    733         font-size: 14px;
     736        font-size: 16px;
    734737}
    735738
     
    13381341        }
    13391342
    1340         /* BLOCK: CODE */
    1341 
    1342         .editor-styles-wrapper .wp-block-preformatted pre,
    1343         .editor-styles-wrapper .wp-block-code .block-editor-plain-text,
    1344         .editor-styles-wrapper .wp-block-verse pre {
    1345                 font-size: 16px;
    1346         }
    1347 
    13481343        /* BLOCK: COLUMNS */
    13491344
  • trunk/src/wp-content/themes/twentytwenty/assets/css/editor-style-block.css

    r58908 r58960  
    330330.editor-styles-wrapper samp {
    331331        border-radius: 0;
    332         font-size: 0.75em;
     332        font-size: 0.9em;
    333333        padding: 4px 6px;
    334334}
     
    339339        line-height: 1.5;
    340340        padding: 1em;
     341}
     342
     343.editor-styles-wrapper pre code {
     344        font-size: 1em;
    341345}
    342346
     
    720724}
    721725
    722 .editor-styles-wrapper .wp-block-code,
    723 .editor-styles-wrapper .wp-block-preformatted pre,
    724 .editor-styles-wrapper .wp-block-verse pre {
     726.editor-styles-wrapper pre,
     727.editor-styles-wrapper .wp-block-code {
    725728        border: 1px solid #dcd7ca;
    726729        border-radius: 0;
     
    735738        color: inherit;
    736739        font-family: monospace;
    737         font-size: 14px;
     740        font-size: 16px;
    738741}
    739742
     
    13421345        }
    13431346
    1344         /* BLOCK: CODE */
    1345 
    1346         .editor-styles-wrapper .wp-block-preformatted pre,
    1347         .editor-styles-wrapper .wp-block-code .block-editor-plain-text,
    1348         .editor-styles-wrapper .wp-block-verse pre {
    1349                 font-size: 16px;
    1350         }
    1351 
    13521347        /* BLOCK: COLUMNS */
    13531348
  • trunk/src/wp-content/themes/twentytwenty/style-rtl.css

    r58909 r58960  
    596596pre code {
    597597        background: transparent;
     598        font-size: 1em;
    598599        padding: 0;
    599600}
  • trunk/src/wp-content/themes/twentytwenty/style.css

    r58909 r58960  
    600600pre code {
    601601        background: transparent;
     602        font-size: 1em;
    602603        padding: 0;
    603604}
Note: See TracChangeset for help on using the changeset viewer.