From d7a38152457f0683b97310c916fb773bac927688 Mon Sep 17 00:00:00 2001 From: Tammie Lister Date: Sat, 31 Aug 2024 10:54:12 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@58960 git-svn-id: http://core.svn.wordpress.org/trunk@58356 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../assets/css/editor-style-block-rtl.css | 21 +++++++------------ .../assets/css/editor-style-block.css | 21 +++++++------------ wp-content/themes/twentytwenty/style-rtl.css | 1 + wp-content/themes/twentytwenty/style.css | 1 + wp-includes/version.php | 2 +- 5 files changed, 19 insertions(+), 27 deletions(-) diff --git a/wp-content/themes/twentytwenty/assets/css/editor-style-block-rtl.css b/wp-content/themes/twentytwenty/assets/css/editor-style-block-rtl.css index 2d9099e0ca..9345b90a76 100644 --- a/wp-content/themes/twentytwenty/assets/css/editor-style-block-rtl.css +++ b/wp-content/themes/twentytwenty/assets/css/editor-style-block-rtl.css @@ -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; } @@ -336,6 +336,10 @@ padding: 1em; } +.editor-styles-wrapper pre code { + font-size: 1em; +} + /* Custom Text Sizes ------------------------- */ @@ -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; @@ -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 ------------------------------ */ @@ -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 { diff --git a/wp-content/themes/twentytwenty/assets/css/editor-style-block.css b/wp-content/themes/twentytwenty/assets/css/editor-style-block.css index 38b7521ad8..0619a1a2dd 100644 --- a/wp-content/themes/twentytwenty/assets/css/editor-style-block.css +++ b/wp-content/themes/twentytwenty/assets/css/editor-style-block.css @@ -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; } @@ -340,6 +340,10 @@ padding: 1em; } +.editor-styles-wrapper pre code { + font-size: 1em; +} + /* Custom Text Sizes ------------------------- */ @@ -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; @@ -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 ------------------------------ */ @@ -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 { diff --git a/wp-content/themes/twentytwenty/style-rtl.css b/wp-content/themes/twentytwenty/style-rtl.css index ff1ee06e72..8669ebf278 100644 --- a/wp-content/themes/twentytwenty/style-rtl.css +++ b/wp-content/themes/twentytwenty/style-rtl.css @@ -595,6 +595,7 @@ pre { pre code { background: transparent; + font-size: 1em; padding: 0; } diff --git a/wp-content/themes/twentytwenty/style.css b/wp-content/themes/twentytwenty/style.css index d2ed0ac34a..34021d7719 100644 --- a/wp-content/themes/twentytwenty/style.css +++ b/wp-content/themes/twentytwenty/style.css @@ -599,6 +599,7 @@ pre { pre code { background: transparent; + font-size: 1em; padding: 0; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 2a0d51d350..2f71dce929 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-58959'; +$wp_version = '6.7-alpha-58960'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.