4
4
< head >
5
5
< meta charset ="UTF-8 ">
6
6
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7
+ < meta http-equiv ="X-UA-Compatible " content ="ie=edge ">
8
+ < meta name ="description " content ="A Select2 theme for Tailwindcss ">
9
+ < meta name ="author " content ="Erim Icel ">
10
+
7
11
< title > Select2 Tailwindcss Theme</ title >
8
12
< link href ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/css/select2.min.css "
rel ="
stylesheet "
/>
9
13
< script src ="https://cdn.tailwindcss.com "> </ script >
10
14
11
15
< link href ="css/tailwind.css " rel ="stylesheet ">
12
- < link href ="https://cdn.jsdelivr.net/gh/erimicel/select2-tailwindcss-theme@1.0.0 /dist/select2-tailwindcss-theme-plain.min.css " rel ="stylesheet ">
16
+ < link href ="https://cdn.jsdelivr.net/gh/erimicel/select2-tailwindcss-theme@1.1.1 /dist/select2-tailwindcss-theme-plain.min.css " rel ="stylesheet ">
13
17
< link href ="css/select2-tailwindcss-theme-plain.min.css " rel ="stylesheet ">
14
18
< script src ="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js "> </ script >
15
19
< script src ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/js/select2.min.js "
> </ script >
16
20
</ head >
17
21
18
- < body class ="bg-gray-100 font-sans antialiased ">
22
+ < body class ="font-sans antialiased bg-gray-100 ">
19
23
20
- < header class ="bg-blue-600 text-white py-4 shadow ">
21
- < h1 class ="text-center text- xl font-bold "> Select2 Tailwindcss Theme Demo</ h1 >
24
+ < header class ="py-4 text-white bg-blue-600 shadow ">
25
+ < h1 class ="text-xl font-bold text-center "> Select2 Tailwindcss Theme Demo</ h1 >
22
26
</ header >
23
27
24
- < main class ="max-w-4xl mx-auto mt-8 p-6 bg-white rounded-lg shadow-lg ">
25
- < h2 class ="text-2xl font-semibold text-gray-800 mb-6 ">
28
+ < main class ="max-w-4xl p-6 mx-auto mt-8 bg-white rounded-lg shadow-lg ">
29
+ < h2 class ="mb-6 text-2xl font-semibold text-gray-800 ">
26
30
Examples of
27
31
< a href ="https://github.com/erimicel/select2-tailwindcss-theme " target ="_blank " class ="text-blue-600 ">
28
32
@erimicel/select2-tailwindcss-theme
@@ -32,7 +36,7 @@ <h2 class="text-2xl font-semibold text-gray-800 mb-6">
32
36
< form class ="space-y-4 ">
33
37
<!-- Single Select -->
34
38
< div >
35
- < label class ="block text-sm font-medium text-gray-700 mb-2 "> Example of single select</ label >
39
+ < label class ="block mb-2 text-sm font-medium text-gray-700 "> Example of single select</ label >
36
40
< select data-placeholder ="Choose one thing " data-allow-clear ="1 ">
37
41
< option > </ option >
38
42
< option > 1</ option >
@@ -45,7 +49,7 @@ <h2 class="text-2xl font-semibold text-gray-800 mb-6">
45
49
46
50
<!-- Tags Select -->
47
51
< div >
48
- < label class ="block text-sm font-medium text-gray-700 mb-2 "> Example of dynamic option creation</ label >
52
+ < label class ="block mb-2 text-sm font-medium text-gray-700 "> Example of dynamic option creation</ label >
49
53
< select multiple data-placeholder ="Type anything " data-allow-clear ="1 " data-tags ="1 ">
50
54
< option > Alaska</ option >
51
55
< option > Hawaii</ option >
@@ -55,7 +59,7 @@ <h2 class="text-2xl font-semibold text-gray-800 mb-6">
55
59
56
60
<!-- Multiple Select -->
57
61
< div >
58
- < label class ="block text-sm font-medium text-gray-700 mb-2 "> Example of multiple select</ label >
62
+ < label class ="block mb-2 text-sm font-medium text-gray-700 "> Example of multiple select</ label >
59
63
< select multiple data-placeholder ="Choose anything " data-allow-clear ="1 ">
60
64
< option > Alaska</ option >
61
65
< option > Hawaii</ option >
@@ -65,13 +69,13 @@ <h2 class="text-2xl font-semibold text-gray-800 mb-6">
65
69
66
70
<!-- Disabled Select -->
67
71
< div >
68
- < label class ="block text-sm font-medium text-gray-700 mb-2 "> Example of disabled select</ label >
72
+ < label class ="block mb-2 text-sm font-medium text-gray-700 "> Example of disabled select</ label >
69
73
< select disabled data-placeholder ="Cannot choose " data-allow-clear ="1 "> </ select >
70
74
</ div >
71
75
72
76
<!-- Multiple Disabled Select -->
73
77
< div >
74
- < label class ="block text-sm font-medium text-gray-700 mb-2 "> Example of disabled multiple select with selected items</ label >
78
+ < label class ="block mb-2 text-sm font-medium text-gray-700 "> Example of disabled multiple select with selected items</ label >
75
79
< select disabled multiple >
76
80
< option selected > Alaska</ option >
77
81
< option selected > Hawaii</ option >
@@ -80,7 +84,7 @@ <h2 class="text-2xl font-semibold text-gray-800 mb-6">
80
84
81
85
<!-- Select with Optgroup -->
82
86
< div >
83
- < label class ="block text-sm font-medium text-gray-700 mb-2 "> Example of select with optgroup</ label >
87
+ < label class ="block mb-2 text-sm font-medium text-gray-700 "> Example of select with optgroup</ label >
84
88
< select data-placeholder ="Choose one thing " data-allow-clear ="1 ">
85
89
< option > </ option >
86
90
< optgroup label ="Group A ">
@@ -98,9 +102,9 @@ <h2 class="text-2xl font-semibold text-gray-800 mb-6">
98
102
99
103
<!-- Input Group -->
100
104
< div >
101
- < label class ="block text-sm font-medium text-gray-700 mb-2 "> Example of input group (.input-group)</ label >
105
+ < label class ="block mb-2 text-sm font-medium text-gray-700 "> Example of input group (.input-group)</ label >
102
106
< div class ="flex input-group ">
103
- < span class ="flex shrink-0 items-center rounded-l-md bg-white px-3 text-base text-gray-500 border border-gray-300 sm:text-sm/6 "> Prepend</ span >
107
+ < span class ="flex items-center px-3 text-base text-gray-500 bg-white border border-gray-300 shrink-0 rounded-l-md sm:text-sm/6 "> Prepend</ span >
104
108
< select data-placeholder ="Choose one thing " data-allow-clear ="1 ">
105
109
< option > </ option >
106
110
< option > 1</ option >
@@ -109,35 +113,35 @@ <h2 class="text-2xl font-semibold text-gray-800 mb-6">
109
113
</ select >
110
114
</ div >
111
115
112
- < div class ="flex input-group mt-1 ">
116
+ < div class ="flex mt-1 input-group ">
113
117
< select data-placeholder ="Choose one thing " data-allow-clear ="1 ">
114
118
< option > </ option >
115
119
< option > 1</ option >
116
120
< option > 2</ option >
117
121
< option > 3</ option >
118
122
</ select >
119
- < span class ="flex shrink-0 items-center rounded-r-md bg-white px-3 text-base text-gray-500 border border-gray-300 sm:text-sm/6 "> Append</ span >
123
+ < span class ="flex items-center px-3 text-base text-gray-500 bg-white border border-gray-300 shrink-0 rounded-r-md sm:text-sm/6 "> Append</ span >
120
124
</ div >
121
125
122
- < div class ="flex input-group mt-1 ">
123
- < span class ="flex shrink-0 items-center rounded-l-md bg-white px-3 text-base text-gray-500 border border-gray-300 sm:text-sm/6 "> Prepend</ span >
126
+ < div class ="flex mt-1 input-group ">
127
+ < span class ="flex items-center px-3 text-base text-gray-500 bg-white border border-gray-300 shrink-0 rounded-l-md sm:text-sm/6 "> Prepend</ span >
124
128
< select data-placeholder ="Choose one thing " data-allow-clear ="1 ">
125
129
< option > </ option >
126
130
< option > 1</ option >
127
131
< option > 2</ option >
128
132
< option > 3</ option >
129
133
</ select >
130
- < span class ="flex shrink-0 items-center rounded-r-md bg-white px-3 text-base text-gray-500 border border-gray-300 sm:text-sm/6 "> Append</ span >
134
+ < span class ="flex items-center px-3 text-base text-gray-500 bg-white border border-gray-300 shrink-0 rounded-r-md sm:text-sm/6 "> Append</ span >
131
135
</ div >
132
136
</ div >
133
137
134
138
<!-- Validated Select -->
135
139
< div >
136
- < label class ="block text-sm font-medium text-gray-700 mb-2 "> Example of validated select (.is-valid, :invalid)</ label >
140
+ < label class ="block mb-2 text-sm font-medium text-gray-700 "> Example of validated select (.is-valid, :invalid)</ label >
137
141
< select class ="is-invalid " data-placeholder ="Invalid example " data-allow-clear ="1 ">
138
142
< option > </ option >
139
143
</ select >
140
- < p class ="text-sm text-red-500 mt-2 "> Something is wrong.</ p >
144
+ < p class ="mt-2 text-sm text-red-500 "> Something is wrong.</ p >
141
145
</ div >
142
146
</ form >
143
147
</ main >
0 commit comments