Skip to content

Commit

Permalink
Same appearance for rich text toolbar (captions)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joen Asmussen committed Feb 6, 2020
1 parent 9b7e71a commit 2f80724
Showing 1 changed file with 57 additions and 1 deletion.
58 changes: 57 additions & 1 deletion packages/block-editor/src/components/rich-text/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,67 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before

.components-popover__content {
min-width: auto;
margin-bottom: 6px;
margin-bottom: $grid-unit;
box-shadow: none;

// Block UI appearance.
border: $border-width solid $dark-gray-primary;
border-radius: $radius-block-ui;
background-color: $white;
}

.components-toolbar {
// The popover already provides a border.
border: none;
}

.components-toolbar__control,
.components-dropdown-menu__toggle {
min-width: $grid-unit-60;
min-height: $grid-unit-60;
padding-left: $grid-unit-15;
padding-right: $grid-unit-15;
}

// Size multiple sequential buttons to be optically balanced.
// Icons are 36px, as set by a 24px icon and 12px padding.
.components-toolbar div > .components-button.has-icon {
min-width: $block-toolbar-height - $grid-unit-15;
padding-left: $grid-unit-15 / 2; // 6px.
padding-right: $grid-unit-15 / 2;

svg {
min-width: $icon-button-size-small; // This is the optimal icon size, and we size the whole button after this.
}

&::before {
left: 2px;
right: 2px;
}
}

// First button in a group.
.components-toolbar div:first-child .components-button {
min-width: $block-toolbar-height - $grid-unit-15 / 2;
padding-left: $grid-unit-15 - $border-width;
padding-right: $grid-unit-15 / 2;

&::before {
left: $grid-unit-10;
right: 2px;
}
}

// Last button in a group.
.components-toolbar div:last-child .components-button {
min-width: $block-toolbar-height - $grid-unit-15 / 2;
padding-left: $grid-unit-15 / 2;
padding-right: $grid-unit-15 - $border-width;

&::before {
left: 2px;
right: $grid-unit-10;
}
}

}

0 comments on commit 2f80724

Please sign in to comment.