@@ -35,85 +35,26 @@ module.exports = function() {
35
35
} ;
36
36
const defaultLinearBorderGradientColors = { } ;
37
37
const defaultLinearBorderGradientVariants = [ 'responsive' ] ;
38
- const defaultRadialBorderGradientShapes = {
39
- 'default' : 'ellipse' ,
40
- } ;
41
- const defaultRadialBorderGradientSizes = {
42
- 'default' : 'closest-side' ,
43
- } ;
44
- const defaultRadialBorderGradientPositions = {
45
- 'default' : 'center' ,
46
- 't' : 'top' ,
47
- 'tr' : 'top right' ,
48
- 'r' : 'right' ,
49
- 'br' : 'bottom right' ,
50
- 'b' : 'bottom' ,
51
- 'bl' : 'bottom left' ,
52
- 'l' : 'left' ,
53
- 'tl' : 'top left' ,
54
- } ;
55
- const defaultRadialBorderGradientColors = { } ;
56
- const defaultRadialBorderGradientVariants = [ 'responsive' ] ;
57
38
const defaultRepeatingLinearBorderGradientDirections = defaultLinearBorderGradientDirections ;
58
39
const defaultRepeatingLinearBorderGradientColors = defaultLinearBorderGradientColors ;
59
40
const defaultRepeatingLinearBorderGradientLengths = { } ;
60
41
const defaultRepeatingLinearBorderGradientVariants = [ 'responsive' ] ;
61
- const defaultRepeatingRadialBorderGradientShapes = defaultRadialBorderGradientShapes ;
62
- const defaultRepeatingRadialBorderGradientSizes = {
63
- 'default' : 'farthest-corner' ,
64
- } ;
65
- const defaultRepeatingRadialBorderGradientPositions = defaultRadialBorderGradientPositions ;
66
- const defaultRepeatingRadialBorderGradientColors = defaultRadialBorderGradientColors ;
67
- const defaultRepeatingRadialBorderGradientLengths = { } ;
68
- const defaultRepeatingRadialBorderGradientVariants = [ 'responsive' ] ;
69
42
70
43
const linearBorderGradientDirections = theme ( 'linearBorderGradients.directions' , defaultLinearBorderGradientDirections ) ;
71
44
const linearBorderGradientColors = theme ( 'linearBorderGradients.colors' , defaultLinearBorderGradientColors ) ;
72
45
const linearBorderGradientVariants = variants ( 'linearBorderGradients' , defaultLinearBorderGradientVariants ) ;
73
- const radialBorderGradientShapes = theme ( 'radialBorderGradients.shapes' , defaultRadialBorderGradientShapes ) ;
74
- const radialBorderGradientSizes = theme ( 'radialBorderGradients.sizes' , defaultRadialBorderGradientSizes ) ;
75
- const radialBorderGradientPositions = theme ( 'radialBorderGradients.positions' , defaultRadialBorderGradientPositions ) ;
76
- const radialBorderGradientColors = theme ( 'radialBorderGradients.colors' , defaultRadialBorderGradientColors ) ;
77
- const radialBorderGradientVariants = variants ( 'radialBorderGradients' , defaultRadialBorderGradientVariants ) ;
78
46
const repeatingLinearBorderGradientDirections = theme ( 'repeatingLinearBorderGradients.directions' , defaultRepeatingLinearBorderGradientDirections ) ;
79
47
const repeatingLinearBorderGradientColors = theme ( 'repeatingLinearBorderGradients.colors' , defaultRepeatingLinearBorderGradientColors ) ;
80
48
const repeatingLinearBorderGradientLengths = theme ( 'repeatingLinearBorderGradients.lengths' , defaultRepeatingLinearBorderGradientLengths ) ;
81
49
const repeatingLinearBorderGradientVariants = variants ( 'repeatingLinearBorderGradients' , defaultRepeatingLinearBorderGradientVariants ) ;
82
- const repeatingRadialBorderGradientShapes = theme ( 'repeatingRadialBorderGradients.shapes' , defaultRepeatingRadialBorderGradientShapes ) ;
83
- const repeatingRadialBorderGradientSizes = theme ( 'repeatingRadialBorderGradients.sizes' , defaultRepeatingRadialBorderGradientSizes ) ;
84
- const repeatingRadialBorderGradientPositions = theme ( 'repeatingRadialBorderGradients.positions' , defaultRepeatingRadialBorderGradientPositions ) ;
85
- const repeatingRadialBorderGradientColors = theme ( 'repeatingRadialBorderGradients.colors' , defaultRepeatingRadialBorderGradientColors ) ;
86
- const repeatingRadialBorderGradientLengths = theme ( 'repeatingRadialBorderGradients.lengths' , defaultRepeatingRadialBorderGradientLengths ) ;
87
- const repeatingRadialBorderGradientVariants = variants ( 'repeatingRadialBorderGradients' , defaultRepeatingRadialBorderGradientVariants ) ;
88
50
89
51
const linearBorderGradientSelector = function ( directionKey , colorKey , lengthKey ) {
90
52
return `.${ e ( `border-gradient-${ directionKey } -${ colorKey } ${ lengthKey ? `-${ lengthKey } ` : '' } ` ) } ` ;
91
53
} ;
92
54
93
55
const linearBorderGradientValue = function ( direction , colors , length ) {
94
56
const cssDefaultLinearBorderGradientDirections = [ 'to bottom' , '180deg' , '0.5turn' , '200grad' , '3.1416rad' ] ;
95
- return `${ ! _ . isNil ( length ) ? 'repeating-' : '' } linear-gradient(${ _ . includes ( cssDefaultLinearBorderGradientDirections , direction ) ? '' : `${ direction } , ` } ${ colors . join ( ', ' ) } ${ length ? ` ${ length } ` : '' } )` ;
96
- } ;
97
-
98
- const radialBorderGradientSelector = function ( shapeKey , sizeKey , positionKey , colorKey , lengthKey ) {
99
- return `.${ e ( `border-radial${ shapeKey === 'default' ? '' : `-${ shapeKey } ` } ${ sizeKey === 'default' ? '' : `-${ sizeKey } ` } ${ positionKey === 'default' ? '' : `-${ positionKey } ` } -${ colorKey } ${ lengthKey ? `-${ lengthKey } ` : '' } ` ) } ` ;
100
- } ;
101
-
102
- const radialBorderGradientValue = function ( shape , size , position , colors , length ) {
103
- const cssDefaultRadialBorderGradientShape = 'ellipse' ;
104
- const cssDefaultRadialBorderGradientSize = 'farthest-corner' ;
105
- const cssDefaultRadialBorderGradientPositions = [ 'center' , 'center center' , '50%' , '50% 50%' , 'center 50%' , '50% center' ] ;
106
- let firstArgumentValues = [ ] ;
107
- if ( shape !== cssDefaultRadialBorderGradientShape ) {
108
- firstArgumentValues . push ( shape ) ;
109
- }
110
- if ( size !== cssDefaultRadialBorderGradientSize ) {
111
- firstArgumentValues . push ( size ) ;
112
- }
113
- if ( ! _ . includes ( cssDefaultRadialBorderGradientPositions , position ) ) {
114
- firstArgumentValues . push ( `at ${ position } ` ) ;
115
- }
116
- return `${ ! _ . isNil ( length ) ? 'repeating-' : '' } radial-gradient(${ firstArgumentValues . length > 0 ? `${ firstArgumentValues . join ( ' ' ) } , ` : '' } ${ colors . join ( ', ' ) } ${ length ? ` ${ length } ` : '' } )` ;
57
+ return `${ ! _ . isNil ( length ) ? 'repeating-' : '' } linear-gradient(${ _ . includes ( cssDefaultLinearBorderGradientDirections , direction ) ? '' : `${ direction } , ` } ${ colors . join ( ', ' ) } ${ length ? ` ${ length } ` : '' } ) 1` ;
117
58
} ;
118
59
119
60
const linearBorderGradientUtilities = ( function ( ) {
@@ -132,26 +73,6 @@ module.exports = function() {
132
73
return utilities ;
133
74
} ) ( ) ;
134
75
135
- const radialBorderGradientUtilities = ( function ( ) {
136
- let utilities = { } ;
137
- _ . forEach ( radialBorderGradientColors , ( colors , colorKey ) => {
138
- colors = normalizeColors ( colors , false ) ;
139
- if ( ! colors ) {
140
- return ; // continue
141
- }
142
- _ . forEach ( radialBorderGradientPositions , ( position , positionKey ) => {
143
- _ . forEach ( radialBorderGradientSizes , ( size , sizeKey ) => {
144
- _ . forEach ( radialBorderGradientShapes , ( shape , shapeKey ) => {
145
- utilities [ radialBorderGradientSelector ( shapeKey , sizeKey , positionKey , colorKey ) ] = {
146
- borderImage : radialBorderGradientValue ( shape , size , position , colors ) ,
147
- } ;
148
- } ) ;
149
- } ) ;
150
- } ) ;
151
- } ) ;
152
- return utilities ;
153
- } ) ( ) ;
154
-
155
76
const repeatingLinearBorderGradientUtilities = ( function ( ) {
156
77
let utilities = { } ;
157
78
_ . forEach ( repeatingLinearBorderGradientLengths , ( length , lengthKey ) => {
@@ -170,31 +91,7 @@ module.exports = function() {
170
91
return utilities ;
171
92
} ) ( ) ;
172
93
173
- const repeatingRadialBorderGradientUtilities = ( function ( ) {
174
- let utilities = { } ;
175
- _ . forEach ( repeatingRadialBorderGradientLengths , ( length , lengthKey ) => {
176
- _ . forEach ( repeatingRadialBorderGradientColors , ( colors , colorKey ) => {
177
- colors = normalizeColors ( colors , false ) ;
178
- if ( ! colors ) {
179
- return ; // continue
180
- }
181
- _ . forEach ( repeatingRadialBorderGradientPositions , ( position , positionKey ) => {
182
- _ . forEach ( repeatingRadialBorderGradientSizes , ( size , sizeKey ) => {
183
- _ . forEach ( repeatingRadialBorderGradientShapes , ( shape , shapeKey ) => {
184
- utilities [ radialBorderGradientSelector ( shapeKey , sizeKey , positionKey , colorKey , lengthKey ) ] = {
185
- borderImage : radialBorderGradientValue ( shape , size , position , colors , length ) ,
186
- } ;
187
- } ) ;
188
- } ) ;
189
- } ) ;
190
- } ) ;
191
- } ) ;
192
- return utilities ;
193
- } ) ( ) ;
194
-
195
94
addUtilities ( linearBorderGradientUtilities , linearBorderGradientVariants ) ;
196
- addUtilities ( radialBorderGradientUtilities , radialBorderGradientVariants ) ;
197
95
addUtilities ( repeatingLinearBorderGradientUtilities , repeatingLinearBorderGradientVariants ) ;
198
- addUtilities ( repeatingRadialBorderGradientUtilities , repeatingRadialBorderGradientVariants ) ;
199
96
} ;
200
97
} ;
0 commit comments