PluginProbe
Code Snippets / trunk
Code Snippets vtrunk
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
code-snippets / css / feedback.scss

feedback.scss in Code Snippets trunk, at css/feedback.scss

327 lines 6.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 @use 'common/theme';
2
3 .code-snippets-feedback-launcher {
4 position: fixed;
5 inset-block-end: 24px;
6 inset-inline-end: 24px;
7 z-index: 100000;
8 display: inline-flex;
9 align-items: center;
10 gap: 8px;
11 min-block-size: var(--cs-control-height);
12 padding-block: 2px;
13 padding-inline: 16px;
14 border: none;
15 border-radius: 24px;
16 background: var(--cs-color-accent);
17 color: var(--cs-color-surface);
18 font-size: var(--cs-font-size-body);
19 font-weight: 700;
20 line-height: 2.5715;
21 cursor: pointer;
22 box-shadow: 0 4px 14px rgb(0 0 0 / 18%);
23 transition: transform 0.15s ease, background 0.15s ease;
24
25 &:hover {
26 background: var(--cs-color-accent-hover);
27 transform: translateY(-1px);
28 }
29
30 &:focus-visible {
31 outline: 2px solid var(--cs-color-accent);
32 outline-offset: 2px;
33 }
34 }
35
36 .code-snippets-feedback-launcher__dot {
37 inline-size: 7px;
38 block-size: 7px;
39 border-radius: 50%;
40 background: var(--cs-color-primary);
41 box-shadow: 0 0 0 3px rgb(3 199 210 / 25%);
42 }
43
44 .code-snippets-feedback-badge {
45 display: inline-flex;
46 align-items: center;
47 gap: 6px;
48 vertical-align: middle;
49 margin-inline-start: 12px;
50 padding-block: 3px;
51 padding-inline: 10px;
52 border: 1px solid #f0c0c1;
53 border-radius: 999px;
54 background: #fcf0f1;
55 color: #8a2424;
56 font-size: 11px;
57 font-weight: 600;
58 letter-spacing: 0.02em;
59 line-height: 1.6;
60 white-space: nowrap;
61 }
62
63 .code-snippets-feedback-badge__dot {
64 inline-size: 6px;
65 block-size: 6px;
66 border-radius: 50%;
67 background: var(--cs-color-error);
68 }
69
70 // The drawer slides in from the inline end, so it reads as arriving from the edge of the
71 // screen rather than appearing over the page. Modal animates its frame by name, so the
72 // scale-and-fade it ships with has to be replaced rather than overridden a property at a
73 // time. WordPress supplies the duration, and leaves it unset under reduced motion.
74 @keyframes code-snippets-feedback-slide-in {
75 from {
76 transform: translateX(calc(100% * var(--cs-direction-multiplier)));
77 }
78
79 to {
80 transform: translateX(0);
81 }
82 }
83
84 @keyframes code-snippets-feedback-slide-out {
85 from {
86 transform: translateX(0);
87 }
88
89 to {
90 transform: translateX(calc(100% * var(--cs-direction-multiplier)));
91 }
92 }
93
94 .components-modal__frame.code-snippets-feedback-modal {
95 position: fixed;
96 inset-block: 0;
97 inset-inline-end: 0;
98 inline-size: var(--cs-feedback-modal-inline-size);
99 max-inline-size: 100vw;
100 block-size: 100%;
101 max-block-size: 100%;
102 margin: 0;
103 border-radius: 0;
104 border-inline-start: 1px solid var(--cs-color-border-subtle);
105 box-shadow: -8px 0 32px rgb(0 0 0 / 12%);
106 animation-name: code-snippets-feedback-slide-in;
107
108 .components-modal__header {
109 padding-inline: 24px;
110 border-block-end: 1px solid var(--cs-color-border-subtle);
111 }
112
113 // The header is positioned over the content, which keeps the offset WordPress gives it
114 // to clear it. Only the body scrolls, so the buttons stay reachable however long the
115 // form gets.
116 .components-modal__content {
117 display: flex;
118 flex-flow: column;
119 min-block-size: 0;
120 padding: 0;
121 overflow: hidden;
122 }
123
124 // Newer Modal versions wrap children in an unstyled focus container.
125 .components-modal__header + div {
126 display: flex;
127 flex-flow: column;
128 flex: 1;
129 min-block-size: 0;
130 overflow: hidden;
131 }
132 }
133
134 .components-modal__screen-overlay.is-animating-out .components-modal__frame.code-snippets-feedback-modal {
135 animation-name: code-snippets-feedback-slide-out;
136 }
137
138 .code-snippets-feedback-panel__subtitle {
139 flex-shrink: 0;
140 padding-block: 12px 0;
141 padding-inline: 24px;
142 margin: 0;
143 color: var(--cs-color-text-muted);
144 font-size: 12px;
145 }
146
147 .code-snippets-feedback-panel__body {
148 flex: 1;
149 min-block-size: 0;
150 overflow-y: auto;
151 padding-block: 16px 20px;
152 padding-inline: 24px;
153 }
154
155 .code-snippets-feedback-panel__footer {
156 display: flex;
157 flex-shrink: 0;
158 justify-content: flex-end;
159 gap: 10px;
160 padding-block: 16px;
161 padding-inline: 24px;
162 border-block-start: 1px solid var(--cs-color-border-subtle);
163 background: var(--cs-color-surface-subtle);
164 }
165
166 .code-snippets-feedback-field {
167 margin-block-end: 18px;
168
169 .components-base-control__help {
170 color: var(--cs-color-text-muted);
171 }
172 }
173
174 .code-snippets-feedback-fieldset {
175 padding: 0;
176 margin-block: 0 18px;
177 margin-inline: 0;
178 border: 0;
179
180 legend {
181 padding: 0;
182 margin-block-end: 8px;
183 font-size: 13px;
184 font-weight: 600;
185 }
186
187 .components-base-control {
188 margin-block-end: 10px;
189
190 &:last-child {
191 margin-block-end: 0;
192 }
193 }
194 }
195
196 .code-snippets-feedback-duplicates {
197 padding: 12px;
198 margin-block: -6px 18px;
199 border: 1px solid #f0c33c;
200 border-radius: var(--cs-control-radius);
201 background: #fcf9e8;
202
203 p {
204 margin-block: 0 8px;
205 font-size: 12px;
206 font-weight: 600;
207 }
208
209 ul {
210 padding: 0;
211 margin: 0;
212 list-style: none;
213 }
214
215 li {
216 margin-block-end: 6px;
217 font-size: 12px;
218 line-height: 1.4;
219
220 &:last-child {
221 margin-block-end: 0;
222 }
223 }
224 }
225
226 .code-snippets-feedback-disclosure {
227 padding-block-start: 14px;
228 border-block-start: 1px solid var(--cs-color-border-subtle);
229
230 summary {
231 color: var(--cs-color-accent);
232 font-weight: 600;
233 cursor: pointer;
234
235 &:focus-visible {
236 outline: 2px solid var(--cs-color-accent);
237 outline-offset: 2px;
238 }
239 }
240 }
241
242 .code-snippets-feedback-disclosure__list {
243 display: grid;
244 grid-template-columns: 108px 1fr;
245 gap: 4px 12px;
246 margin-block: 12px 0;
247 font-size: 12px;
248
249 dt {
250 color: var(--cs-color-text-muted);
251 }
252
253 dd {
254 margin: 0;
255 word-break: break-word;
256 }
257 }
258
259 .code-snippets-feedback-disclosure__note {
260 margin-block: 12px 0;
261 color: var(--cs-color-text-muted);
262 font-size: 12px;
263 }
264
265 .code-snippets-feedback-message {
266 padding-block: 10px;
267 padding-inline: 12px;
268 margin-block: 0 18px;
269 border-radius: var(--cs-control-radius);
270 border-inline-start: 4px solid var(--cs-color-error);
271 background: #fcf0f1;
272 scroll-margin-block-start: 8px;
273
274 &:focus {
275 outline: 2px solid var(--cs-color-error);
276 outline-offset: 2px;
277 }
278 }
279
280 .code-snippets-feedback-success {
281 padding-block: 48px;
282 padding-inline: 12px;
283 text-align: center;
284
285 h3 {
286 margin-block: 0 8px;
287 font-size: 15px;
288 }
289
290 p {
291 margin: 0;
292 color: var(--cs-color-text-muted);
293 }
294
295 &::before {
296 content: '';
297 display: block;
298 inline-size: 8px;
299 block-size: 8px;
300 margin-block-end: 12px;
301 margin-inline: auto;
302 border-radius: 50%;
303 background: var(--cs-color-success);
304 }
305 }
306
307 @media (width <= 480px) {
308 .components-modal__frame.code-snippets-feedback-modal {
309 inline-size: 100vw;
310 }
311
312 .code-snippets-feedback-launcher {
313 inset-block-end: 16px;
314 inset-inline-end: 16px;
315 }
316 }
317
318 @media (prefers-reduced-motion: reduce) {
319 .code-snippets-feedback-launcher {
320 transition: none;
321
322 &:hover {
323 transform: none;
324 }
325 }
326 }
327