Skip to content

Commit f0f168c

Browse files
committed
fix: Improve toolbar styling consistency
Rely upon the "toolbar" `variant` configuration to ensure each toolbar group renders a separating right border.
1 parent 2a1b33b commit f0f168c

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/components/editor-toolbar/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ const EditorToolbar = ( { className } ) => {
118118
<div className={ classes }>
119119
<Toolbar
120120
label="Editor toolbar"
121-
variant="unstyled"
121+
variant="toolbar"
122122
ref={ scrollViewRef }
123123
className={ scrollViewClasses }
124124
>

src/components/editor-toolbar/style.scss

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@use "@wordpress/base-styles/colors" as wordpress;
22

3-
$border-color: #c8c7cc;
3+
$border-color: wordpress.$gray-300;
44
$border-radius: 2px;
55
$min-touch-target-size: 46px;
66
$scroll-indicator-elevation: 32;
@@ -14,6 +14,10 @@ $scroll-indicator-elevation: 32;
1414
border-radius: 0;
1515
}
1616

17+
.gutenberg-kit-editor-toolbar .components-accessible-toolbar {
18+
border: none; // Remove "toolbar" variant's default black border
19+
}
20+
1721
// Disable overflow scrolling for the block toolbar, and rely upon scrolling the
1822
// parent editor toolbar to avoid nested scrolling views.
1923
.gutenberg-kit-editor-toolbar .block-editor-block-contextual-toolbar {
@@ -91,6 +95,11 @@ $scroll-indicator-elevation: 32;
9195
.gutenberg-kit-editor-toolbar .components-toolbar-group {
9296
border-right-color: $border-color;
9397
min-height: $min-touch-target-size;
98+
// Reset Gutenberg's negative margin that oddly create a gap at the top/bottom
99+
// of the toolbar, rather than extending the button height as intended in
100+
// Gutenberg.
101+
margin-top: initial;
102+
margin-bottom: initial;
94103
padding-left: 0;
95104
padding-right: 0;
96105
}

0 commit comments

Comments
 (0)