Skip to content

Commit 653ac7a

Browse files
committed
wip
1 parent 48e8196 commit 653ac7a

14 files changed

+100
-97
lines changed

__tests__/basic-usage.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ test('basic usage', async () => {
3535
).toMatchInlineSnapshot(`
3636
"
3737
38-
38+
3939
+ :root {
4040
+ --colors-black: rgb(0, 0, 0);
4141
+ --colors-white: #ffffff;

__tests__/color-variable-helper.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ test('colorVariable helper', async () => {
6868
).toMatchInlineSnapshot(`
6969
"
7070
71-
71+
7272
+ :root {
7373
+ --colors-primary: #ff0;
7474
+ --colors-secondary: #000000;
@@ -195,7 +195,7 @@ test('colorVariable - background and text color', async () => {
195195
).toMatchInlineSnapshot(`
196196
"
197197
198-
198+
199199
+ .bg-indigo-400 {
200200
+ --tw-bg-opacity: 1;
201201
+ background-color: rgba(var(--colors-indigo-400), var(--tw-bg-opacity))
@@ -284,7 +284,7 @@ test('colorVariable - background and text color 2', async () => {
284284
).toMatchInlineSnapshot(`
285285
"
286286
287-
287+
288288
+ .bg-indigo-400 {
289289
+ --tw-bg-opacity: 1;
290290
+ background-color: rgba(var(--colors-indigo-400), var(--tw-bg-opacity))
@@ -361,7 +361,7 @@ test('colorVariable with gradient color stops', async () => {
361361
).toMatchInlineSnapshot(`
362362
"
363363
364-
364+
365365
+ :root {
366366
+ --colors-red-400: rgba(254,0,0,1);
367367
+ --colors-red-500: rgba(254,0,0,0.5);
@@ -437,7 +437,7 @@ test('colorVariable with gradient color stops (forceRGB)', async () => {
437437
).toMatchInlineSnapshot(`
438438
"
439439
440-
440+
441441
+ :root {
442442
+ --colors-red-400: 254,0,0;
443443
+ --colors-red-500: 254,0,0;

__tests__/css-selectors.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ test('css selectors', async () => {
5454
).toMatchInlineSnapshot(`
5555
"
5656
57-
57+
5858
+ #app {
5959
+ --colors-black: rgb(0, 0, 0);
6060
+ --colors-white: #ffffff

__tests__/dark-mode.test.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ test('only dark variables with default options and `class` mode', async () => {
2727
).toMatchInlineSnapshot(`
2828
"
2929
30-
30+
3131
+ :root.dark {
3232
+ --colors-primary: #ffffff
3333
+ }
@@ -66,14 +66,14 @@ test('only dark variables with default options and `media` mode', async () => {
6666
).toMatchInlineSnapshot(`
6767
"
6868
69-
69+
7070
+ @media (prefers-color-scheme: dark) {
7171
+ :root {
72-
+ --colors-primary: #ffffff
72+
+ --colors-primary: #ffffff
7373
+ }
7474
+
7575
+ .container {
76-
+ --colors-secondary: #000000
76+
+ --colors-secondary: #000000
7777
+ }
7878
+ }
7979
@@ -112,14 +112,14 @@ test('if the `darkMode` is set to `media`, the `darkSelector` and `darkToRoot` o
112112
).toMatchInlineSnapshot(`
113113
"
114114
115-
115+
116116
+ @media (prefers-color-scheme: dark) {
117117
+ :root {
118-
+ --colors-primary: #ffffff
118+
+ --colors-primary: #ffffff
119119
+ }
120120
+
121121
+ .container {
122-
+ --colors-secondary: #000000
122+
+ --colors-secondary: #000000
123123
+ }
124124
+ }
125125
@@ -157,7 +157,7 @@ test('only dark variables with darkToRoot option and `class` mode', async () =>
157157
).toMatchInlineSnapshot(`
158158
"
159159
160-
160+
161161
+ :root.dark {
162162
+ --colors-primary: #ffffff
163163
+ }
@@ -202,7 +202,7 @@ test('only dark variables with custom options and `class` mode', async () => {
202202
).toMatchInlineSnapshot(`
203203
"
204204
205-
205+
206206
+ :root.custom-dark-selector {
207207
+ --my-prefix-colors-primary: #ffffff
208208
+ }
@@ -245,14 +245,14 @@ test('only dark variables with variablePrefix and `media` mode', async () => {
245245
).toMatchInlineSnapshot(`
246246
"
247247
248-
248+
249249
+ @media (prefers-color-scheme: dark) {
250250
+ :root {
251-
+ --my-prefix-colors-primary: #ffffff
251+
+ --my-prefix-colors-primary: #ffffff
252252
+ }
253253
+
254254
+ .container {
255-
+ --my-prefix-colors-secondary: #000000
255+
+ --my-prefix-colors-secondary: #000000
256256
+ }
257257
+ }
258258
@@ -300,7 +300,7 @@ test('variables and dark variables with default options and `class` mode', async
300300
).toMatchInlineSnapshot(`
301301
"
302302
303-
303+
304304
+ :root {
305305
+ --colors-primary: #ffffff
306306
+ }
@@ -361,7 +361,7 @@ test('variables and dark variables with default options and `media` mode', async
361361
).toMatchInlineSnapshot(`
362362
"
363363
364-
364+
365365
+ :root {
366366
+ --colors-primary: #ffffff
367367
+ }
@@ -372,11 +372,11 @@ test('variables and dark variables with default options and `media` mode', async
372372
+
373373
+ @media (prefers-color-scheme: dark) {
374374
+ :root {
375-
+ --colors-primary: #ffffff
375+
+ --colors-primary: #ffffff
376376
+ }
377377
+
378378
+ .container {
379-
+ --colors-secondary: #000000
379+
+ --colors-secondary: #000000
380380
+ }
381381
+ }
382382
@@ -428,7 +428,7 @@ test('variables and dark variables with custom darkSelector and `class` mode', a
428428
).toMatchInlineSnapshot(`
429429
"
430430
431-
431+
432432
+ :root {
433433
+ --colors-primary: #ffffff
434434
+ }
@@ -493,7 +493,7 @@ test('variables and dark variables with darkToRoot option and `class` mode', asy
493493
).toMatchInlineSnapshot(`
494494
"
495495
496-
496+
497497
+ :root {
498498
+ --colors-primary: #ffffff
499499
+ }
@@ -560,7 +560,7 @@ test('variables and dark variables with custom options and `class` mode', async
560560
).toMatchInlineSnapshot(`
561561
"
562562
563-
563+
564564
+ :root {
565565
+ --my-prefix-colors-primary: #ffffff
566566
+ }

__tests__/extend-colors.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ test('extendColors', async () => {
5858
).toMatchInlineSnapshot(`
5959
"
6060
61-
61+
6262
+ :root {
6363
+ --colors-white: #ffffff;
6464
+ --colors-red-400: rgba(254,0,0,0.5);
@@ -211,7 +211,7 @@ test('extendColors with forceRGB', async () => {
211211
).toMatchInlineSnapshot(`
212212
"
213213
214-
214+
215215
+ :root {
216216
+ --colors-white: 255,255,255;
217217
+ --colors-red-400: 254,0,0;
@@ -341,7 +341,7 @@ test('extendColors (readme)', async () => {
341341
).toMatchInlineSnapshot(`
342342
"
343343
344-
344+
345345
+ :root {
346346
+ --colors-blue: #0065ff;
347347
+ --colors-red: #ff0000;
@@ -443,7 +443,7 @@ test('extendColors with forceRGB (readme)', async () => {
443443
).toMatchInlineSnapshot(`
444444
"
445445
446-
446+
447447
+ :root {
448448
+ --colors-blue: 0,101,255;
449449
+ --colors-red: 255,0,0;

__tests__/fallback.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ test('fallback', async () => {
8181
+ .bg-gray {
8282
+ background-color: var(--header-color, blue)
8383
+ }
84-
84+
8585
---
86-
86+
8787
+ .bg-opacity-50 {
8888
+ --tw-bg-opacity: 0.5
8989
+ }

__tests__/force-rgb.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ test('forceRGB option (enabled)', async () => {
5353
).toMatchInlineSnapshot(`
5454
"
5555
56-
56+
5757
+ :root {
5858
+ --colors-white: 255,255,255;
5959
+ --colors-red-400: 254,0,0;
@@ -171,7 +171,7 @@ test('forceRGB option (disabled)', async () => {
171171
).toMatchInlineSnapshot(`
172172
"
173173
174-
174+
175175
+ :root {
176176
+ --colors-white: #ffffff;
177177
+ --colors-red-400: rgba(254,0,0,0.5);
@@ -290,7 +290,7 @@ test('forceRGB option with extendColors', async () => {
290290
).toMatchInlineSnapshot(`
291291
"
292292
293-
293+
294294
+ :root {
295295
+ --colors-white: 255,255,255;
296296
+ --colors-red-400: 254,0,0;
@@ -412,7 +412,7 @@ test('extendColors (readme)', async () => {
412412
).toMatchInlineSnapshot(`
413413
"
414414
415-
415+
416416
+ :root {
417417
+ --colors-blue: #0065ff;
418418
+ --colors-red: #ff0000;
@@ -498,7 +498,7 @@ test('forceRGB for docs', async () => {
498498
).toMatchInlineSnapshot(`
499499
"
500500
501-
501+
502502
+ :root {
503503
+ --colors-green: 17,255,0
504504
+ }
@@ -571,7 +571,7 @@ test('forceRGB (disabled) for docs', async () => {
571571
).toMatchInlineSnapshot(`
572572
"
573573
574-
574+
575575
+ :root {
576576
+ --colors-green: #11ff00;
577577
+ --colors-green-rgb: 17,255,0

__tests__/format-variables.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ test('format variables [special characters must be removed from variable names]'
3535
).toMatchInlineSnapshot(`
3636
"
3737
38-
38+
3939
+ :root {
4040
+ --colors-hello-world: 100%;
4141
+ --colors-underscore-to-dash: 100%;

__tests__/issues.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ test('issue 23', async () => {
2727
).toMatchInlineSnapshot(`
2828
"
2929
30-
30+
3131
+ :root {
3232
+ --body-color: #000;
3333
+ --body-bg: #fff;

__tests__/nested-variables.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ test('nested variables', async () => {
5959
).toMatchInlineSnapshot(`
6060
"
6161
62-
62+
6363
+ :root {
6464
+ --colors: #111111;
6565
+ --colors-black: #000000;

0 commit comments

Comments
 (0)