Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block Library - Quote: Fix the editor/frontend style parity. #30190

Merged
merged 5 commits into from
Mar 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/block-library/src/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/quote/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ export default function QuoteEdit( {
{ ( ! RichText.isEmpty( citation ) || isSelected ) && (
<RichText
identifier="citation"
tagName="cite"
style={ { display: 'block' } }
value={ citation }
onChange={ ( nextCitation ) =>
setAttributes( {
Expand Down
3 changes: 0 additions & 3 deletions packages/block-library/src/quote/editor.scss

This file was deleted.

4 changes: 1 addition & 3 deletions packages/block-library/src/quote/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 7 additions & 1 deletion packages/rich-text/src/component/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<string,string>}
*/
const defaultStyle = { whiteSpace };
const defaultStyle = { whiteSpace, minWidth };

const EMPTY_ACTIVE_FORMATS = [];

Expand Down