@@ -17,6 +17,7 @@ test('opacity variables are given to colors defined as closures', () => {
1717
1818 return `rgb(31,31,31)`
1919 } ,
20+ secondary : 'hsl(10, 50%, 50%)' ,
2021 } ,
2122 opacity : {
2223 50 : '0.5' ,
@@ -33,23 +34,47 @@ test('opacity variables are given to colors defined as closures', () => {
3334 . process ( '@tailwind utilities' , { from : undefined } )
3435 . then ( ( result ) => {
3536 const expected = `
36- .text-primary {
37- --tw-text-opacity: 1;
38- color: rgba(31,31,31,var(--tw-text-opacity))
39- }
40- .text-opacity-50 {
41- --tw-text-opacity: 0.5
42- }
43- .from-primary {
44- --tw-gradient-from: rgb(31,31,31);
45- --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(31, 31, 31, 0))
46- }
47- .via-primary {
48- --tw-gradient-stops: var(--tw-gradient-from), rgb(31,31,31), var(--tw-gradient-to, rgba(31, 31, 31, 0))
49- }
50- .to-primary {
51- --tw-gradient-to: rgb(31,31,31)
52- }
37+ .text-primary {
38+ --tw-text-opacity: 1;
39+ color: rgba(31, 31, 31, var(--tw-text-opacity));
40+ }
41+
42+ .text-secondary {
43+ --tw-text-opacity: 1;
44+ color: hsla(10, 50%, 50%, var(--tw-text-opacity));
45+ }
46+
47+ .text-opacity-50 {
48+ --tw-text-opacity: 0.5;
49+ }
50+
51+ .from-primary {
52+ --tw-gradient-from: rgb(31, 31, 31);
53+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(31, 31, 31, 0));
54+ }
55+
56+ .from-secondary {
57+ --tw-gradient-from: hsl(10, 50%, 50%);
58+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, hsla(10, 50%, 50%, 0));
59+ }
60+
61+ .via-primary {
62+ --tw-gradient-stops: var(--tw-gradient-from), rgb(31, 31, 31),
63+ var(--tw-gradient-to, rgba(31, 31, 31, 0));
64+ }
65+
66+ .via-secondary {
67+ --tw-gradient-stops: var(--tw-gradient-from), hsl(10, 50%, 50%),
68+ var(--tw-gradient-to, hsla(10, 50%, 50%, 0));
69+ }
70+
71+ .to-primary {
72+ --tw-gradient-to: rgb(31, 31, 31);
73+ }
74+
75+ .to-secondary {
76+ --tw-gradient-to: hsl(10, 50%, 50%);
77+ }
5378 `
5479
5580 expect ( result . css ) . toMatchCss ( expected )
0 commit comments