cssnano-preset-advanced 7.0.15 → 8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cssnano-preset-advanced",
3
- "version": "7.0.15",
3
+ "version": "8.0.0",
4
4
  "main": "src/index.js",
5
5
  "types": "types/index.d.ts",
6
6
  "description": "Advanced optimisations for cssnano; may or may not break your CSS!",
@@ -12,12 +12,13 @@
12
12
  "license": "MIT",
13
13
  "dependencies": {
14
14
  "autoprefixer": "^10.5.0",
15
- "browserslist": "^4.28.2",
16
- "cssnano-preset-default": "^7.0.15",
17
- "postcss-discard-unused": "^7.0.6",
18
- "postcss-merge-idents": "^7.0.2",
19
- "postcss-reduce-idents": "^7.0.3",
20
- "postcss-zindex": "^7.0.2"
15
+ "browserslist": "^4.28.1",
16
+ "css-declaration-sorter": "^7.4.0",
17
+ "cssnano-preset-default": "^8.0.0",
18
+ "postcss-discard-unused": "^8.0.0",
19
+ "postcss-merge-idents": "^8.0.0",
20
+ "postcss-reduce-idents": "^8.0.0",
21
+ "postcss-zindex": "^8.0.0"
21
22
  },
22
23
  "author": {
23
24
  "name": "Ben Briggs",
@@ -30,12 +31,12 @@
30
31
  "url": "https://github.com/cssnano/cssnano/issues"
31
32
  },
32
33
  "engines": {
33
- "node": "^18.12.0 || ^20.9.0 || >=22.0"
34
+ "node": "^22.11.0 || ^24.11.0 || >=26.0"
34
35
  },
35
36
  "devDependencies": {
36
- "postcss": "^8.5.10"
37
+ "postcss": "^8.5.14"
37
38
  },
38
39
  "peerDependencies": {
39
- "postcss": "^8.5.10"
40
+ "postcss": "^8.5.14"
40
41
  }
41
42
  }
package/src/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
+
2
3
  const defaultPreset = require('cssnano-preset-default');
4
+ const cssDeclarationSorter = require('css-declaration-sorter');
3
5
  const postcssDiscardUnused = require('postcss-discard-unused');
4
6
  const postcssMergeIdents = require('postcss-merge-idents');
5
7
  const postcssReduceIdents = require('postcss-reduce-idents');
@@ -13,6 +15,7 @@ const autoprefixer = require('autoprefixer');
13
15
 
14
16
  /**
15
17
  * @typedef {object} AdvancedOptions
18
+ * @property {SimpleOptions<Parameters<typeof cssDeclarationSorter>[0]>} [cssDeclarationSorter]
16
19
  * @property {autoprefixer.Options} [autoprefixer]
17
20
  * @property {SimpleOptions<import('postcss-discard-unused').Options>} [discardUnused]
18
21
  * @property {SimpleOptions} [mergeIdents]
@@ -56,6 +59,9 @@ function configurePlugins(plugins, opts = {}) {
56
59
  ? sharedProps.stats // Autoprefixer supports stats object only
57
60
  : undefined,
58
61
  },
62
+ cssDeclarationSorter: {
63
+ keepOverrides: true,
64
+ },
59
65
  };
60
66
 
61
67
  // Merge option properties for each plugin
@@ -91,6 +97,7 @@ function advancedPreset(opts = {}) {
91
97
  [postcssMergeIdents, 'mergeIdents'],
92
98
  [postcssReduceIdents, 'reduceIdents'],
93
99
  [postcssZindex, 'zindex'],
100
+ [cssDeclarationSorter, 'cssDeclarationSorter'],
94
101
  ],
95
102
  opts
96
103
  ),
package/types/index.d.ts CHANGED
@@ -15,6 +15,10 @@ type SimpleOptions<OptionsExtends extends object | void = void> = false | (Optio
15
15
  exclude?: true;
16
16
  });
17
17
  type AdvancedOptions = {
18
+ cssDeclarationSorter?: SimpleOptions<{
19
+ order?: ("alphabetical" | "concentric-css" | "smacss" | "frakto") | ((propertyNameA: string, propertyNameB: string) => -1 | 0 | 1) | undefined;
20
+ keepOverrides?: boolean;
21
+ } | undefined> | undefined;
18
22
  autoprefixer?: autoprefixer.Options | undefined;
19
23
  discardUnused?: SimpleOptions<postcssDiscardUnused.Options> | undefined;
20
24
  mergeIdents?: SimpleOptions<void> | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";AA0EA;;;;;GAKG;AACH,uCAHW,OAAO,GAAG,mBAAmB,GAAG,mBAAmB,GACjD;IAAE,OAAO,EAAE,CAAC,OAAO,SAAS,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,MAAM,OAAO,CAAC,CAAC,EAAE,CAAA;CAAE,CAoBzF;;;;mBAzF6B,cAAc,SAA9B,MAAM,GAAG,IAAK,WACf,KAAK,IAAG,cAAc,GAAG;IAAC,OAAO,CAAC,EAAE,IAAI,CAAA;CAAC,CAAA;;;;;;;;2BAazC,aAAa,CAAC,mBAAmB;2BACjC,aAAa,CAAC,mBAAmB;eACjC,aAAa,CAAC,OAAO,GAAG,eAAe"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";AAgFA;;;;;GAKG;AACH,uCAHW,OAAO,GAAG,mBAAmB,GAAG,mBAAmB,GACjD;IAAE,OAAO,EAAE,CAAC,OAAO,SAAS,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,MAAM,OAAO,CAAC,CAAC,EAAE,CAAA;CAAE,CAqBzF;;;;mBA9F6B,cAAc,SAA9B,MAAM,GAAG,IAAK,WACf,KAAK,IAAG,cAAc,GAAG;IAAC,OAAO,CAAC,EAAE,IAAI,CAAA;CAAC,CAAA;;;;;;;;;;;;2BAczC,aAAa,CAAC,mBAAmB;2BACjC,aAAa,CAAC,mBAAmB;eACjC,aAAa,CAAC,OAAO,GAAG,eAAe"}