From e0eaef3fc7d469e4eb446d13a2cbcc5d0a4a8465 Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Thu, 26 Nov 2020 11:47:30 +0000 Subject: [PATCH] Add support for font sizes in the code block --- packages/block-library/src/code/block.json | 3 ++- packages/block-library/src/code/style.scss | 10 +++++++--- packages/block-library/src/code/theme.scss | 1 - 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/block-library/src/code/block.json b/packages/block-library/src/code/block.json index d9f37ed061f80..e6a0c94e51ba3 100644 --- a/packages/block-library/src/code/block.json +++ b/packages/block-library/src/code/block.json @@ -10,6 +10,7 @@ } }, "supports": { - "anchor": true + "anchor": true, + "fontSize": true } } diff --git a/packages/block-library/src/code/style.scss b/packages/block-library/src/code/style.scss index 3961cfbe8e7d9..8d7a74d1471b4 100644 --- a/packages/block-library/src/code/style.scss +++ b/packages/block-library/src/code/style.scss @@ -1,5 +1,9 @@ // Provide a minimum of overflow handling. -.wp-block-code code { - white-space: pre-wrap; - overflow-wrap: break-word; +.wp-block-code { + font-size: var(--wp--preset--font-size--extra-small, 0.9em); + + code { + white-space: pre-wrap; + overflow-wrap: break-word; + } } diff --git a/packages/block-library/src/code/theme.scss b/packages/block-library/src/code/theme.scss index be1469328db3d..4dfc5a41a988e 100644 --- a/packages/block-library/src/code/theme.scss +++ b/packages/block-library/src/code/theme.scss @@ -1,6 +1,5 @@ .wp-block-code { font-family: $editor-html-font; - font-size: 0.9em; color: $gray-900; padding: 0.8em 1em; border: 1px solid $gray-300;