Skip to content

Commit e9739d9

Browse files
Survey form fixes with tailwind and new js (#54)
* survey form with tailwind and new js * change the tracking method * temporary segment key change * revert the segment key change * rename partial * reorganize js files
1 parent cf47d32 commit e9739d9

21 files changed

+223
-400
lines changed

src/css/ds-blocks.css

Lines changed: 0 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -246,167 +246,3 @@ html[data-theme="dark"] .doc .source-toolbox {
246246
html[data-theme="dark"] .doc .admonitionblock .icon::before {
247247
color: var(--ds-primary-text);
248248
}
249-
250-
/*
251-
*
252-
* Dialog component
253-
*
254-
*/
255-
256-
dialog {
257-
display: none;
258-
padding: 0;
259-
flex-direction: column;
260-
align-items: flex-start;
261-
border-radius: 6px;
262-
border: 1px solid var(--ds-neutral-300);
263-
width: 90%;
264-
max-width: 640px;
265-
background: var(--body-background);
266-
color: var(--doc-font-color);
267-
}
268-
269-
/* dialog header */
270-
dialog .header {
271-
display: flex;
272-
padding: var(--ds-space-3);
273-
padding-bottom: var(--ds-space-2);
274-
align-items: center;
275-
gap: var(--ds-space-2);
276-
align-self: stretch;
277-
justify-content: space-between;
278-
border-bottom: 1px solid var(--ds-neutral-200);
279-
}
280-
281-
dialog .header .title {
282-
@include text-h1;
283-
284-
color: var(--heading-font-color);
285-
}
286-
287-
dialog .header .close-button {
288-
display: flex;
289-
justify-content: center;
290-
align-items: center;
291-
gap: var(--ds-space-1);
292-
}
293-
294-
dialog .header kbd {
295-
border: none;
296-
box-shadow: none;
297-
background: var(--ds-neutral-100);
298-
}
299-
300-
dialog .header button {
301-
background: transparent;
302-
border: none;
303-
line-height: 1;
304-
}
305-
306-
dialog .header .material-icons {
307-
color: var(--link-font-color);
308-
}
309-
310-
/* dialog content */
311-
dialog form {
312-
width: 100%;
313-
}
314-
315-
dialog .content {
316-
display: flex;
317-
flex-direction: column;
318-
align-self: stretch;
319-
border-bottom: 1px solid var(--ds-neutral-200);
320-
padding: var(--ds-space-3) var(--ds-space-4) var(--ds-space-3) var(--ds-space-3);
321-
}
322-
323-
dialog .content .message {
324-
@include text-h2;
325-
326-
color: var(--heading-font-color);
327-
margin-bottom: var(--ds-space-4);
328-
}
329-
330-
dialog .content .question {
331-
font-size: calc(13 / var(--rem-base) * 1rem);
332-
color: var(--ds-neutral-700);
333-
font-weight: 600;
334-
letter-spacing: 0.65px;
335-
}
336-
337-
dialog .content textarea {
338-
font-family: var(--body-font-family);
339-
color: var(--doc-font-color);
340-
background: var(--body-background);
341-
height: calc(160 / var(--rem-base) * 1rem);
342-
margin-top: var(--ds-space-h);
343-
resize: none;
344-
padding: var(--ds-space-1);
345-
border-radius: 6px;
346-
border: 1px solid var(--ds-neutral-300);
347-
}
348-
349-
dialog .action {
350-
display: flex;
351-
padding: var(--ds-space-2) var(--ds-space-3) var(--ds-space-3) var(--ds-space-3);
352-
align-items: center;
353-
gap: var(--ds-space-1);
354-
align-self: stretch;
355-
justify-content: flex-end;
356-
}
357-
358-
dialog[open] {
359-
display: flex;
360-
}
361-
362-
dialog::backdrop {
363-
background: rgba(10, 10, 10, 0.6);
364-
}
365-
366-
.dialog-action,
367-
.dialog-action--response {
368-
transition: opacity 500ms cubic-bezier(0.4, 0, 0.2, 1), visibility 500ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
369-
transition-delay: 300ms;
370-
}
371-
372-
.dialog-action + .dialog-action--response {
373-
position: absolute;
374-
top: 0;
375-
line-height: var(--ds-space-5);
376-
height: var(--ds-space-5);
377-
}
378-
379-
.dialog-action--response {
380-
font-weight: 600;
381-
transition-delay: 1200ms;
382-
}
383-
384-
.dialog-action--container {
385-
position: relative;
386-
387-
& .dialog-action {
388-
opacity: 1;
389-
visibility: visible;
390-
}
391-
392-
& .dialog-action--response {
393-
opacity: 0;
394-
visibility: hidden;
395-
}
396-
397-
&:not(.first-time) .dialog-action {
398-
transition-delay: 2000ms;
399-
}
400-
401-
&.dialog-action--animate {
402-
& .dialog-action {
403-
opacity: 0;
404-
visibility: hidden;
405-
}
406-
407-
& .dialog-action--response {
408-
opacity: 1;
409-
visibility: visible;
410-
}
411-
}
412-
}

src/css/ds-dark.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ html[data-theme="dark"] .for-light {
152152
display: none;
153153
}
154154

155+
html[data-theme="dark"] ::backdrop {
156+
--ds-background-backdrop: rgba(10, 10, 10, 0.6);
157+
}
158+
155159
@media (prefers-color-scheme: dark) {
156160
:root:not([data-theme="light"]):not([data-theme="dark"]) {
157161
@include dark-theme;

src/css/ds-input.css

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/css/ds-light.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ html[data-theme="light"] .for-dark {
152152
display: none;
153153
}
154154

155+
html[data-theme="light"] ::backdrop {
156+
--ds-background-backdrop: rgba(0, 0, 0, 0.6);
157+
}
158+
155159
@media (prefers-color-scheme: light) {
156160
:root:not([data-theme="light"]):not([data-theme="dark"]) {
157161
@include light-theme;

src/css/site.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
@import "nav.css";
1414
@import "main.css";
1515
@import "ds-button.css";
16-
@import "ds-input.css";
1716
@import "ds-logo.css";
1817
@import "toolbar.css";
1918
@import "breadcrumbs.css";

src/css/tailwind/btn.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@mixin btn {
1+
@layer components {
22
.btn {
33
@apply px-1.5 py-1 h-5 transition ease-in-out rounded-xl whitespace-nowrap text-button border border-transparent flex items-center justify-center;
44
}

src/css/tailwind/dialog.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@layer components {
2+
.dialog {
3+
@apply rounded-xl border;
4+
5+
overscroll-behavior: contain;
6+
box-shadow: 0 6px 16px 0 #0a0a0a1f;
7+
background: var(--ds-background-body);
8+
color: var(--ds-text-primary);
9+
10+
&::backdrop {
11+
background-color: var(--ds-background-backdrop);
12+
}
13+
}
14+
}

src/css/tailwind/input.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
@layer components {
3+
.input {
4+
@include text-body;
5+
6+
@apply transition-colors rounded-xl border p-1 w-full;
7+
8+
color: var(--ds-text-primary);
9+
background: none;
10+
11+
&:hover {
12+
border-color: var(--ds-neutral-outlined-hover-border);
13+
}
14+
15+
&:focus {
16+
outline: 2px solid var(--ds-focus-visible);
17+
outline-offset: -2px;
18+
}
19+
20+
&::placeholder {
21+
color: var(--ds-text-placeholder);
22+
}
23+
}
24+
}

src/css/tailwind/tailwind.css

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
@import "../ds-typography.css";
22
@import "btn.css";
3+
@import "dialog.css";
4+
@import "input.css";
35

46
@tailwind base;
57
@tailwind components;
68
@tailwind utilities;
79

8-
@layer components {
9-
@include btn;
10-
}
11-
1210
@layer base {
1311
*,
1412
::before,

src/css/typeface-material-icons-outlined.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@
2828
-moz-osx-font-smoothing: grayscale;
2929
/* Support for IE. */
3030
font-feature-settings: 'liga';
31+
vertical-align: middle;
3132
}

0 commit comments

Comments
 (0)