From 858c479bb0dbbdab37d984a56ac4a0fbd6fc683a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ella=20van=C2=A0Durpe?= Date: Fri, 12 Apr 2019 18:25:49 +0200 Subject: [PATCH] Button Block: fix space insertion (#14925) * Button Block: fix space insertion * Typo * Allow rule for preview --- packages/block-editor/src/components/rich-text/style.scss | 2 +- packages/block-library/src/button/editor.scss | 6 +++++- packages/block-library/src/button/style.scss | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/block-editor/src/components/rich-text/style.scss b/packages/block-editor/src/components/rich-text/style.scss index 5a2e7155e5800..cae87d5129b83 100644 --- a/packages/block-editor/src/components/rich-text/style.scss +++ b/packages/block-editor/src/components/rich-text/style.scss @@ -15,7 +15,7 @@ // breaking spaces in between words. If also prevent Firefox from inserting // a trailing `br` node to visualise any trailing space, causing the element // to be saved. - white-space: pre-wrap; + white-space: pre-wrap !important; > p:first-child { margin-top: 0; diff --git a/packages/block-library/src/button/editor.scss b/packages/block-library/src/button/editor.scss index 713e508bef055..1b8a089ba6789 100644 --- a/packages/block-library/src/button/editor.scss +++ b/packages/block-library/src/button/editor.scss @@ -40,7 +40,11 @@ .wp-block-button__link { max-width: 100%; overflow: hidden; - white-space: nowrap; + // Override is allowed here only because the rich text instance in + // a preview is not editable. + // To do: use the `save` function to preview a block transform, not + // the `edit` function. + white-space: nowrap !important; text-overflow: ellipsis; } } diff --git a/packages/block-library/src/button/style.scss b/packages/block-library/src/button/style.scss index 9fb53733a2d13..a9006f488d5e7 100644 --- a/packages/block-library/src/button/style.scss +++ b/packages/block-library/src/button/style.scss @@ -27,7 +27,6 @@ $blocks-button__height: 56px; padding: 12px 24px; text-align: center; text-decoration: none; - white-space: normal; overflow-wrap: break-word; &:hover,