@@ -20,6 +20,12 @@ const config: Config = {
20
20
flex : {
21
21
full : '0 0 100%' ,
22
22
} ,
23
+ strokeWidth : {
24
+ DEFAULT : '1' ,
25
+ '0' : '0' ,
26
+ '1' : '1' ,
27
+ '2' : '2' ,
28
+ } ,
23
29
screens : {
24
30
xs : '420px' ,
25
31
sm : '640px' ,
@@ -42,6 +48,11 @@ const config: Config = {
42
48
'14' : '14' ,
43
49
'15' : '15' ,
44
50
} ,
51
+ gradients : {
52
+ 'lime-violet' : 'linear-gradient(to right, #5029a6 0%, #8db600 100%)' ,
53
+ 'red-yellow' : 'linear-gradient(to right, #f83600 0%, #f9d423 100%)' ,
54
+ // Add more gradients as needed
55
+ } ,
45
56
colors : {
46
57
accent : '#8db600' ,
47
58
accent2 : '#5029a6' ,
@@ -599,6 +610,115 @@ const config: Config = {
599
610
}
600
611
addUtilities ( neonUtilities ) ;
601
612
} ) ,
613
+ plugin ( ( { theme, addUtilities } : { theme : any ; addUtilities : ( arg0 : any ) => void } ) => {
614
+ const innerGlowUtilities : Record < string , any > = { } ;
615
+ const colors = theme ( 'colors' ) ;
616
+ const opacities = theme ( 'opacity' , { } ) ;
617
+
618
+ for ( const colorName in colors ) {
619
+ if ( typeof colors [ colorName ] === 'object' ) {
620
+ const color1 = colors [ colorName ] [ 600 ] ;
621
+ const color2 = colors [ colorName ] [ 900 ] ;
622
+
623
+ // Add the regular glow without opacity
624
+ innerGlowUtilities [ `.inner-glow-${ colorName } ` ] = {
625
+ boxShadow : `inset 0 0 10px ${ color1 } , inset 10px 10px 40px ${ color2 } ` ,
626
+ } ;
627
+
628
+ // Add versions with opacity
629
+ for ( const opacityName in opacities ) {
630
+ const opacityValue = opacities [ opacityName ] ;
631
+
632
+ innerGlowUtilities [ `.inner-glow-${ colorName } -${ opacityName } ` ] = {
633
+ boxShadow : `inset 0 0 10px ${ color1 } ${ Math . round ( opacityValue * 255 )
634
+ . toString ( 16 )
635
+ . padStart ( 2 , '0' ) } , inset 10px 10px 40px ${ color2 } ${ Math . round ( opacityValue * 255 )
636
+ . toString ( 16 )
637
+ . padStart ( 2 , '0' ) } `,
638
+ } ;
639
+ }
640
+ }
641
+ }
642
+
643
+ addUtilities ( innerGlowUtilities ) ;
644
+ } ) ,
645
+
646
+ plugin ( function ( { addUtilities, theme } ) {
647
+ const gradients = theme ( 'gradients' , { } ) ;
648
+ const newUtilities : Record < string , any > = Object . keys ( gradients ) . reduce (
649
+ ( acc , key ) => {
650
+ acc [ `.text-gradient-${ key } ` ] = {
651
+ 'background-image' : gradients [ key as keyof typeof gradients ] ,
652
+ 'background-clip' : 'text' ,
653
+ '-webkit-background-clip' : 'text' ,
654
+ color : 'transparent' ,
655
+ } ;
656
+ return acc ;
657
+ } ,
658
+ { } as Record < string , any >
659
+ ) ;
660
+ addUtilities ( newUtilities ) ;
661
+ } ) ,
662
+ plugin ( function ( { addUtilities } ) {
663
+ const newUtilities = {
664
+ '.frosted-glass' : {
665
+ background : 'rgba(255, 255, 255, 0.25)' ,
666
+ 'backdrop-filter' : 'blur(10px)' ,
667
+ border : '1px solid rgba(255, 255, 255, 0.18)' ,
668
+ 'box-shadow' : '0 8px 32px 0 rgba(31, 38, 135, 0.37)' ,
669
+ } ,
670
+ '.frosted-glass-dark' : {
671
+ background : 'rgba(0, 0, 0, 0.25)' ,
672
+ 'backdrop-filter' : 'blur(10px)' ,
673
+ border : '1px solid rgba(0, 0, 0, 0.18)' ,
674
+ 'box-shadow' : '0 8px 32px 0 rgba(0, 0, 0, 0.37)' ,
675
+ } ,
676
+ } ;
677
+
678
+ addUtilities ( newUtilities ) ;
679
+ } ) ,
680
+ plugin ( function ( { addUtilities, theme } ) {
681
+ const strokeWidths = theme ( 'strokeWidth' , {
682
+ DEFAULT : '1' ,
683
+ '0' : '0.5' ,
684
+ '1' : '1' ,
685
+ '2' : '2' ,
686
+ } ) ;
687
+
688
+ const colors = theme ( 'colors' , { } ) ;
689
+
690
+ // Define the type of utilities object
691
+ const utilities : Record < string , Record < string , string > > = { } ;
692
+
693
+ // Generate stroke width utilities
694
+ Object . entries ( strokeWidths ) . forEach ( ( [ key , value ] ) => {
695
+ utilities [ `.text-stroke${ key === 'DEFAULT' ? '' : `-${ key } ` } ` ] = {
696
+ '-webkit-text-stroke-width' : `${ value } px` ,
697
+ 'paint-order' : 'stroke fill' ,
698
+ } ;
699
+ } ) ;
700
+
701
+ // Generate stroke color utilities
702
+ Object . entries ( colors as Record < string , string | Record < string , string > > ) . forEach (
703
+ ( [ colorName , color ] ) => {
704
+ if ( typeof color === 'string' ) {
705
+ utilities [ `.text-stroke-${ colorName } ` ] = {
706
+ '-webkit-text-stroke-color' : color ,
707
+ 'paint-order' : 'stroke fill' ,
708
+ } ;
709
+ } else if ( typeof color === 'object' && color !== null ) {
710
+ Object . entries ( color ) . forEach ( ( [ shade , shadeColor ] ) => {
711
+ utilities [ `.text-stroke-${ colorName } -${ shade } ` ] = {
712
+ '-webkit-text-stroke-color' : shadeColor ,
713
+ 'paint-order' : 'stroke fill' ,
714
+ } ;
715
+ } ) ;
716
+ }
717
+ }
718
+ ) ;
719
+
720
+ addUtilities ( utilities ) ;
721
+ } ) ,
602
722
] ,
603
723
} ;
604
724
export default config ;
0 commit comments