diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-05-14 14:05:49 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-05-14 14:05:49 +0800 |
| commit | 06823fbf1c2e763a5bf76c3990ca98fbbcd98691 (patch) | |
| tree | 4280bece3888d12a022093bf1a9cd1b049393602 /node_modules/postcss-reduce-initial | |
| parent | 1368909b3cd552dbb0d12d5863c597f5be46177d (diff) | |
updated node_modules
Diffstat (limited to 'node_modules/postcss-reduce-initial')
4 files changed, 36 insertions, 20 deletions
diff --git a/node_modules/postcss-reduce-initial/package.json b/node_modules/postcss-reduce-initial/package.json index 915e8312..74096d26 100644 --- a/node_modules/postcss-reduce-initial/package.json +++ b/node_modules/postcss-reduce-initial/package.json @@ -1,6 +1,6 @@ { "name": "postcss-reduce-initial", - "version": "6.0.2", + "version": "6.1.0", "description": "Reduce initial definitions to the actual initial value, where possible.", "main": "src/index.js", "types": "types/index.d.ts", @@ -23,7 +23,7 @@ }, "repository": "cssnano/cssnano", "dependencies": { - "browserslist": "^4.22.2", + "browserslist": "^4.23.0", "caniuse-api": "^3.0.0" }, "bugs": { @@ -35,8 +35,7 @@ "devDependencies": { "@types/caniuse-api": "^3.0.6", "html-to-text": "^9.0.5", - "nanospy": "^1.0.0", - "postcss": "^8.4.32" + "postcss": "^8.4.35" }, "peerDependencies": { "postcss": "^8.4.31" diff --git a/node_modules/postcss-reduce-initial/src/data/fromInitial.json b/node_modules/postcss-reduce-initial/src/data/fromInitial.json index 459c965c..0bc22813 100644 --- a/node_modules/postcss-reduce-initial/src/data/fromInitial.json +++ b/node_modules/postcss-reduce-initial/src/data/fromInitial.json @@ -1,5 +1,4 @@ { - "-webkit-line-clamp": "none", "accent-color": "auto", "align-content": "normal", "align-items": "normal", @@ -26,7 +25,6 @@ "background-position-x": "0%", "background-position-y": "0%", "background-repeat": "repeat", - "block-overflow": "clip", "block-size": "auto", "border-block-style": "none", "border-block-width": "medium", @@ -182,7 +180,7 @@ "mask-border-width": "auto", "mask-composite": "add", "mask-image": "none", - "mask-position": "center", + "mask-position": "0% 0%", "mask-repeat": "repeat", "mask-size": "auto", "masonry-auto-flow": "pack", @@ -203,7 +201,7 @@ "offset-anchor": "auto", "offset-distance": "0", "offset-path": "none", - "offset-position": "auto", + "offset-position": "normal", "offset-rotate": "auto", "opacity": "1", "order": "0", @@ -313,7 +311,6 @@ "view-timeline-name": "none", "view-transition-name": "none", "white-space": "normal", - "white-space-trim": "none", "widows": "2", "width": "auto", "will-change": "auto", diff --git a/node_modules/postcss-reduce-initial/src/index.js b/node_modules/postcss-reduce-initial/src/index.js index 5432f7fe..90d18a71 100644 --- a/node_modules/postcss-reduce-initial/src/index.js +++ b/node_modules/postcss-reduce-initial/src/index.js @@ -1,14 +1,21 @@ 'use strict'; +const { dirname } = require('path'); const browserslist = require('browserslist'); const { isSupported } = require('caniuse-api'); const fromInitial = require('./data/fromInitial.json'); const toInitial = require('./data/toInitial.json'); +const ignoreProps = require('./lib/ignoreProps.js'); const initial = 'initial'; // In most of the browser including chrome the initial for `writing-mode` is not `horizontal-tb`. Ref https://github.com/cssnano/cssnano/pull/905 -const defaultIgnoreProps = ['writing-mode', 'transform-box']; -/** @typedef {{ignore?: string[]}} Options */ +const defaultIgnoreProps = ignoreProps; + +/** + * @typedef {{ overrideBrowserslist?: string | string[] }} AutoprefixerOptions + * @typedef {Pick<browserslist.Options, 'stats' | 'path' | 'env'>} BrowserslistOptions + * @typedef {{ignore?: string[]} & AutoprefixerOptions & BrowserslistOptions} Options + */ /** * @type {import('postcss').PluginCreator<Options>} @@ -18,13 +25,16 @@ const defaultIgnoreProps = ['writing-mode', 'transform-box']; function pluginCreator(options = {}) { return { postcssPlugin: 'postcss-reduce-initial', - /** @param {import('postcss').Result & {opts: browserslist.Options & {ignore?: string[]}}} result */ + + /** + * @param {import('postcss').Result & {opts: BrowserslistOptions & {file?: string}}} result + */ prepare(result) { - const resultOpts = result.opts || {}; - const browsers = browserslist(null, { - stats: resultOpts.stats, - path: __dirname, - env: resultOpts.env, + const { stats, env, from, file } = result.opts || {}; + const browsers = browserslist(options.overrideBrowserslist, { + stats: options.stats || stats, + path: options.path || dirname(from || file || __filename), + env: options.env || env, }); const initialSupport = isSupported('css-initial-value', browsers); diff --git a/node_modules/postcss-reduce-initial/types/index.d.ts b/node_modules/postcss-reduce-initial/types/index.d.ts index 1f9371f3..bc7f5573 100644 --- a/node_modules/postcss-reduce-initial/types/index.d.ts +++ b/node_modules/postcss-reduce-initial/types/index.d.ts @@ -1,5 +1,9 @@ export = pluginCreator; -/** @typedef {{ignore?: string[]}} Options */ +/** + * @typedef {{ overrideBrowserslist?: string | string[] }} AutoprefixerOptions + * @typedef {Pick<browserslist.Options, 'stats' | 'path' | 'env'>} BrowserslistOptions + * @typedef {{ignore?: string[]} & AutoprefixerOptions & BrowserslistOptions} Options + */ /** * @type {import('postcss').PluginCreator<Options>} * @param {Options} options @@ -7,9 +11,15 @@ export = pluginCreator; */ declare function pluginCreator(options?: Options): import('postcss').Plugin; declare namespace pluginCreator { - export { postcss, Options }; + export { postcss, AutoprefixerOptions, BrowserslistOptions, Options }; } type Options = { ignore?: string[]; -}; +} & AutoprefixerOptions & BrowserslistOptions; declare var postcss: true; +type AutoprefixerOptions = { + overrideBrowserslist?: string | string[]; +}; +type BrowserslistOptions = Pick<browserslist.Options, 'stats' | 'path' | 'env'>; +import browserslist = require("browserslist"); +//# sourceMappingURL=index.d.ts.map
\ No newline at end of file |
