Skip to content

Commit 4712dd9

Browse files
authored
Merge pull request #1865 from opensafely/tomodwyer/feedback-form
Add a feedback form
2 parents ebc6c31 + 2aabfa9 commit 4712dd9

File tree

4 files changed

+540
-1
lines changed

4 files changed

+540
-1
lines changed

docs/css/extra.css

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,137 @@ body {
197197
}
198198
}
199199
}
200+
201+
.feedback-form {
202+
--color-green-50: oklch(98.2% 0.018 155.826);
203+
--color-green-600: oklch(62.7% 0.194 149.214);
204+
--color-green-700: oklch(52.7% 0.154 150.069);
205+
206+
--color-blue-50: oklch(97% 0.014 254.604);
207+
--color-blue-700: oklch(48.8% 0.243 264.376);
208+
--color-blue-900: oklch(37.9% 0.146 265.522);
209+
210+
--color-neutral-50: oklch(98.5% 0 0);
211+
--color-neutral-200: oklch(92.2% 0 0);
212+
213+
--shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
214+
--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1),
215+
0 8px 10px -6px rgb(0 0 0 / 0.1);
216+
217+
align-items: center;
218+
border: 1px solid transparent;
219+
bottom: 2rem;
220+
display: flex;
221+
flex-direction: column;
222+
position: fixed;
223+
right: 2vw;
224+
z-index: 1;
225+
226+
box-sizing: border-box;
227+
228+
> * {
229+
box-sizing: border-box;
230+
}
231+
}
232+
233+
.feedback-form__summary {
234+
align-items: center;
235+
background-color: var(--color-green-600);
236+
border-radius: 0.5rem;
237+
box-shadow: var(--shadow-sm);
238+
color: var(--color-green-50);
239+
cursor: pointer;
240+
display: flex;
241+
flex-direction: row;
242+
font-size: 0.9rem;
243+
font-weight: 700;
244+
gap: 0.5rem;
245+
line-height: 1;
246+
outline-offset: 2px;
247+
padding: 0.75rem;
248+
transition-duration: 0.15s;
249+
transition-property: background-color, color, transform;
250+
transition-timing-function: ease-out;
251+
white-space: nowrap;
252+
width: fit-content;
253+
will-change: transform;
254+
255+
&::marker {
256+
content: "";
257+
}
258+
259+
&:hover {
260+
background-color: var(--color-green-700);
261+
color: white;
262+
transform: scale(1.05);
263+
}
264+
}
265+
266+
.feedback-form__content {
267+
background-color: var(--color-neutral-50);
268+
font-size: 0.8rem;
269+
line-height: 1.4;
270+
padding: 0.5rem 1rem;
271+
text-wrap-style: pretty;
272+
width: 35ch;
273+
274+
a:not([class]) {
275+
color: var(--color-blue-700);
276+
font-weight: 600;
277+
text-decoration: underline 2px
278+
color-mix(in srgb, currentColor, transparent 75%);
279+
text-underline-offset: 2px;
280+
transition: color 0.2s ease-in-out, text-decoration 0.2s ease-in-out;
281+
282+
&:hover {
283+
text-decoration-color: currentColor;
284+
}
285+
}
286+
}
287+
288+
.feedback-form__button {
289+
background-color: var(--color-blue-700);
290+
border-radius: 0.5rem;
291+
color: var(--color-blue-50);
292+
display: flex;
293+
font-size: 0.8rem;
294+
font-weight: 700;
295+
line-height: 1;
296+
margin: 1rem 0;
297+
outline-offset: 2px;
298+
padding: 0.5rem 0.65rem;
299+
transition-duration: 0.15s;
300+
transition-property: background-color, color, transform;
301+
transition-timing-function: ease-out;
302+
width: fit-content;
303+
304+
&:hover,
305+
&:focus {
306+
background-color: var(--color-blue-900);
307+
color: white;
308+
text-decoration: none;
309+
transform: scale(1.05);
310+
}
311+
}
312+
313+
.feedback-form[open] {
314+
border-color: var(--color-neutral-200);
315+
border-radius: 0.5rem;
316+
box-shadow: var(--shadow-xl);
317+
overflow: hidden;
318+
319+
.feedback-form__summary {
320+
border-radius: 9px 9px 0 0;
321+
box-shadow: none;
322+
outline-offset: -1px;
323+
width: 100%;
324+
325+
&:hover {
326+
transform: none;
327+
}
328+
329+
&:focus {
330+
transition: none;
331+
}
332+
}
333+
}

0 commit comments

Comments
 (0)