Skip to content

Commit

Permalink
Fix issue with tertiary button hit areas (WordPress#10888)
Browse files Browse the repository at this point in the history
* Fix issue with tertiary button hit areas

This addressed feedback in WordPress#10552 (comment).

It makes the tertiary button style be born with the same hit area as a button, because it is intended to be used as such, just with a different styling.

* Address feedback.

* Clarify comment.
  • Loading branch information
jasmussen authored and antpb committed Oct 26, 2018
1 parent 6bd27d0 commit 6d66009
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 15 deletions.
7 changes: 6 additions & 1 deletion packages/components/src/button/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
height: 28px;
border-radius: 3px;
white-space: nowrap;
border-width: 1px;
border-width: $border-width;
border-style: solid;
}

Expand Down Expand Up @@ -196,6 +196,11 @@
&.is-tertiary {
color: theme(outlines);

// Matches default button in hit area. See line 11.
padding: 0 10px;
line-height: 26px;
height: 28px;

.dashicon {
display: inline-block;
flex: 0 0 auto;
Expand Down
19 changes: 18 additions & 1 deletion packages/edit-post/src/components/header/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,31 @@
background: $dark-gray-500;
}

// Make editor header bar buttons bigger to match IconButtons.
&.editor-post-save-draft,
&.editor-post-switch-to-draft,
&.editor-post-preview,
&.editor-post-publish-button,
&.editor-post-publish-panel__toggle {
margin: 2px;
height: 33px;
line-height: 32px;
padding: 0 5px 2px;
font-size: $default-font-size;
}

&.editor-post-save-draft,
&.editor-post-switch-to-draft {
padding: 0 5px;

@include break-small() {
padding: 0 12px;
}
}

&.editor-post-preview,
&.editor-post-publish-button,
&.editor-post-publish-panel__toggle {
padding: 0 5px 2px;

@include break-small() {
padding: 0 12px 2px;
Expand Down
22 changes: 9 additions & 13 deletions packages/editor/src/components/post-saved-state/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,28 @@

.editor-post-saved-state {
width: $icon-button-size - 8px;

@include break-small() {
width: auto;
}
}

.editor-post-saved-state,
.editor-post-save-draft {
white-space: nowrap;
padding: 8px 4px;
padding: #{ $grid-size-small * 3 } $grid-size-small;

.dashicon {
margin-right: 8px;
margin-right: $grid-size;
}

@include break-small() {
padding: 8px;
width: auto;
padding: $grid-size #{ $grid-size-small * 3 };
text-indent: inherit;

.dashicon {
margin-right: 4px;
margin-right: $grid-size-small;
}
}
}

.editor-post-save-draft {
// This needs specificity to override inherited styles.
.edit-post-header .edit-post-header__settings .components-button.editor-post-save-draft {
margin: 0;

@include break-small() {
.dashicon {
display: none;
Expand Down

0 comments on commit 6d66009

Please sign in to comment.