Skip to content

Commit

Permalink
Fix small visual regression with button variation preview. (#12051)
Browse files Browse the repository at this point in the history
In https://github.com/WordPress/gutenberg/pull/11757/files#diff-9bc45fdf28d434e26e152546f25fd08eR101, a change was introduced to how custom placeholder text works.

Custom placeholder text is basically a duplicate version of the text, which holds the visual placeholder. The height change as linked above was added to make sure the two elements are in sync, height-wise. Which is important for when the placeholder text wraps.

The Button styles this placeholder directly, which means it changes things sligtly in this regard. The long term solution would be to refactor this slightly, so that we don't style this placeholder, but instead style a parent element in the editor. But in the mean time, this PR fixes the current markup and CSS.
  • Loading branch information
jasmussen authored Nov 19, 2018
1 parent 3726c56 commit 8585f15
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/block-library/src/button/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ $blocks-button__line-height: $big-font-size + 6px;
opacity: 0.8;
}

// Polish the empty placeholder text for the button in variation previews.
.editor-rich-text__tinymce[data-is-placeholder-visible="true"] {
height: auto;
}

// Don't let the placeholder text wrap in the variation preview.
.editor-block-preview__content & {
max-width: 100%;
Expand Down

0 comments on commit 8585f15

Please sign in to comment.