Skip to content

Commit aa07e4c

Browse files
committed
Migrate to using vitest instead of jest
1 parent 0d3574d commit aa07e4c

File tree

6 files changed

+1342
-2359
lines changed

6 files changed

+1342
-2359
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.DS_STORE
2+
coverage
23
node_modules

__snapshots__/index.test.js.snap

Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2+
3+
exports[`generates default utilities 1`] = `
4+
".text-fill {
5+
-webkit-text-fill-color: #eeeeee
6+
}
7+
.text-fill-black {
8+
-webkit-text-fill-color: #000
9+
}
10+
.text-fill-gray-100 {
11+
-webkit-text-fill-color: #f5f5f5
12+
}
13+
.text-fill-gray-200 {
14+
-webkit-text-fill-color: #eeeeee
15+
}
16+
.text-fill-gray-300 {
17+
-webkit-text-fill-color: #e0e0e0
18+
}
19+
.text-fill-gray-400 {
20+
-webkit-text-fill-color: #bdbdbd
21+
}
22+
.text-fill-gray-500 {
23+
-webkit-text-fill-color: #9e9e9e
24+
}
25+
.text-fill-gray-600 {
26+
-webkit-text-fill-color: #757575
27+
}
28+
.text-fill-gray-700 {
29+
-webkit-text-fill-color: #616161
30+
}
31+
.text-fill-gray-800 {
32+
-webkit-text-fill-color: #424242
33+
}
34+
.text-fill-gray-900 {
35+
-webkit-text-fill-color: #212121
36+
}
37+
.text-fill-transparent {
38+
-webkit-text-fill-color: transparent
39+
}
40+
.text-fill-white {
41+
-webkit-text-fill-color: #fff
42+
}
43+
.text-stroke {
44+
-webkit-text-stroke-color: #eeeeee
45+
}
46+
.text-stroke-black {
47+
-webkit-text-stroke-color: #000
48+
}
49+
.text-stroke-gray-100 {
50+
-webkit-text-stroke-color: #f5f5f5
51+
}
52+
.text-stroke-gray-200 {
53+
-webkit-text-stroke-color: #eeeeee
54+
}
55+
.text-stroke-gray-300 {
56+
-webkit-text-stroke-color: #e0e0e0
57+
}
58+
.text-stroke-gray-400 {
59+
-webkit-text-stroke-color: #bdbdbd
60+
}
61+
.text-stroke-gray-500 {
62+
-webkit-text-stroke-color: #9e9e9e
63+
}
64+
.text-stroke-gray-600 {
65+
-webkit-text-stroke-color: #757575
66+
}
67+
.text-stroke-gray-700 {
68+
-webkit-text-stroke-color: #616161
69+
}
70+
.text-stroke-gray-800 {
71+
-webkit-text-stroke-color: #424242
72+
}
73+
.text-stroke-gray-900 {
74+
-webkit-text-stroke-color: #212121
75+
}
76+
.text-stroke-transparent {
77+
-webkit-text-stroke-color: transparent
78+
}
79+
.text-stroke-white {
80+
-webkit-text-stroke-color: #fff
81+
}
82+
.text-stroke {
83+
-webkit-text-stroke-width: 1px
84+
}
85+
.text-stroke-0 {
86+
-webkit-text-stroke-width: 0px
87+
}
88+
.text-stroke-2 {
89+
-webkit-text-stroke-width: 2px
90+
}
91+
.text-stroke-4 {
92+
-webkit-text-stroke-width: 4px
93+
}
94+
.text-stroke-8 {
95+
-webkit-text-stroke-width: 8px
96+
}
97+
.paint-fms {
98+
paint-order: fill markers stroke
99+
}
100+
.paint-fsm {
101+
paint-order: fill stroke markers
102+
}
103+
.paint-mfs {
104+
paint-order: markers fill stroke
105+
}
106+
.paint-msf {
107+
paint-order: markers stroke fill
108+
}
109+
.paint-sfm {
110+
paint-order: stroke fill markers
111+
}
112+
.paint-smf {
113+
paint-order: stroke markers fill
114+
}"
115+
`;
116+
117+
exports[`utilities accept arbitrary values 1`] = `
118+
".text-fill-\\[lime\\] {
119+
-webkit-text-fill-color: lime
120+
}
121+
.text-stroke-\\[black\\] {
122+
-webkit-text-stroke-color: black
123+
}
124+
.text-stroke-\\[color\\:black\\] {
125+
-webkit-text-stroke-color: black
126+
}
127+
.text-stroke-\\[0\\.25rem\\] {
128+
-webkit-text-stroke-width: 0.25rem
129+
}
130+
.text-stroke-\\[length\\:0\\.25rem\\] {
131+
-webkit-text-stroke-width: 0.25rem
132+
}
133+
.paint-\\[stroke_fill_markers\\] {
134+
paint-order: stroke fill markers
135+
}"
136+
`;
137+
138+
exports[`utilities can be customized 1`] = `
139+
".text-fill {
140+
-webkit-text-fill-color: #38b2ac
141+
}
142+
.text-fill-black {
143+
-webkit-text-fill-color: #000
144+
}
145+
.text-fill-gray {
146+
-webkit-text-fill-color: #9e9e9e
147+
}
148+
.text-fill-transparent {
149+
-webkit-text-fill-color: transparent
150+
}
151+
.text-fill-white {
152+
-webkit-text-fill-color: #fff
153+
}
154+
.text-stroke {
155+
-webkit-text-stroke-color: #38b2ac
156+
}
157+
.text-stroke-transparent {
158+
-webkit-text-stroke-color: transparent
159+
}
160+
.text-stroke {
161+
-webkit-text-stroke-width: 1px
162+
}
163+
.text-stroke-lg {
164+
-webkit-text-stroke-width: 8px
165+
}
166+
.text-stroke-md {
167+
-webkit-text-stroke-width: 4px
168+
}
169+
.text-stroke-sm {
170+
-webkit-text-stroke-width: 2px
171+
}
172+
.paint-stroke {
173+
paint-order: stroke
174+
}"
175+
`;
176+
177+
exports[`utilities can use decimal values 1`] = `
178+
".text-stroke-0\\.5 {
179+
-webkit-text-stroke-width: 0.5px
180+
}"
181+
`;
182+
183+
exports[`utilities can use negative values 1`] = `
184+
".-text-stroke-4 {
185+
-webkit-text-stroke-width: -4px
186+
}"
187+
`;
188+
189+
exports[`variants accept arbitrary values 1`] = `
190+
".\\[\\&\\>\\*\\]\\:text-fill-\\[lime\\]>* {
191+
-webkit-text-fill-color: lime
192+
}"
193+
`;
194+
195+
exports[`variants can be customized 1`] = `
196+
".text-fill-white {
197+
-webkit-text-fill-color: #fff
198+
}
199+
.text-stroke {
200+
-webkit-text-stroke-color: #eeeeee
201+
}
202+
.text-stroke-black {
203+
-webkit-text-stroke-color: #000
204+
}
205+
.text-stroke {
206+
-webkit-text-stroke-width: 1px
207+
}
208+
.hover\\:text-fill-gray-300:hover {
209+
-webkit-text-fill-color: #e0e0e0
210+
}
211+
.focus\\:text-stroke-gray-900:focus {
212+
-webkit-text-stroke-color: #212121
213+
}
214+
@media (min-width: 640px) {
215+
.sm\\:text-stroke-2 {
216+
-webkit-text-stroke-width: 2px
217+
}
218+
}"
219+
`;

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
const flat = require('flat')
2-
const plugin = require('tailwindcss/plugin')
1+
import { flatten } from 'flat'
2+
import plugin from 'tailwindcss/plugin'
33

44
const normalizeValues = (config) => Object.fromEntries(
5-
Object.entries(flat(config, { delimiter: '-', maxDepth: 2 })).sort(([a], [b]) => a === 'DEFAULT' ? -1 : 1)
5+
Object.entries(flatten(config, { delimiter: '-', maxDepth: 2 })).sort(([a], [b]) => a === 'DEFAULT' ? -1 : 1)
66
)
77

88
module.exports = plugin(({ matchUtilities, theme }) => {

0 commit comments

Comments
 (0)