-
Notifications
You must be signed in to change notification settings - Fork 4.3k
/
Copy pathstyle.scss
247 lines (210 loc) · 5.91 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
$header-toolbar-min-width: 335px;
.edit-site-header-edit-mode {
height: $header-height;
align-items: center;
background-color: $white;
color: $gray-900;
display: flex;
box-sizing: border-box;
width: 100%;
justify-content: space-between;
border-bottom: $border-width solid $gray-200;
padding-left: $header-height;
.edit-site-header-edit-mode__start {
display: flex;
border: none;
align-items: center;
flex-shrink: 2;
// We need this to be overflow hidden so the block toolbar can
// overflow scroll. If the overflow is visible, flexbox allows
// the toolbar to grow outside of the allowed container space.
overflow: hidden;
// Take up the full height of the header so the border focus
// is visible on toolbar buttons.
height: 100%;
// Allow focus ring to be fully visible on furthest right button.
@include break-medium() {
padding-right: 2px;
}
}
.edit-site-header-edit-mode__end {
display: flex;
justify-content: flex-end;
}
.edit-site-header-edit-mode__center {
display: flex;
align-items: center;
height: 100%;
flex-grow: 1;
margin: 0 $grid-unit-20;
justify-content: center;
// Flex items will, by default, refuse to shrink below a minimum
// intrinsic width. In order to shrink this flexbox item, and
// subsequently truncate child text, we set an explicit min-width.
// See https://dev.w3.org/csswg/css-flexbox/#min-size-auto
min-width: 0;
}
}
.edit-site-header-edit-mode__toolbar {
display: flex;
align-items: center;
padding-left: $grid-unit-20;
gap: $grid-unit-10;
@include break-medium() {
padding-left: $grid-unit-50 * 0.5;
}
@include break-wide() {
padding-right: $grid-unit-10;
}
.edit-site-header-edit-mode__inserter-toggle {
svg {
transition: transform cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s;
@include reduce-motion("transition");
}
&.is-pressed {
svg {
transform: rotate(45deg);
}
}
}
}
/**
* Buttons on the right side
*/
.edit-site-header-edit-mode__actions {
display: inline-flex;
align-items: center;
padding-right: $grid-unit-10;
gap: $grid-unit-10;
}
.edit-site-header-edit-mode__preview-options {
opacity: 1;
transition: opacity 0.3s;
&.is-zoomed-out {
opacity: 0;
}
}
.edit-site-header-edit-mode__document-tools {
display: flex;
border: none;
// The Toolbar component adds different styles to buttons, so we reset them
// here to the original button styles
.edit-site-header-edit-mode__toolbar > .components-button.has-icon,
.edit-site-header-edit-mode__toolbar > .components-dropdown > .components-button.has-icon {
// @todo: override toolbar group inherited paddings from components/block-tools/style.scss.
// This is best fixed by making the mover control area a proper single toolbar group.
// It needs specificity due to style inherited from .components-accessible-toolbar .components-button.has-icon.has-icon.
height: $button-size-compact;
min-width: $button-size-compact;
padding: 4px;
&.is-pressed {
background: $gray-900;
}
&:focus:not(:disabled) {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0 0 0 $border-width $white;
outline: $border-width solid transparent;
}
&::before {
display: none;
}
}
.edit-site-header-edit-mode__toolbar > .edit-site-header-edit-mode__inserter-toggle.has-icon {
// Special dimensions for this button.
min-width: $button-size-compact;
width: $button-size-compact;
height: $button-size-compact;
padding: 0;
}
.edit-site-header-edit-mode__toolbar > .edit-site-header-edit-mode__inserter-toggle.has-text.has-icon {
width: auto;
padding: 0 $grid-unit-10;
}
}
// Button text label styles
.edit-site-header-edit-mode.show-icon-labels {
.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;
}
}
// Some margins and padding have to be adjusted so the buttons can still fit on smaller screens.
.edit-site-save-button__button {
padding-left: 6px;
padding-right: 6px;
}
// The template details toggle has a custom label, different from its aria-label, so we don't want to display both.
.edit-site-document-actions__get-info.edit-site-document-actions__get-info.edit-site-document-actions__get-info {
&::after {
content: none;
}
}
.edit-site-header-edit-mode__inserter-toggle.edit-site-header-edit-mode__inserter-toggle,
.edit-site-document-actions__get-info.edit-site-document-actions__get-info.edit-site-document-actions__get-info {
height: 36px;
padding: 0 $grid-unit-10;
}
.edit-site-header-edit-mode__document-tools .edit-site-header-edit-mode__toolbar > * + * {
margin-left: $grid-unit-10;
}
.block-editor-block-mover {
border-left: none;
&::before {
content: "";
width: $border-width;
margin-top: $grid-unit + $grid-unit-05;
margin-bottom: $grid-unit + $grid-unit-05;
background-color: $gray-300;
margin-left: $grid-unit;
}
}
}
.has-fixed-toolbar {
.selected-block-tools-wrapper {
overflow-x: scroll;
.block-editor-block-contextual-toolbar {
border-bottom: 0;
}
// Modified group borders
.components-toolbar-group,
.components-toolbar {
border-right: none;
&::after {
content: "";
width: $border-width;
margin-top: $grid-unit + $grid-unit-05;
margin-bottom: $grid-unit + $grid-unit-05;
background-color: $gray-300;
margin-left: $grid-unit;
}
& .components-toolbar-group.components-toolbar-group {
&::after {
display: none;
}
}
}
&.is-collapsed {
display: none;
}
}
.edit-site-header-edit-mode__center.is-collapsed {
display: none;
}
}
.edit-site-header-edit-mode__block-tools-toggle {
margin-left: 2px; // Allow focus ring to be fully visible
}