-
Notifications
You must be signed in to change notification settings - Fork 4.1k
/
style.scss
330 lines (285 loc) · 7.43 KB
/
style.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
.edit-post-header {
height: $header-height;
background: $white;
display: flex;
flex-wrap: wrap;
align-items: center;
// The header should never be wider than the viewport, or buttons might be hidden. Especially relevant at high zoom levels. Related to https://core.trac.wordpress.org/ticket/47603#ticket.
max-width: 100vw;
justify-content: space-between;
// Make toolbar sticky on larger breakpoints
@include break-zoomed-in {
flex-wrap: nowrap;
}
}
.edit-post-header__toolbar {
display: flex;
// Allow this area to shrink to fit the toolbar buttons.
flex-shrink: 8;
// Take up the space of the toolbar so it can be justified to the left side of the toolbar.
flex-grow: 3;
// Hide the overflow so flex will limit its width. Block toolbar will allow scrolling on fixed toolbar.
overflow: hidden;
// Leave enough room for the focus ring to show.
padding: 2px 0;
align-items: center;
// Allow focus ring to be fully visible on furthest right button.
@include break-medium() {
padding-right: var(--wp-admin-border-width-focus);
}
.table-of-contents {
display: none;
@include break-small() {
display: block;
}
}
.selected-block-tools-wrapper {
overflow: hidden;
display: flex;
align-items: center;
height: $header-height;
.block-editor-block-contextual-toolbar {
border-bottom: 0;
height: 100%;
}
// These rules ensure that icons are always positioned in a way that lines up with the rest of the icons in the toolbar.
.block-editor-block-toolbar {
height: 100%;
// Push down so that buttons are centered vertically.
// It should be 14px (60px header height - 32px compact button height = 28 / 2),
// but there is a -1px top-margin down the stack that affects this.
padding-top: math.div($header-height - $button-size-compact, 2) + 1;
// Match the height of other buttons in the header toolbar.
.components-button:not(.block-editor-block-mover-button) {
height: $button-size-compact;
}
}
&::after {
content: "";
width: $border-width;
height: $grid-unit-30;
background-color: $gray-300;
margin-left: $grid-unit;
}
// Modified group borders.
.components-toolbar-group,
.components-toolbar {
border-right: none;
&::after {
content: "";
width: $border-width;
height: $grid-unit-30;
background-color: $gray-300;
margin-top: $grid-unit-05;
margin-left: $grid-unit;
}
& .components-toolbar-group.components-toolbar-group {
&::after {
display: none;
}
}
}
.block-editor-block-mover {
// Match the height of other buttons in the header toolbar.
&.is-horizontal .block-editor-block-mover-button {
height: $button-size-compact;
overflow: visible;
}
// Move up a little to prevent the toolbar shift when focus is on the vertical movers.
@include break-small() {
&:not(.is-horizontal) .block-editor-block-mover__move-button-container {
position: relative;
top: -10px;
}
}
}
&.is-collapsed {
display: none;
}
}
}
.edit-post-header__block-tools-toggle {
margin-left: 2px; // Allow focus ring to be fully visible
}
.edit-post-header__center {
flex-grow: 1;
display: flex;
justify-content: center;
&.is-collapsed {
display: none;
}
}
/**
* Buttons on the right side
*/
.edit-post-header__settings {
display: inline-flex;
align-items: center;
flex-wrap: nowrap;
padding-right: $grid-unit-05;
@include break-small () {
padding-right: $grid-unit-10;
}
gap: $grid-unit-10;
}
/**
* Show icon labels.
*/
.show-icon-labels.interface-pinned-items,
.show-icon-labels .edit-post-header,
.edit-post-header__dropdown {
.components-button.has-icon {
width: auto;
// Hide the button icons when labels are set to display...
svg {
display: none;
}
// ... and display labels.
&::after {
content: attr(aria-label);
}
&[aria-disabled="true"] {
background-color: transparent;
}
}
.is-tertiary {
&:active {
box-shadow: 0 0 0 1.5px var(--wp-admin-theme-color);
background-color: transparent;
}
}
// Exception for drodpdown toggle buttons.
// Exception for the fullscreen mode button.
.edit-post-fullscreen-mode-close.has-icon,
.components-button.has-icon.button-toggle {
svg {
display: block;
}
&::after {
content: none;
}
}
// Undo the width override for fullscreen mode button.
.edit-post-fullscreen-mode-close.has-icon {
width: $header-height;
}
// Don't hide MenuItemsChoice check icons
.components-menu-items-choice .components-menu-items__item-icon.components-menu-items__item-icon {
display: block;
}
.editor-document-tools__inserter-toggle.editor-document-tools__inserter-toggle,
.interface-pinned-items .components-button {
padding-left: $grid-unit;
padding-right: $grid-unit;
@include break-small {
padding-left: $grid-unit-15;
padding-right: $grid-unit-15;
}
}
.editor-post-save-draft.editor-post-save-draft,
.editor-post-saved-state.editor-post-saved-state {
&::after {
content: none;
}
}
}
.show-icon-labels {
.edit-post-header__toolbar .block-editor-block-mover {
// Modified group borders.
border-left: none;
&::before {
content: "";
width: $border-width;
height: $grid-unit-30;
background-color: $gray-300;
margin-top: $grid-unit-05;
margin-left: $grid-unit;
}
// Modified block movers horizontal separator.
.block-editor-block-mover__move-button-container {
&::before {
width: calc(100% - #{$grid-unit-30});
background: $gray-300;
left: calc(50% + 1px);
}
}
}
}
.edit-post-header__dropdown {
.components-menu-item__button.components-menu-item__button,
.components-button.editor-history__undo,
.components-button.editor-history__redo,
.table-of-contents .components-button,
.components-button.block-editor-list-view {
margin: 0;
padding: 6px 6px 6px $grid-unit-50;
width: 14.625rem;
text-align: left;
justify-content: flex-start;
}
}
.show-icon-labels.interface-pinned-items {
padding: 6px $grid-unit-15 $grid-unit-15;
margin-top: 0;
margin-bottom: 0;
margin-left: -$grid-unit-15;
margin-right: -$grid-unit-15;
border-bottom: 1px solid $gray-400;
display: block;
> .components-button.has-icon {
margin: 0;
padding: 6px 6px 6px $grid-unit;
width: 14.625rem;
justify-content: flex-start;
&[aria-expanded="true"] svg {
display: block;
max-width: $grid-unit-30;
}
&[aria-expanded="false"] {
padding-left: $grid-unit-50;
}
svg {
margin-right: 8px;
}
}
}
.edit-post-header__post-preview-button {
@include break-small {
display: none;
}
}
.is-distraction-free {
.interface-interface-skeleton__header {
border-bottom: none;
}
.edit-post-header {
background-color: $white;
border-bottom: 1px solid #e0e0e0;
position: absolute;
width: 100%;
// hide some parts
& > .edit-post-header__settings > .edit-post-header__post-preview-button {
visibility: hidden;
}
& > .edit-post-header__toolbar .editor-document-tools__document-overview-toggle,
& > .edit-post-header__settings > .editor-preview-dropdown,
& > .edit-post-header__settings > .interface-pinned-items {
display: none;
}
}
// We need ! important because we override inline styles
// set by the motion component.
.interface-interface-skeleton__header:focus-within {
opacity: 1 !important;
div {
transform: translateX(0) translateZ(0) !important;
}
}
.components-editor-notices__dismissible {
position: absolute;
z-index: 35;
}
}
.components-popover.more-menu-dropdown__content {
z-index: z-index(".components-popover.more-menu__content");
}