@@ -206,7 +206,6 @@ function gradientToFilter(gradient) {
206
206
filterString = filterGradient ( startColor , endColor , type ) ;
207
207
} catch ( e ) {
208
208
// The color format is not valid
209
- console . log ( e . message ) ;
210
209
return {
211
210
success : false ,
212
211
message : e . message + ' in `' + gradient + '`'
@@ -269,34 +268,36 @@ module.exports = postcss.plugin('postcss-filter-gradient', function (opts) {
269
268
gradient . decl . warn ( result , gradient . warnings ) ;
270
269
}
271
270
272
- if ( gradient . value ) {
273
- filter = gradientToFilter ( gradient . value ) ;
274
-
275
- // warn users when the gradient value is not valid.
276
- if ( ! filter . success ) {
277
- // gradient.decl.warn(result, '`' + gradient.value + '` is not a valid linear gradient value.');
278
- gradient . decl . warn ( result , filter . message ) ;
279
- return ;
280
- }
281
-
282
- if ( opts . skipMultiColor && filter . isMultiColor ) {
283
- return ;
284
- }
285
-
286
- if ( ! opts . angleFallback && filter . isFallback ) {
287
- return ;
288
- }
289
-
290
- // should warns developer
291
- if ( filter . isFallback ) {
292
- gradient . decl . warn ( result , filter . message ) ;
293
- }
294
-
295
- // append filter string
296
- gradient . decl . cloneAfter ( {
297
- prop : 'filter' , value : filter . string
298
- } ) ;
271
+ if ( ! gradient . value ) {
272
+ return ;
299
273
}
274
+
275
+ filter = gradientToFilter ( gradient . value ) ;
276
+
277
+ // warn users when the gradient value is not valid.
278
+ if ( ! filter . success ) {
279
+ // gradient.decl.warn(result, '`' + gradient.value + '` is not a valid linear gradient value.');
280
+ gradient . decl . warn ( result , filter . message ) ;
281
+ return ;
282
+ }
283
+
284
+ if ( opts . skipMultiColor && filter . isMultiColor ) {
285
+ return ;
286
+ }
287
+
288
+ if ( ! opts . angleFallback && filter . isFallback ) {
289
+ return ;
290
+ }
291
+
292
+ // warns developer when `filter.message` is not empty
293
+ if ( filter . message ) {
294
+ gradient . decl . warn ( result , filter . message ) ;
295
+ }
296
+
297
+ // append filter string
298
+ gradient . decl . cloneAfter ( {
299
+ prop : 'filter' , value : filter . string
300
+ } ) ;
300
301
} else {
301
302
rule . warn (
302
303
result ,
0 commit comments