postcss-reduce-initial 5.1.1 → 6.0.0

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/README.md CHANGED
@@ -32,7 +32,7 @@ h1 {
32
32
 
33
33
  ```css
34
34
  h1 {
35
- min-width: 0;
35
+ min-width: auto;
36
36
  }
37
37
  ```
38
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss-reduce-initial",
3
- "version": "5.1.1",
3
+ "version": "6.0.0",
4
4
  "description": "Reduce initial definitions to the actual initial value, where possible.",
5
5
  "main": "src/index.js",
6
6
  "types": "types/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "url": "https://github.com/cssnano/cssnano/issues"
31
31
  },
32
32
  "engines": {
33
- "node": "^10 || ^12 || >=14.0"
33
+ "node": "^14 || ^16 || >=18.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/caniuse-api": "^3.0.2",
@@ -22,7 +22,6 @@
22
22
  "mask-clip": "border-box",
23
23
  "mask-mode": "match-source",
24
24
  "mask-origin": "border-box",
25
- "mask-repeat": "no-repeat",
26
25
  "mask-type": "luminance",
27
26
  "ruby-align": "space-around",
28
27
  "ruby-merge": "separate",
package/src/index.js CHANGED
@@ -8,12 +8,14 @@ const initial = 'initial';
8
8
 
9
9
  // In most of the browser including chrome the initial for `writing-mode` is not `horizontal-tb`. Ref https://github.com/cssnano/cssnano/pull/905
10
10
  const defaultIgnoreProps = ['writing-mode', 'transform-box'];
11
+ /** @typedef {{ignore?: string[]}} Options */
11
12
 
12
13
  /**
13
- * @type {import('postcss').PluginCreator<void>}
14
+ * @type {import('postcss').PluginCreator<Options>}
15
+ * @param {Options} options
14
16
  * @return {import('postcss').Plugin}
15
17
  */
16
- function pluginCreator() {
18
+ function pluginCreator(options = {}) {
17
19
  return {
18
20
  postcssPlugin: 'postcss-reduce-initial',
19
21
  /** @param {import('postcss').Result & {opts: browserslist.Options & {ignore?: string[]}}} result */
@@ -31,7 +33,7 @@ function pluginCreator() {
31
33
  css.walkDecls((decl) => {
32
34
  const lowerCasedProp = decl.prop.toLowerCase();
33
35
  const ignoreProp = new Set(
34
- defaultIgnoreProps.concat(resultOpts.ignore || [])
36
+ defaultIgnoreProps.concat(options.ignore || [])
35
37
  );
36
38
 
37
39
  if (ignoreProp.has(lowerCasedProp)) {
package/types/index.d.ts CHANGED
@@ -1,9 +1,15 @@
1
1
  export = pluginCreator;
2
+ /** @typedef {{ignore?: string[]}} Options */
2
3
  /**
3
- * @type {import('postcss').PluginCreator<void>}
4
+ * @type {import('postcss').PluginCreator<Options>}
5
+ * @param {Options} options
4
6
  * @return {import('postcss').Plugin}
5
7
  */
6
- declare function pluginCreator(): import('postcss').Plugin;
8
+ declare function pluginCreator(options?: Options): import('postcss').Plugin;
7
9
  declare namespace pluginCreator {
8
- const postcss: true;
10
+ export { postcss, Options };
9
11
  }
12
+ type Options = {
13
+ ignore?: string[];
14
+ };
15
+ declare var postcss: true;