File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,8 @@ module.exports = postcss.plugin('postcss-filter-gradient', function (opts) {
253
253
opts . angleFallback === undefined ? true : opts . angleFallback ;
254
254
opts . skipMultiColor =
255
255
opts . skipMultiColor === undefined ? false : opts . skipMultiColor ;
256
+ opts . skipWarnings =
257
+ opts . skipWarnings === undefined ? true : opts . skipWarnings ;
256
258
257
259
return function ( root , result ) {
258
260
root . walkRules ( function ( rule ) {
@@ -261,15 +263,18 @@ module.exports = postcss.plugin('postcss-filter-gradient', function (opts) {
261
263
262
264
gradient = getGradientFromRule ( rule ) ;
263
265
264
- // if linear-gradient and `filter` both exist, warn users
265
- if ( gradient . value && hasFilter ( rule ) ) {
266
- rule . warn (
267
- result ,
268
- 'The `filter` declaration already exists, we have skipped this rule.'
269
- ) ;
270
- return ;
266
+ if ( opts . skipWarnings === false ) {
267
+ // if linear-gradient and `filter` both exist, warn users
268
+ if ( gradient . value && hasFilter ( rule ) ) {
269
+ rule . warn (
270
+ result ,
271
+ 'The `filter` declaration already exists, we have skipped this rule.'
272
+ ) ;
273
+ return ;
274
+ }
271
275
}
272
276
277
+
273
278
if ( gradient . warnings ) {
274
279
gradient . decl . warn ( result , gradient . warnings ) ;
275
280
}
You can’t perform that action at this time.
0 commit comments