6
6
7
7
/* Dropdown */
8
8
.select2-container--tailwindcss-3 .select2-container--open .select2-dropdown {
9
- @apply w-full py-1 mt-1 overflow-auto text-base bg-white border-none rounded-md shadow-lg max-h-60 ring-1 ring-black/5 ring-opacity-5 focus:outline-none sm:text-sm;
9
+ @apply w-full py-1 mt-1 overflow-auto text-base bg-white border-none rounded-md shadow-lg max-h-60 ring-1 ring-black/5 ring-opacity-5 focus:outline-none sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-indigo-600 dark:focus:border-indigo-600 ;
10
10
}
11
11
12
12
/* Dropdown position */
20
20
21
21
/* Search box */
22
22
.select2-container--tailwindcss-3 .select2-search--dropdown .select2-search__field {
23
- @apply block w-full px-3 py-1.5 text-sm placeholder-gray-400 border-gray-300 rounded-md shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 ;
23
+ @apply block w-full px-3 py-1.5 text-base sm:text-sm/6 placeholder-gray-400 border-gray-300 border rounded-md shadow-sm focus:border-indigo-600 focus:outline-none focus:ring-1 focus:ring-indigo-600 dark:bg-gray-700 ;
24
24
}
25
25
26
26
/* Results container */
30
30
31
31
/* Option items */
32
32
.select2-container--tailwindcss-3 .select2-results__option {
33
- @apply relative py-2 pl-3 text-gray-900 transition-colors duration-150 ease-in-out cursor-default select-none pr-9;
33
+ @apply relative py-2 pl-3 text-gray-900 transition-colors duration-150 ease-in-out cursor-default select-none pr-9 dark:text-white ;
34
34
}
35
35
36
36
/* Hover state */
37
37
.select2-container--tailwindcss-3 .select2-results__option--highlighted {
38
38
@apply text-white bg-indigo-600;
39
39
}
40
40
41
+ .select2-container--tailwindcss-3 .select2-results__option--highlighted ::after {
42
+ @apply text-white !important ;
43
+ }
44
+
41
45
/* Selected state */
42
46
.select2-container--tailwindcss-3 .select2-results__option--selected {
43
- @apply font-medium text-blue-900 bg-blue-100 ;
47
+ @apply font-semibold dark: text-white ;
44
48
}
45
49
46
50
/* Selected with checkmark */
47
51
.select2-container--tailwindcss-3 .select2-results__option--selected ::after {
48
- @apply absolute inset-y-0 flex items-center text-blue -600 right-3;
52
+ @apply absolute inset-y-0 flex items-center text-indigo -600 right-3;
49
53
content : "✓" ;
50
54
}
51
55
75
79
76
80
/* Loading spinner */
77
81
.select2-container--tailwindcss-3 .select2-results__option--loading ::after {
78
- @apply w-5 h-5 border-2 border-gray-300 rounded-full animate-spin border-t-blue -600;
82
+ @apply w-5 h-5 border-2 border-gray-300 rounded-full animate-spin border-t-indigo -600;
79
83
content : "" ;
80
84
}
81
85
82
86
/* Error states */
83
87
.field_with_errors .select2-container--tailwindcss-3 .select2-selection ,
84
88
select .is-invalid ~ .select2-container--tailwindcss-3 .select2-selection ,
85
89
select : invalid ~ .select2-container--tailwindcss-3 .select2-selection {
86
- @apply border-red-500 placeholder:text-red-300 text-red-900;
90
+ @apply border-red-500 text-red-900;
91
+ }
92
+ .field_with_errors .select2-container--tailwindcss-3 .select2-container--focus ,
93
+ select .is-invalid ~ .select2-container--tailwindcss-3 .select2-container--focus ,
94
+ select : invalid ~ .select2-container--tailwindcss-3 .select2-container--focus {
95
+ @apply ring-red-500 border-red-500 !important ;
96
+ }
97
+ .field_with_errors .select2-container--tailwindcss-3 .select2-selection__placeholder ,
98
+ select .is-invalid ~ .select2-container--tailwindcss-3 .select2-selection__placeholder ,
99
+ select : invalid ~ .select2-container--tailwindcss-3 .select2-selection__placeholder {
100
+ @apply text-red-300;
87
101
}
88
102
89
103
/* Single Selection */
90
104
.select2-container--tailwindcss-3 .select2-selection--single {
91
- @apply relative w-full h-9 py-1.5 pl-3 pr-8 text-left transition-colors duration-200 ease-in-out bg-white border border-gray-300 rounded-md cursor-default focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 sm:text-sm ;
105
+ @apply relative w-full h-auto min-h-[ 2.25 rem ] py-1.5 pl-3 pr-8 text-left text-base sm:text-sm/6 transition-colors duration-200 ease-in-out bg-white border border-gray-300 rounded-md cursor-default dark:bg-white/5 dark:text-white dark:border-white/10 ;
92
106
}
93
107
94
108
/* Rendered text */
95
109
.select2-container--tailwindcss-3 .select2-selection--single .select2-selection__rendered {
96
- @apply block pl-0 pr-0 text-gray-900 truncate;
110
+ @apply block pl-0 pr-0 text-gray-900 truncate dark:text-white ;
97
111
}
98
112
99
113
/* Placeholder */
100
114
.select2-container--tailwindcss-3 .select2-selection--single .select2-selection__placeholder {
101
- @apply text-gray-400;
115
+ @apply text-gray-400 dark:text-gray-500 ;
102
116
}
103
117
104
118
/* Arrow container */
@@ -108,26 +122,27 @@ select:invalid ~ .select2-container--tailwindcss-3 .select2-selection {
108
122
109
123
/* Arrow */
110
124
.select2-container--tailwindcss-3 .select2-selection--single .select2-selection__arrow b {
111
- @apply w-5 h-5 text-gray-400;
125
+ @apply w-5 h-5 text-gray-400 bg-center bg-no-repeat bg-contain ;
112
126
background-image : url ("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e" );
113
- background-position : center;
114
- background-repeat : no-repeat;
115
- background-size : contain;
116
127
}
117
128
118
129
/* Disabled state */
119
130
.select2-container--tailwindcss-3 .select2-container--disabled .select2-selection--single {
120
- @apply text-gray-500 cursor-not-allowed bg-gray-50;
131
+ @apply text-gray-500 cursor-not-allowed bg-gray-50 border-gray-200 dark:bg-white/20 dark:border-white/5;
132
+ }
133
+
134
+ .select2-container--tailwindcss-3 .select2-container--disabled .select2-container--focus .select2-selection--single {
135
+ @apply ring-0 border-gray-200 dark:border-white/5;
121
136
}
122
137
123
138
/* Clear button */
124
139
.select2-container--tailwindcss-3 .select2-selection--single .select2-selection__clear {
125
- @apply float-right pr-0 mr -0 font-bold text-gray-400 cursor-pointer hover:text-gray-600 ;
140
+ @apply font-bold absolute inset-y-0 right -0 flex items-center pr-[ 2 rem ] text-base sm:text-sm/6 text- gray-400 cursor-pointer hover:text-gray-700 ;
126
141
}
127
142
128
143
/* Focus styles for keyboard navigation */
129
144
.select2-container--tailwindcss-3 .select2-container--focus .select2-selection--single {
130
- @apply border-blue-500 ring-1 ring-blue-500 ;
145
+ @apply ring-1 ring-indigo-600 border-indigo-600 outline-none ;
131
146
}
132
147
133
148
/* RTL Support */
@@ -137,32 +152,40 @@ select:invalid ~ .select2-container--tailwindcss-3 .select2-selection {
137
152
138
153
/* Multiple selection */
139
154
.select2-container--tailwindcss-3 .select2-selection--multiple {
140
- @apply min-h-[2.25rem ] rounded-md border border-gray-300 bg-white py-1 px-2 focus: border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 ;
155
+ @apply min-h-[2.25rem ] h-auto rounded-md text-base sm:text-sm/6 bg-white py-1.5 px-3 border border-gray-300 cursor-default dark:bg-white/5 dark:text-white dark:border-white/10 ;
141
156
}
142
157
143
158
/* Multiple selection list */
144
159
.select2-container--tailwindcss-3 .select2-selection--multiple .select2-selection__rendered {
145
- @apply inline float-left ;
160
+ @apply flex flex-row flex-wrap gap-2 m-0 p-0 list-none ;
146
161
}
147
162
148
163
/* Multiple selection choices */
149
164
.select2-container--tailwindcss-3 .select2-selection--multiple .select2-selection__choice {
150
- @apply m-1 inline-flex items-center rounded-md bg-blue -100 px-2.5 py-0.5 text-sm font-medium text-blue -800;
165
+ @apply inline-flex items-center rounded-md bg-indigo -100 px-2.5 py-0.5 text-base sm:text-sm/6 font-medium text-indigo -800;
151
166
}
152
167
153
168
/* Remove button */
154
169
.select2-container--tailwindcss-3 .select2-selection--multiple .select2-selection__choice__remove {
155
- @apply -ml-1 mr-1.5 h-4 w-4 items-center flex justify-center rounded-full text-blue -600 hover:bg-blue-200 hover:text-blue -900;
170
+ @apply -ml-1 mr-1.5 h-4 w-4 pb-[ 0.10 rem ] items-center flex justify-center rounded-full text-indigo -600 hover:bg-blue-200 hover:text-indigo -900;
156
171
}
157
172
158
173
/* Search field in multiple selection */
174
+ .select2-container--tailwindcss-3 .select2-selection--multiple .select2-search--inline {
175
+ @apply block;
176
+ }
177
+
159
178
.select2-container--tailwindcss-3 .select2-selection--multiple .select2-search--inline .select2-search__field {
160
- @apply h-8 p-0 text-sm placeholder-gray-400 bg-transparent border-0 focus:outline-none focus:ring-0;
179
+ @apply h-[ 1.5 rem ] p-0 m-0 text-base sm:text-sm/6 bg-transparent border-0 focus:outline-none focus:ring-0 dark:placeholder:text-gray-500 placeholder:text-gray-400 ;
161
180
}
162
181
163
182
/* Disabled state */
164
183
.select2-container--tailwindcss-3 .select2-container--disabled .select2-selection--multiple {
165
- @apply text-gray-500 cursor-not-allowed bg-gray-50;
184
+ @apply text-gray-500 cursor-not-allowed bg-gray-50 border-gray-200 dark:bg-white/20 dark:border-white/5;
185
+ }
186
+
187
+ .select2-container--tailwindcss-3 .select2-container--disabled .select2-container--focus .select2-selection--multiple {
188
+ @apply ring-0 border-gray-200 dark:border-white/5;
166
189
}
167
190
168
191
/* Clearable state */
@@ -172,10 +195,10 @@ select:invalid ~ .select2-container--tailwindcss-3 .select2-selection {
172
195
173
196
/* Clear button */
174
197
.select2-container--tailwindcss-3 .select2-selection--multiple .select2-selection__clear {
175
- @apply absolute top- 0 right-0 mt-2 mr -4 font-bold text-gray-400 cursor-pointer hover:text-gray-600 ;
198
+ @apply font-bold absolute inset-y- 0 right-0 flex items-center pr -4 text-base sm: text-sm/6 text- gray-400 cursor-pointer hover:text-gray-700 ;
176
199
}
177
200
178
201
/* Focus styles for keyboard navigation */
179
202
.select2-container--tailwindcss-3 .select2-container--focus .select2-selection--multiple {
180
- @apply border-blue-500 ring-1 ring-blue-500 ;
203
+ @apply ring-1 ring-indigo-600 border-indigo-600 outline-none ;
181
204
}
0 commit comments