postcss-minify-params 5.1.2 → 5.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -3
- package/src/index.js +3 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postcss-minify-params",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.3",
|
|
4
4
|
"description": "Minify at-rule params with PostCSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"postcss",
|
|
@@ -37,6 +37,5 @@
|
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"postcss": "^8.2.15"
|
|
40
|
-
}
|
|
41
|
-
"readme": "# postcss-minify-params [![Build Status][ci-img]][ci]\n\n> Minify at-rule params with PostCSS.\n\n```css\n@media only screen and ( min-width: 400px, min-height: 500px ) {\n h2{\n color:blue\n }\n}\n```\n\n```css\n@media only screen and (min-width:400px,min-height:500px) {\n h2{\n color:blue\n }\n}\n```\n\n## Usage\n\n```js\npostcss([ require('postcss-minify-params') ])\n```\n\nSee [PostCSS] docs for examples for your environment.\n\n## Contributors\n\nSee [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).\n\n## License\n\nMIT © [Bogdan Chadkin](mailto:trysound@yandex.ru)\n\n[PostCSS]: https://github.com/postcss/postcss\n[ci-img]: https://travis-ci.org/cssnano/postcss-minify-params.svg\n[ci]: https://travis-ci.org/cssnano/postcss-minify-params\n"
|
|
40
|
+
}
|
|
42
41
|
}
|
package/src/index.js
CHANGED
|
@@ -130,13 +130,7 @@ function transform(legacy, rule) {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
* @param {string} browser
|
|
135
|
-
* @return {boolean}
|
|
136
|
-
*/
|
|
137
|
-
function hasAllBug(browser) {
|
|
138
|
-
return ['ie 10', 'ie 11'].includes(browser);
|
|
139
|
-
}
|
|
133
|
+
const allBugBrowers = new Set(['ie 10', 'ie 11']);
|
|
140
134
|
|
|
141
135
|
/**
|
|
142
136
|
* @type {import('postcss').PluginCreator<browserslist.Options>}
|
|
@@ -150,11 +144,12 @@ function pluginCreator(options = {}) {
|
|
|
150
144
|
env: options.env,
|
|
151
145
|
});
|
|
152
146
|
|
|
147
|
+
const hasAllBug = browsers.some((browser) => allBugBrowers.has(browser));
|
|
153
148
|
return {
|
|
154
149
|
postcssPlugin: 'postcss-minify-params',
|
|
155
150
|
|
|
156
151
|
OnceExit(css) {
|
|
157
|
-
css.walkAtRules(transform
|
|
152
|
+
css.walkAtRules((rule) => transform(hasAllBug, rule));
|
|
158
153
|
},
|
|
159
154
|
};
|
|
160
155
|
}
|