Skip to content

Commit bc09d6a

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@58960 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 4486c0a commit bc09d6a

File tree

4 files changed

+18
-26
lines changed

4 files changed

+18
-26
lines changed

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

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@
325325
.editor-styles-wrapper pre,
326326
.editor-styles-wrapper samp {
327327
border-radius: 0;
328-
font-size: 0.75em;
328+
font-size: 0.9em;
329329
padding: 4px 6px;
330330
}
331331

@@ -336,6 +336,10 @@
336336
padding: 1em;
337337
}
338338

339+
.editor-styles-wrapper pre code {
340+
font-size: 1em;
341+
}
342+
339343

340344
/* Custom Text Sizes ------------------------- */
341345

@@ -715,9 +719,8 @@ hr.wp-block-separator.is-style-dots::before {
715719
color: inherit;
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;
723726
padding: 30px;
@@ -730,7 +733,7 @@ hr.wp-block-separator.is-style-dots::before {
730733
background: transparent;
731734
color: inherit;
732735
font-family: monospace;
733-
font-size: 14px;
736+
font-size: 16px;
734737
}
735738

736739
/* Block: Cover ------------------------------ */
@@ -1337,14 +1340,6 @@ hr.wp-block-separator.is-style-dots::before {
13371340
font-size: 17px;
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

13501345
.wp-block-column {

src/wp-content/themes/twentytwenty/assets/css/editor-style-block.css

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@
329329
.editor-styles-wrapper pre,
330330
.editor-styles-wrapper samp {
331331
border-radius: 0;
332-
font-size: 0.75em;
332+
font-size: 0.9em;
333333
padding: 4px 6px;
334334
}
335335

@@ -340,6 +340,10 @@
340340
padding: 1em;
341341
}
342342

343+
.editor-styles-wrapper pre code {
344+
font-size: 1em;
345+
}
346+
343347

344348
/* Custom Text Sizes ------------------------- */
345349

@@ -719,9 +723,8 @@ hr.wp-block-separator.is-style-dots::before {
719723
color: inherit;
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;
727730
padding: 30px;
@@ -734,7 +737,7 @@ hr.wp-block-separator.is-style-dots::before {
734737
background: transparent;
735738
color: inherit;
736739
font-family: monospace;
737-
font-size: 14px;
740+
font-size: 16px;
738741
}
739742

740743
/* Block: Cover ------------------------------ */
@@ -1341,14 +1344,6 @@ hr.wp-block-separator.is-style-dots::before {
13411344
font-size: 17px;
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

13541349
.wp-block-column {

src/wp-content/themes/twentytwenty/style-rtl.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ pre {
595595

596596
pre code {
597597
background: transparent;
598+
font-size: 1em;
598599
padding: 0;
599600
}
600601

src/wp-content/themes/twentytwenty/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ pre {
599599

600600
pre code {
601601
background: transparent;
602+
font-size: 1em;
602603
padding: 0;
603604
}
604605

0 commit comments

Comments
 (0)