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

Improve button block styles and wrap. #12205

Merged
merged 1 commit into from
Nov 23, 2018
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
15 changes: 6 additions & 9 deletions packages/block-library/src/button/editor.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
$blocks-button__line-height: $big-font-size + 6px;

.editor-block-list__block[data-type="core/button"] {
&[data-align="center"] {
text-align: center;
Expand All @@ -18,7 +16,6 @@ $blocks-button__line-height: $big-font-size + 6px;

.editor-rich-text__tinymce.mce-content-body {
cursor: text;
line-height: $blocks-button__line-height;
}

// Make placeholder text white unless custom colors or outline versions are chosen.
Expand All @@ -31,15 +28,15 @@ $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%;

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

.wp-block-button__link {
max-width: 100%;
overflow: hidden;
Expand All @@ -58,7 +55,7 @@ $blocks-button__line-height: $big-font-size + 6px;
font-size: $default-font-size;
line-height: $default-line-height;

// the width of input box plus padding plus two icon buttons.
// The width of input box plus padding plus two icon buttons.
$blocks-button__link-input-width: 300px + 2px + 2 * $icon-button-size;
width: $blocks-button__link-input-width;

Expand Down
8 changes: 3 additions & 5 deletions packages/block-library/src/button/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
$blocks-button__height: 46px;
$blocks-button__line-height: $big-font-size + 6px;
$blocks-button__height: 56px;

.wp-block-button {
color: $white;
Expand All @@ -24,13 +23,12 @@ $blocks-button__line-height: $big-font-size + 6px;
cursor: pointer;
display: inline-block;
font-size: $big-font-size;
line-height: $blocks-button__line-height;
margin: 0;
padding: ($blocks-button__height - $blocks-button__line-height) / 2 24px;
padding: 12px 24px;
text-align: center;
text-decoration: none;
white-space: normal;
word-break: break-all;
overflow-wrap: break-word;

&:hover,
&:focus,
Expand Down
3 changes: 2 additions & 1 deletion packages/editor/src/components/block-switcher/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
}

.components-popover:not(.is-mobile).editor-block-switcher__popover .components-popover__content {
min-width: 320px;
min-width: 300px;
max-width: 340px;
}

.editor-block-switcher__popover .components-popover__content {
Expand Down