-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
editor.scss
167 lines (142 loc) · 3.53 KB
/
editor.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
.wp-block[data-align="center"] > .wp-block-site-logo,
.wp-block-site-logo.aligncenter > div {
display: table;
margin-left: auto;
margin-right: auto;
}
.wp-block-site-logo {
// Make the block selectable.
a {
pointer-events: none;
}
.custom-logo-link {
cursor: inherit;
&:focus {
box-shadow: none;
}
}
img {
display: block;
height: auto;
max-width: 100%;
}
&.is-transient {
position: relative;
img {
opacity: 0.3;
}
// Shown while image is being uploaded.
.components-spinner {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
margin: 0;
}
}
}
// Provide special styling for the placeholder.
// @todo this particular minimal style of placeholder could be componentized further.
.wp-block-site-logo.wp-block-site-logo {
&.is-default-size .components-placeholder {
height: 60px;
width: 60px;
}
// Inherit radius.
> div, // A 60px width div shown only in the editor on mobile.
.components-resizable-box__container {
border-radius: inherit;
}
// Style the placeholder.
.components-placeholder {
display: flex;
justify-content: center;
align-items: center;
padding: 0;
border-radius: inherit;
// Provide a minimum size for the placeholder, for when the logo is resized.
// @todo resizing is currently only possible by adding an image, resizing,
// and then removing the image again. We might want to enable resizing on the
// placeholder itself.
min-height: $grid-unit-60;
min-width: $grid-unit-60;
height: 100%;
width: 100%;
// Hide the upload button, as it's also available in the media library.
.components-form-file-upload {
display: none;
}
// Hide items.
.components-drop-zone__content-text {
display: none;
}
// Style the upload button.
.components-button.components-button {
padding: 0;
margin: auto;
display: flex;
justify-content: center;
align-items: center;
width: $grid-unit-60;
height: $grid-unit-60;
border-radius: 50%;
position: relative;
background: var(--wp-admin-theme-color);
border-color: var(--wp-admin-theme-color);
border-style: solid;
color: $white;
> svg {
color: inherit;
}
}
}
}
.block-library-site-logo__inspector-upload-container {
position: relative;
// Since there is no option to skip rendering the drag'n'drop icon in drop
// zone, we hide it for now.
.components-drop-zone__content-icon {
display: none;
}
}
.block-library-site-logo__inspector-upload-container,
.block-library-site-logo__inspector-media-replace-container {
button.components-button {
color: $gray-900;
box-shadow: inset 0 0 0 1px $gray-400;
width: 100%;
display: block;
height: $grid-unit-50;
&:hover {
color: var(--wp-admin-theme-color);
}
&:focus {
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
}
}
.block-library-site-logo__inspector-media-replace-title {
word-break: break-all;
// The Button component is white-space: nowrap, and that won't work with line-clamp.
white-space: normal;
// Without this, the ellipsis can sometimes be partially hidden by the Button padding.
text-align: start;
text-align-last: center;
}
}
.block-library-site-logo__inspector-media-replace-container {
.components-dropdown {
display: block;
}
img {
width: 20px;
min-width: 20px;
aspect-ratio: 1;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
border-radius: 50% !important;
}
.block-library-site-logo__inspector-readonly-logo-preview {
padding: 6px 12px;
display: flex;
height: $grid-unit-50;
}
}