/
style.scss
136 lines (116 loc) · 3.08 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
/**
* Block Toolbar
*/
.block-editor-block-toolbar {
display: flex;
flex-grow: 1;
width: 100%;
overflow: auto; // Allow horizontal scrolling on mobile.
position: relative;
// Animation
transition: border-color 0.1s linear, box-shadow 0.1s linear;
@include reduce-motion("transition");
// Allow overflow on desktop.
@include break-small() {
overflow: inherit;
}
// Borders around toolbar segments.
.components-toolbar-group,
.components-toolbar {
background: none;
// IE11 has thick paddings without this.
line-height: 0;
// These margins make the buttons themselves overlap the chrome of the toolbar.
// This helps make them square, and maximize the hit area.
margin-top: -$border-width;
margin-bottom: -$border-width;
// The component is born with a border, but we only need some of them.
border: 0;
// Add a border after item groups to show as separator in the block toolbar.
border-right: $border-width solid $gray-300;
}
> :last-child,
> :last-child .components-toolbar-group,
> :last-child .components-toolbar {
border-right: none;
}
}
// Block controls.
.block-editor-block-toolbar__block-controls {
// The !important modifier should be removed when https://github.com/WordPress/gutenberg/issues/24898 refactors the spacing grid.
height: auto !important;
padding: 0 !important;
// Switcher.
.block-editor-block-switcher .components-dropdown-menu__toggle,
.block-editor-block-switcher__no-switcher-icon {
.block-editor-block-icon {
width: $button-size-small !important;
margin: 0 !important;
}
&:focus::before {
right: $grid-unit-05 !important;
}
}
// Compensate for width of block switcher.
.block-editor-block-mover {
margin-left: -$grid-unit-15 / 2;
}
}
.block-editor-block-toolbar,
.block-editor-format-toolbar {
// Override Toolbar buttons size.
.components-toolbar-group,
.components-toolbar {
display: flex;
flex-wrap: nowrap;
}
}
.block-editor-block-toolbar__slot {
// Required for IE11.
display: inline-block;
// Fix for toolbar button misalignment on IE11
line-height: 0;
// IE11 doesn't read rules inside this query. They are applied only to modern browsers.
@supports (position: sticky) {
display: inline-flex;
}
}
.block-editor-block-toolbar__block-parent-selector-wrapper {
position: absolute;
top: -1px;
left: -1px;
opacity: 0;
transition: all 60ms linear;
z-index: -1; // This makes it slide out from underneath the toolbar.
@include reduce-motion("transition");
.is-showing-movers & {
opacity: 1;
transform: translateY(-($block-toolbar-height + $grid-unit-15));
}
}
.block-editor-block-toolbar-animated-width-container {
position: relative;
overflow: hidden;
transition: width 300ms;
}
.block-editor-block-toolbar-content-enter {
position: absolute;
top: 0;
left: 0;
width: auto;
opacity: 0;
}
.block-editor-block-toolbar-content-enter-active {
position: absolute;
opacity: 1;
transition: opacity 300ms;
}
.block-editor-block-toolbar-content-exit {
width: auto;
opacity: 1;
pointer-events: none;
}
.block-editor-block-toolbar-content-exit-active {
opacity: 0;
transition: opacity 300ms;
}