From 6d99f79062e1d61b172d197cdf33e505fa6b131a Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Wed, 24 Mar 2021 14:27:43 +0100 Subject: [PATCH 1/5] Quote block: Fix the editor/frontend style parity. --- packages/block-library/src/editor.scss | 1 - packages/block-library/src/quote/edit.js | 2 ++ packages/block-library/src/quote/editor.scss | 3 --- 3 files changed, 2 insertions(+), 4 deletions(-) delete mode 100644 packages/block-library/src/quote/editor.scss diff --git a/packages/block-library/src/editor.scss b/packages/block-library/src/editor.scss index 41234b75cca7ec..4a0e4cfa8932f9 100644 --- a/packages/block-library/src/editor.scss +++ b/packages/block-library/src/editor.scss @@ -32,7 +32,6 @@ @import "./post-excerpt/editor.scss"; @import "./post-author/editor.scss"; @import "./pullquote/editor.scss"; -@import "./quote/editor.scss"; @import "./rss/editor.scss"; @import "./search/editor.scss"; @import "./separator/editor.scss"; diff --git a/packages/block-library/src/quote/edit.js b/packages/block-library/src/quote/edit.js index bc94820b5fc661..b81f22be2fdc91 100644 --- a/packages/block-library/src/quote/edit.js +++ b/packages/block-library/src/quote/edit.js @@ -82,6 +82,8 @@ export default function QuoteEdit( { { ( ! RichText.isEmpty( citation ) || isSelected ) && ( setAttributes( { diff --git a/packages/block-library/src/quote/editor.scss b/packages/block-library/src/quote/editor.scss deleted file mode 100644 index 12455da81199b9..00000000000000 --- a/packages/block-library/src/quote/editor.scss +++ /dev/null @@ -1,3 +0,0 @@ -.wp-block-quote__citation { - font-size: $default-font-size; -} From f3f707e261b7f95b9c8c8976742b95a7cdf3da9d Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Wed, 24 Mar 2021 14:55:33 +0100 Subject: [PATCH 2/5] Fix inline style --- packages/block-library/src/quote/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/quote/edit.js b/packages/block-library/src/quote/edit.js index b81f22be2fdc91..22876ef2531be7 100644 --- a/packages/block-library/src/quote/edit.js +++ b/packages/block-library/src/quote/edit.js @@ -83,7 +83,7 @@ export default function QuoteEdit( { setAttributes( { From e822f65043055765bd0ed5657ac90756176e65be Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Wed, 24 Mar 2021 15:36:58 +0100 Subject: [PATCH 3/5] Remove useless margin top for the citation --- packages/block-library/src/quote/theme.scss | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/block-library/src/quote/theme.scss b/packages/block-library/src/quote/theme.scss index a980bbb373279d..46cfab55ce1938 100644 --- a/packages/block-library/src/quote/theme.scss +++ b/packages/block-library/src/quote/theme.scss @@ -4,11 +4,9 @@ padding-left: 1em; cite, - footer, - &__citation { + footer { color: currentColor; font-size: 0.8125em; - margin-top: 1em; position: relative; font-style: normal; } From b690b8fb27f3147c1f7a3c98e7b50f1780780961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ella=20van=C2=A0Durpe?= Date: Thu, 25 Mar 2021 10:32:48 +0200 Subject: [PATCH 4/5] RichText: add min width to show caret for empty inline container --- packages/rich-text/src/component/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/rich-text/src/component/index.js b/packages/rich-text/src/component/index.js index 6a14db55369d25..3451299e02b7cf 100644 --- a/packages/rich-text/src/component/index.js +++ b/packages/rich-text/src/component/index.js @@ -83,12 +83,18 @@ const INSERTION_INPUT_TYPES_TO_IGNORE = new Set( [ */ const whiteSpace = 'pre-wrap'; +/** + * A minimum width of 1px will prevent the rich text container from collapsing + * to 0 width and hiding the caret. This is useful for inline containers. + */ +const minWidth = '1px'; + /** * Default style object for the editable element. * * @type {Object} */ -const defaultStyle = { whiteSpace }; +const defaultStyle = { whiteSpace, minWidth }; const EMPTY_ACTIVE_FORMATS = []; From 5f55a5c34042ad6c8386584fff2e4352c360a67c Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Thu, 25 Mar 2021 09:42:12 +0100 Subject: [PATCH 5/5] Prefer display block to make the whole line focusable --- packages/block-library/src/quote/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/quote/edit.js b/packages/block-library/src/quote/edit.js index 22876ef2531be7..e4337960ad652e 100644 --- a/packages/block-library/src/quote/edit.js +++ b/packages/block-library/src/quote/edit.js @@ -83,7 +83,7 @@ export default function QuoteEdit( { setAttributes( {