|
31 | 31 | const height = 'h-12'; |
32 | 32 | const height_class = is_textarea ? '' : height; |
33 | 33 | const padding_top_class = is_textarea ? '' : 'pt-4'; |
34 | | - const color_class = error ? color('text-red-700') : color('text-black'); |
35 | | - const label_color_class = disabled ? color('text-slate-400') : color('text-black'); |
36 | | - const border_class = error ? color('border-b-red-600') : color('border-b-slate-300'); |
| 34 | + const color_class = error ? 'text-red-700 dark:text-red-200' : 'text-black dark:text-white'; |
| 35 | + const label_color_class = disabled ? 'text-slate-400 dark:text-slate-500' : 'text-black dark:text-white'; |
| 36 | + const border_class = error ? 'border-b-red-600 dark:border-b-red-300' : 'border-b-slate-300 dark:border-b-slate-600'; |
37 | 37 | const padding_left = icon ? 'pl-11' : 'pl-4'; |
38 | 38 | const padding_right = icon_trailing ? 'pr-11' : 'pr-4'; |
39 | 39 | const pointer_events_class = is_textarea ? 'pointer-events-auto' : ''; |
|
55 | 55 | </script> |
56 | 56 |
|
57 | 57 | <div class="mb-6"> |
58 | | - <div class="relative {container_padding_class} {color('bg-slate-200/50')}"> |
| 58 | + <div class="relative {container_padding_class} bg-slate-200/50 bg-slate-700/50"> |
59 | 59 | {#if icon} |
60 | 60 | <div class="absolute z-0 top-0 bottom-0 left-0 ml-4 flex items-center {icon_class || ''}"> |
61 | 61 | <icon class="text-xl">{icon}</icon> |
|
64 | 64 | <svelte:element this={tag} |
65 | 65 | on:input={handle_input} |
66 | 66 | use:set_value={value} |
67 | | - class="relative z-10 block {height_class} w-full {padding_top_class} {color_class} border-b-2 {border_class} text-base {padding_left} {padding_right} bg-transparent focus:outline-none {color('focus:border-b-primary')} transition-colors {klass}" |
| 67 | + class="relative z-10 block {height_class} w-full {padding_top_class} {color_class} border-b-2 {border_class} text-base {padding_left} {padding_right} bg-transparent focus:outline-none focus:border-b-primary dark:focus:border-b-primary transition-colors {klass}" |
68 | 68 | {name} |
69 | 69 | {type} |
70 | 70 | value="{value}" |
|
91 | 91 | input:focus + label div, |
92 | 92 | input[value]:not([value=""]) + label div, |
93 | 93 | textarea:focus + label div, |
94 | | - textarea[value]:not([value=""]) + label div {@apply text-sm text-primary-700 dark:text-primary-dark-700 -translate-y-[60%];} |
| 94 | + textarea[value]:not([value=""]) + label div {@apply text-sm text-primary-700 dark:text-primary-200 -translate-y-[60%];} |
95 | 95 | textarea:focus + label div, |
96 | 96 | textarea[value]:not([value=""]) + label div {@apply pointer-events-auto;} |
97 | 97 | </style> |
|
0 commit comments