@@ -283,143 +283,3 @@ test('colorVariable - background and text color 2', async () => {
283283 "
284284 ` )
285285} )
286-
287- test ( 'colorVariable with gradient color stops' , async ( ) => {
288- expect (
289- await utils . diffOnly ( {
290- corePlugins : [ 'textColor' , 'textOpacity' , 'gradientColorStops' ] ,
291- content : [ utils . content ( ) ] ,
292-
293- darkMode : false ,
294- theme : {
295- screens : false ,
296- colors : {
297- red : {
298- 400 : colorVariable ( 'var(--colors-red-400)' ) , // RGBA
299- 500 : colorVariable ( 'var(--colors-red-500)' ) , // RGBA
300- 600 : colorVariable ( 'var(--colors-red-600)' ) , // HEX
301- } ,
302- } ,
303-
304- variables : {
305- DEFAULT : {
306- colors : {
307- red : {
308- 400 : 'rgba(254,0,0,1)' ,
309- 500 : 'rgba(254,0,0,0.5)' ,
310- 600 : '#a20606' ,
311- } ,
312- } ,
313- } ,
314- } ,
315- } ,
316-
317- plugins : [
318- tailwindcssVariables ( {
319- colorVariables : true ,
320- } ) ,
321- ] ,
322- } )
323- ) . toMatchInlineSnapshot ( `
324- "
325-
326-
327- + :root {
328- + --colors-red-400: rgba(254,0,0,1);
329- + --colors-red-500: rgba(254,0,0,0.5);
330- + --colors-red-600: #a20606;
331- + --colors-red-400-rgb: 254,0,0;
332- + --colors-red-500-rgb: 254,0,0;
333- + --colors-red-600-rgb: 162,6,6
334- + }
335- + .from-red-400 {
336- + --tw-gradient-from: rgb(var(--colors-red-400-rgb));
337- + --tw-gradient-to: rgba(var(--colors-red-400-rgb), 0);
338- + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)
339- + }
340- + .from-red-500 {
341- + --tw-gradient-from: rgb(var(--colors-red-500-rgb));
342- + --tw-gradient-to: rgba(var(--colors-red-500-rgb), 0);
343- + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)
344- + }
345- + .from-red-600 {
346- + --tw-gradient-from: rgb(var(--colors-red-600-rgb));
347- + --tw-gradient-to: rgba(var(--colors-red-600-rgb), 0);
348- + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)
349- + }
350- + .text-opacity-50 {
351- + --tw-text-opacity: 0.5
352- + }
353-
354- "
355- ` )
356- } )
357-
358- test ( 'colorVariable with gradient color stops (forceRGB)' , async ( ) => {
359- expect (
360- await utils . diffOnly ( {
361- corePlugins : [ 'textColor' , 'textOpacity' , 'gradientColorStops' ] ,
362- content : [ utils . content ( ) ] ,
363-
364- darkMode : false ,
365- theme : {
366- screens : false ,
367- colors : {
368- red : {
369- 400 : colorVariable ( 'var(--colors-red-400)' , true ) , // RGBA
370- 500 : colorVariable ( 'var(--colors-red-500)' , true ) , // RGBA
371- 600 : colorVariable ( 'var(--colors-red-600)' , true ) , // HEX
372- } ,
373- } ,
374-
375- variables : {
376- DEFAULT : {
377- colors : {
378- red : {
379- 400 : 'rgba(254,0,0,1)' ,
380- 500 : 'rgba(254,0,0,0.5)' ,
381- 600 : '#a20606' ,
382- } ,
383- } ,
384- } ,
385- } ,
386- } ,
387-
388- plugins : [
389- tailwindcssVariables ( {
390- colorVariables : true ,
391- forceRGB : true ,
392- } ) ,
393- ] ,
394- } )
395- ) . toMatchInlineSnapshot ( `
396- "
397-
398-
399- + :root {
400- + --colors-red-400: 254,0,0;
401- + --colors-red-500: 254,0,0;
402- + --colors-red-600: 162,6,6
403- + }
404- + .from-red-400 {
405- + --tw-gradient-from: rgb(var(--colors-red-400));
406- + --tw-gradient-to: rgba(var(--colors-red-400), 0);
407- + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)
408- + }
409- + .from-red-500 {
410- + --tw-gradient-from: rgb(var(--colors-red-500));
411- + --tw-gradient-to: rgba(var(--colors-red-500), 0);
412- + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)
413- + }
414- + .from-red-600 {
415- + --tw-gradient-from: rgb(var(--colors-red-600));
416- + --tw-gradient-to: rgba(var(--colors-red-600), 0);
417- + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)
418- + }
419- + .text-opacity-50 {
420- + --tw-text-opacity: 0.5
421- + }
422-
423- "
424- ` )
425- } )
0 commit comments