Skip to content

Commit

Permalink
Twenty Twenty: Correct font-size for Code block and other preformatte…
Browse files Browse the repository at this point in the history
…d 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
  • Loading branch information
karmatosed committed Aug 31, 2024
1 parent 4486c0a commit bc09d6a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@
.editor-styles-wrapper pre,
.editor-styles-wrapper samp {
border-radius: 0;
font-size: 0.75em;
font-size: 0.9em;
padding: 4px 6px;
}

Expand All @@ -336,6 +336,10 @@
padding: 1em;
}

.editor-styles-wrapper pre code {
font-size: 1em;
}


/* Custom Text Sizes ------------------------- */

Expand Down Expand Up @@ -715,9 +719,8 @@ hr.wp-block-separator.is-style-dots::before {
color: inherit;
}

.editor-styles-wrapper .wp-block-code,
.editor-styles-wrapper .wp-block-preformatted pre,
.editor-styles-wrapper .wp-block-verse pre {
.editor-styles-wrapper pre,
.editor-styles-wrapper .wp-block-code {
border: 1px solid #dcd7ca;
border-radius: 0;
padding: 30px;
Expand All @@ -730,7 +733,7 @@ hr.wp-block-separator.is-style-dots::before {
background: transparent;
color: inherit;
font-family: monospace;
font-size: 14px;
font-size: 16px;
}

/* Block: Cover ------------------------------ */
Expand Down Expand Up @@ -1337,14 +1340,6 @@ hr.wp-block-separator.is-style-dots::before {
font-size: 17px;
}

/* BLOCK: CODE */

.editor-styles-wrapper .wp-block-preformatted pre,
.editor-styles-wrapper .wp-block-code .block-editor-plain-text,
.editor-styles-wrapper .wp-block-verse pre {
font-size: 16px;
}

/* BLOCK: COLUMNS */

.wp-block-column {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@
.editor-styles-wrapper pre,
.editor-styles-wrapper samp {
border-radius: 0;
font-size: 0.75em;
font-size: 0.9em;
padding: 4px 6px;
}

Expand All @@ -340,6 +340,10 @@
padding: 1em;
}

.editor-styles-wrapper pre code {
font-size: 1em;
}


/* Custom Text Sizes ------------------------- */

Expand Down Expand Up @@ -719,9 +723,8 @@ hr.wp-block-separator.is-style-dots::before {
color: inherit;
}

.editor-styles-wrapper .wp-block-code,
.editor-styles-wrapper .wp-block-preformatted pre,
.editor-styles-wrapper .wp-block-verse pre {
.editor-styles-wrapper pre,
.editor-styles-wrapper .wp-block-code {
border: 1px solid #dcd7ca;
border-radius: 0;
padding: 30px;
Expand All @@ -734,7 +737,7 @@ hr.wp-block-separator.is-style-dots::before {
background: transparent;
color: inherit;
font-family: monospace;
font-size: 14px;
font-size: 16px;
}

/* Block: Cover ------------------------------ */
Expand Down Expand Up @@ -1341,14 +1344,6 @@ hr.wp-block-separator.is-style-dots::before {
font-size: 17px;
}

/* BLOCK: CODE */

.editor-styles-wrapper .wp-block-preformatted pre,
.editor-styles-wrapper .wp-block-code .block-editor-plain-text,
.editor-styles-wrapper .wp-block-verse pre {
font-size: 16px;
}

/* BLOCK: COLUMNS */

.wp-block-column {
Expand Down
1 change: 1 addition & 0 deletions src/wp-content/themes/twentytwenty/style-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ pre {

pre code {
background: transparent;
font-size: 1em;
padding: 0;
}

Expand Down
1 change: 1 addition & 0 deletions src/wp-content/themes/twentytwenty/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ pre {

pre code {
background: transparent;
font-size: 1em;
padding: 0;
}

Expand Down

0 comments on commit bc09d6a

Please sign in to comment.