-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
style.scss
283 lines (246 loc) · 6.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
.editor-header {
height: $header-height;
background: $white;
display: grid;
grid-auto-flow: row;
grid-template: auto / $header-height minmax(0, max-content) minmax(min-content, 1fr) $header-height;
&:has(> .editor-header__center) {
grid-template: auto / $header-height min-content 1fr min-content $header-height;
@include break-medium {
grid-template: auto / $header-height minmax(min-content, 1fr) 2fr minmax(min-content, 1fr) $header-height;
}
}
@include break-mobile {
gap: $grid-unit-20;
}
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;
}
}
.editor-header__toolbar {
grid-column: 1 / 3;
// When there is no back button or the viewport is <= mobile the margin keeps the content off
// the starting edge.
> :first-child {
margin-inline: $grid-unit-20 0;
}
// This is the typical case, the back button takes up the first column.
.editor-header__back-button + & {
grid-column: 2 / 3;
@include break-mobile {
// Clears the margin; at this breakpoint the parent’s `gap` takes its place.
> :first-child {
margin-inline: 0;
}
}
}
display: flex;
// Make narrowing to less than content width possible. Block toolbar will hide overflow and allow scrolling on fixed toolbar.
min-width: 0;
align-items: center;
// Clip the box while leaving room for focus rings.
clip-path: inset(-2px);
@include break-mobile {
clip-path: none;
}
.table-of-contents {
display: none;
@include break-small() {
display: block;
}
}
// Add a gap before the block toolbar or its toggle button when collapsed.
.editor-collapsible-block-toolbar {
margin-inline: $grid-unit 0;
&.is-collapsed ~ .editor-collapsible-block-toolbar__toggle {
margin-inline: $grid-unit 0;
}
}
}
.editor-header__center {
grid-column: 3 / 4;
display: flex;
justify-content: center;
align-items: center;
// To enable shrinking and truncating of child text, apply an explicit min-width.
min-width: 0;
// Clip the box while leaving room for focus rings.
clip-path: inset(-2px);
// At less than mobile the header’s `gap` is zero so margins are added to create a smaller
// gap around the center’s contents.
@media (max-width: #{$break-mobile - 1}) {
> :first-child {
margin-inline-start: $grid-unit;
}
> :last-child {
margin-inline-end: $grid-unit;
}
}
}
/**
* Buttons on the right side
*/
.editor-header__settings {
grid-column: 3 / -1;
.editor-header:has(> .editor-header__center) & {
grid-column: 4 / -1;
}
justify-self: end;
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 .editor-header {
.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);
white-space: nowrap;
}
&[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.
.components-button.has-icon.button-toggle {
svg {
display: block;
}
&::after {
content: none;
}
}
// 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 {
.editor-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);
}
}
}
}
.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;
}
}
}
.editor-header__post-preview-button {
@include break-mobile {
display: none;
}
}
.editor-editor-interface.is-distraction-free {
.interface-interface-skeleton__header {
border-bottom: none;
}
.editor-header {
background-color: $white;
width: 100%;
@include break-medium {
box-shadow: 0 $border-width 0 0 rgba($color: #000, $alpha: 0.133); // 0.133 = $gray-200 but with alpha.
position: absolute;
}
// hide some parts
& > .edit-post-header__settings > .edit-post-header__post-preview-button {
visibility: hidden;
}
& > .editor-header__toolbar .editor-document-tools__document-overview-toggle,
& > .editor-header__settings > .editor-preview-dropdown,
& > .editor-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");
}