postcss-preset-env 10.2.4 → 10.3.1
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/CHANGELOG.md +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +114 -108
- package/dist/index.mjs +1 -1
- package/package.json +22 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Changes to PostCSS Preset Env
|
|
2
2
|
|
|
3
|
-
### 10.
|
|
3
|
+
### 10.3.1
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
_August 27, 2025_
|
|
6
6
|
|
|
7
|
-
- Updated [
|
|
7
|
+
- Updated [`css-has-pseudo`](https://github.com/csstools/postcss-plugins/tree/main/plugins/css-has-pseudo) to [`7.0.3`](https://github.com/csstools/postcss-plugins/tree/main/plugins/css-has-pseudo/CHANGELOG.md#703) (patch)
|
|
8
8
|
|
|
9
9
|
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugin-packs/postcss-preset-env/CHANGELOG.md)
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var s=require("autoprefixer"),e=require("cssdb"),o=require("browserslist"),t=require("@csstools/postcss-initial"),i=require("postcss-pseudo-class-any-link"),r=require("css-blank-pseudo"),a=require("postcss-page-break"),c=require("@csstools/postcss-cascade-layers"),n=require("postcss-attribute-case-insensitive"),p=require("postcss-clamp"),l=require("@csstools/postcss-color-function"),u=require("postcss-color-functional-notation"),m=require("@csstools/postcss-color-mix-function"),d=require("@csstools/postcss-color-mix-variadic-function-arguments"),g=require("@csstools/postcss-content-alt-text"),f=require("postcss-custom-media"),h=require("postcss-custom-properties"),b=require("postcss-custom-selectors"),v=require("postcss-dir-pseudo-class"),N=require("@csstools/postcss-normalize-display-values"),k=require("postcss-double-position-gradients"),y=require("@csstools/postcss-exponential-functions"),w=require("@csstools/postcss-logical-float-and-clear"),q=require("postcss-focus-visible"),x=require("postcss-focus-within"),F=require("@csstools/postcss-font-format-keywords"),$=require("postcss-font-variant"),O=require("@csstools/postcss-gamut-mapping"),S=require("postcss-gap-properties"),C=require("@csstools/postcss-gradients-interpolation-method"),P=require("css-has-pseudo"),E=require("postcss-color-hex-alpha"),I=require("@csstools/postcss-hwb-function"),A=require("@csstools/postcss-ic-unit"),B=require("postcss-image-set-function"),L=require("@csstools/postcss-is-pseudo-class"),_=require("postcss-lab-function"),U=require("@csstools/postcss-light-dark-function"),j=require("@csstools/postcss-logical-overflow"),M=require("@csstools/postcss-logical-overscroll-behavior"),z=require("postcss-logical"),D=require("@csstools/postcss-logical-resize"),R=require("@csstools/postcss-logical-viewport-units"),T=require("@csstools/postcss-media-queries-aspect-ratio-number-values"),V=require("@csstools/postcss-media-minmax"),H=require("@csstools/postcss-nested-calc"),W=require("postcss-nesting"),G=require("postcss-selector-not"),K=require("@csstools/postcss-oklab-function"),Z=require("postcss-opacity-percentage"),Q=require("postcss-overflow-shorthand"),J=require("postcss-replace-overflow-wrap"),X=require("postcss-place"),Y=require("css-prefers-color-scheme"),ss=require("@csstools/postcss-progressive-custom-properties"),es=require("@csstools/postcss-random-function"),os=require("postcss-color-rebeccapurple"),ts=require("@csstools/postcss-relative-color-syntax"),is=require("@csstools/postcss-scope-pseudo-class"),rs=require("@csstools/postcss-sign-functions"),as=require("@csstools/postcss-stepped-value-functions"),cs=require("@csstools/postcss-text-decoration-shorthand"),ns=require("@csstools/postcss-trigonometric-functions"),ps=require("@csstools/postcss-unset-value");const ls={"blank-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-blank-pseudo/README.md#browser","focus-visible-pseudo-class":"https://github.com/WICG/focus-visible","focus-within-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/postcss-focus-within/README.md#browser","has-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-has-pseudo/README.md#browser","prefers-color-scheme-query":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-prefers-color-scheme/README.md#browser"},us=["blank-pseudo-class","focus-visible-pseudo-class","focus-within-pseudo-class","has-pseudo-class","prefers-color-scheme-query"];function logFeaturesList(s,e,o){if(e.debug){o.log("Enabling the following feature(s):");const t=[],i=[];!1!==e.autoprefixer&&i.push(" autoprefixer"),s.forEach((s=>{s.id.startsWith("before")||s.id.startsWith("after")?i.push(` ${s.id} (injected via options)`):i.push(` ${s.id}`),void 0!==ls[s.id]&&t.push(s.id)})),i.sort(((s,e)=>s.localeCompare(e))),t.sort(((s,e)=>s.localeCompare(e))),i.forEach((s=>o.log(s))),t.length&&(o.log("These feature(s) need a browser library to work:"),t.forEach((s=>o.log(` ${s}: ${ls[s]}`))))}}function initializeSharedOptions(s){if("preserve"in s){const e={};return e.preserve=s.preserve,e}return!1}function clamp(s,e,o){return Math.max(s,Math.min(e,o))}function stageFromOptions(s,e){let o=2;if(void 0===s.stage)return e.log("Using features from Stage 2 (default)."),o;if(!1===s.stage)o=5;else{let e=parseInt(s.stage,10);Number.isNaN(e)&&(e=0),o=clamp(0,e,5)}return 5===o?e.log('Stage has been disabled, features will be handled via the "features" option.'):e.log(`Using features from Stage ${o}.`),o}const ms=Symbol("insertBefore"),ds=Symbol("insertAfter"),gs=Symbol("insertOrder"),fs=Symbol("plugin");function getTransformedInsertions(s,e,o){if("insertBefore"!==o&&"insertAfter"!==o)return[];const t="insertBefore"===o?ms:ds,i=[];for(const o in e){if(!Object.hasOwnProperty.call(e,o))continue;if(!s.find((s=>s.id===o)))continue;let r=e[o];Array.isArray(r)||(r=[r]);for(let s=0;s<r.length;s++)i.push({id:o,[fs]:r[s],[gs]:s,[t]:!0})}return i}var hs=["custom-media-queries","environment-variables","image-set-function","media-query-ranges","media-queries-aspect-ratio-number-values","prefers-color-scheme-query","nesting-rules","custom-selectors","any-link-pseudo-class","case-insensitive-attributes","focus-visible-pseudo-class","focus-within-pseudo-class","not-pseudo-class","logical-properties-and-values","float-clear-logical-values","logical-overflow","logical-overscroll-behavior","logical-resize","logical-viewport-units","dir-pseudo-class","all-property","gradients-interpolation-method","color-mix-variadic-function-arguments","color-mix","relative-color-syntax","lab-function","oklab-function","color-function","hwb-function","color-functional-notation","rebeccapurple-color","hexadecimal-alpha-notation","light-dark-function","double-position-gradients","blank-pseudo-class","break-properties","font-variant-property","is-pseudo-class","scope-pseudo-class","has-pseudo-class","gap-properties","overflow-property","overflow-wrap-property","place-properties","system-ui-font-family","font-format-keywords","display-two-values","content-alt-text","ic-unit","opacity-percentage","text-decoration-shorthand","unset-value","random-function","sign-functions","stepped-value-functions","trigonometric-functions","exponential-functions","clamp","nested-calc","custom-properties","cascade-layers","progressive-custom-properties","gamut-mapping"];function featureIsLess(s,e){return s.id===e.id?s[ms]&&e[ms]||s[ds]&&e[ds]?clamp(-1,s[gs]-e[gs],1):s[ms]||e[ds]?-1:s[ds]||e[ms]?1:0:clamp(-1,hs.indexOf(s.id)-hs.indexOf(e.id),1)}function postcssSystemUiFont(){return{postcssPlugin:"postcss-system-ui-font",Declaration(s){bs.test(s.prop)&&(s.value.includes(ks)||(s.value=s.value.replace(ys,ws)))}}}postcssSystemUiFont.postcss=!0;const bs=/(?:^(?:-|\\002d){2})|(?:^font(?:-family)?$)/i,vs="[\\f\\n\\r\\x09\\x20]",Ns=["system-ui","-apple-system","Segoe UI","Roboto","Ubuntu","Cantarell","Noto Sans","sans-serif"],ks=Ns.join(", "),ys=new RegExp(`(^|,|${vs}+)(?:system-ui${vs}*)(?:,${vs}*(?:${Ns.join("|")})${vs}*)?(,|$)`,"i"),ws=`$1${ks}$2`,qs=new Map([["all-property",t],["any-link-pseudo-class",i],["blank-pseudo-class",r],["break-properties",a],["cascade-layers",c],["case-insensitive-attributes",n],["clamp",p],["color-function",l],["color-functional-notation",u],["color-mix",m],["color-mix-variadic-function-arguments",d],["content-alt-text",g],["custom-media-queries",f],["custom-properties",h],["custom-selectors",b],["dir-pseudo-class",v],["display-two-values",N],["double-position-gradients",k],["exponential-functions",y],["float-clear-logical-values",w],["focus-visible-pseudo-class",q],["focus-within-pseudo-class",x],["font-format-keywords",F],["font-variant-property",$],["gamut-mapping",O],["gap-properties",S],["gradients-interpolation-method",C],["has-pseudo-class",P],["hexadecimal-alpha-notation",E],["hwb-function",I],["ic-unit",A],["image-set-function",B],["is-pseudo-class",L],["lab-function",_],["light-dark-function",U],["logical-overflow",j],["logical-overscroll-behavior",M],["logical-properties-and-values",z],["logical-resize",D],["logical-viewport-units",R],["media-queries-aspect-ratio-number-values",T],["media-query-ranges",V],["nested-calc",H],["nesting-rules",W],["not-pseudo-class",G],["oklab-function",K],["opacity-percentage",Z],["overflow-property",Q],["overflow-wrap-property",J],["place-properties",X],["prefers-color-scheme-query",Y],["progressive-custom-properties",ss],["random-function",es],["rebeccapurple-color",os],["relative-color-syntax",ts],["scope-pseudo-class",is],["sign-functions",rs],["stepped-value-functions",as],["system-ui-font-family",postcssSystemUiFont],["text-decoration-shorthand",cs],["trigonometric-functions",ns],["unset-value",ps]]);function featureIsInsertedOrHasAPlugin(s){return!!s[ms]||(!!s[ds]||!!qs.has(s.id))}function prepareFeaturesList(s,e,o){return s.concat(getTransformedInsertions(s,e,"insertBefore"),getTransformedInsertions(s,o,"insertAfter")).filter((s=>featureIsInsertedOrHasAPlugin(s))).sort(((s,e)=>featureIsLess(s,e)))}function getOptionsForBrowsersByFeature(s,e,o,t){switch(e.id){case"is-pseudo-class":return{onComplexSelector:"warning"};case"any-link-pseudo-class":if(s.find((s=>s.startsWith("ie ")||"edge 12"===s||"edge 13"===s||"edge 14"===s||"edge 15"===s||"edge 16"===s||"edge 17"===s||"edge 18"===s)))return t.log("- 'any-link-pseudo-class' setting 'subFeatures: { areaHrefNeedsFixing: true }' due to lack of browser support for area[href] in Edge and IE."),{subFeatures:{areaHrefNeedsFixing:!0}};return{};case"logical-properties-and-values":case"float-clear-logical-values":case"logical-resize":case"logical-viewport-units":case"logical-overflow":case"logical-overscroll-behavior":return"logical"in o?o.logical:{};default:return{}}}const xs=["and_chr","and_ff","android","chrome","edge","firefox","ie","ios_saf","op_mini","op_mob","opera","safari","samsung"];function getUnsupportedBrowsersByFeature(s){if(!s)return[];if(!("browser_support"in s))return["> 0%"];const e=[];return xs.forEach((o=>{if("op_mini"===o&&void 0===s.browser_support[o])return void e.push("op_mini all");const t=s.browser_support[o];"string"==typeof t&&Fs.test(t)?e.push(`${o} < ${s.browser_support[o]}`):e.push(`${o} >= 1`)})),e}const Fs=/^[0-9|.]+$/;function formatPolyfillableFeature(s){const e=getUnsupportedBrowsersByFeature(s);if(s[ms]||s[ds]){let o=s.id;return o=s.insertBefore?`before-${o}`:`after-${o}`,{browsers:e,vendors_implementations:s.vendors_implementations,plugin:s[fs],id:o,stage:6}}return{browsers:e,vendors_implementations:s.vendors_implementations,plugin:qs.get(s.id),id:s.id,stage:s.stage}}function formatStagedFeature(s,e,o,t,i,r){let a,c;return a=getOptionsForBrowsersByFeature(s,o,i,r),a=t?Object.assign({},a,t,featureOptions(e,o.id)):Object.assign({},a,featureOptions(e,o.id)),"progressive-custom-properties"!==o.id&&(a.enableProgressiveCustomProperties=!1),"overflow-wrap-property"===o.id&&"preserve"in a&&(a.method=a.preserve?"copy":"replace"),c=o.plugin.postcss&&"function"==typeof o.plugin?o.plugin(a):o.plugin&&o.plugin.default&&"function"==typeof o.plugin.default&&o.plugin.default.postcss?o.plugin.default(a):o.plugin,{browsers:o.browsers,vendors_implementations:o.vendors_implementations,plugin:c,pluginOptions:a,id:o.id}}function featureOptions(s,e){if(!(e in s))return;const o=s[e];return Array.isArray(o)?o[1]:o}function intOrZero(s){const e=parseInt(s,10);return Number.isNaN(e)?0:e}const $s=new Set(["progressive-custom-properties"]);function listFeatures(s,e,t,i){const r=Object(e.features),a="enableClientSidePolyfills"in e&&e.enableClientSidePolyfills,c=Object(e.insertBefore),n=Object(e.insertAfter),p=e.browsers?void 0:e.env,l=e.browsers,u=clamp(0,intOrZero(e.minimumVendorImplementations),3);u>0&&i.log(`Using features with ${u} or more vendor implementations.`);const m=stageFromOptions(e,i),d=prepareFeaturesList([...s,{id:"progressive-custom-properties"}],c,n).map((s=>formatPolyfillableFeature(s))).filter((s=>!!$s.has(s.id)||(0===u||(!(!s[ms]&&!s[ds])||(u<=s.vendors_implementations||(!0===featureEnabledByOptions(r,s.id)?(i.log(`- '${s.id}' enabled manually even when it lacks the required interop (${s.vendors_implementations} out of ${u}).`),!0):(i.log(`- '${s.id}' disabled because it lacks the required interop (${s.vendors_implementations} out of ${u}).`),!1))))))),g=o(l,{env:p,ignoreUnknownVersions:!0}).filter((s=>xs.includes(s.split(" ")[0])));return d.filter((s=>{if($s.has(s.id))return!0;const e=s.stage>=m,o=a||!us.includes(s.id),t=featureEnabledByOptions(r,s.id),c=!1===t,n=!0===t||e&&o;return c?i.log(`- '${s.id}' disabled manually`):e?o||i.log(`- '${s.id}' disabled because 'enableClientSidePolyfills' is 'false'.`):n?i.log(`- '${s.id}' enabled manually even when it lacks the required stage (${s.stage} out of ${m}).`):i.log(`- '${s.id}' disabled because it lacks the required stage (${s.stage} out of ${m}).`),!c&&n})).map((s=>formatStagedFeature(g,r,s,t,e,i))).filter((s=>{if($s.has(s.id))return!0;const e=featureEnabledByOptions(r,s.id);if(!0===e||!1===e)return e;const t=o(s.browsers,{ignoreUnknownVersions:!0}),a=g.filter((s=>t.some((e=>e===s))));return a.length>0?i.log(`- '${s.id}' enabled for:\n ${a.join("\n ")}`):i.log(`- '${s.id}' disabled because all targeted browsers support it.`),a.length>0}))}function featureEnabledByOptions(s,e){if(!(e in s))return"auto";const o=s[e];return Array.isArray(o)?!0===o[0]||!1!==o[0]&&"auto":Boolean(o)}class Logger{constructor(){this.logs=[]}log(s){this.logs.push(s)}resetLogger(){this.logs.length=0}emitLogs(s){s&&s.warn(this.logs.join("\n")),this.resetLogger()}}var Os=[{packageName:"css-blank-pseudo",id:"blank-pseudo-class",importName:"postcssBlankPseudo"},{packageName:"css-has-pseudo",id:"has-pseudo-class",importName:"postcssHasPseudo"},{packageName:"css-prefers-color-scheme",id:"prefers-color-scheme-query",importName:"postcssPrefersColorScheme"},{packageName:"postcss-attribute-case-insensitive",id:"case-insensitive-attributes",importName:"postcssAttributeCaseInsensitive"},{packageName:"postcss-clamp",id:"clamp",importName:"postcssClamp"},{packageName:"@csstools/postcss-color-mix-variadic-function-arguments",id:"color-mix-variadic-function-arguments",importName:"postcssColorMixVariadicFunctionArguments"},{packageName:"@csstools/postcss-color-mix-function",id:"color-mix",importName:"postcssColorMixFunction"},{packageName:"@csstools/postcss-color-function",id:"color-function",importName:"postcssColorFunction"},{packageName:"postcss-color-functional-notation",id:"color-functional-notation",importName:"postcssColorFunctionalNotation"},{packageName:"postcss-color-hex-alpha",id:"hexadecimal-alpha-notation",importName:"postcssColorHexAlpha"},{packageName:"@csstools/postcss-content-alt-text",id:"content-alt-text",importName:"postcssContentAltText"},{packageName:"postcss-color-rebeccapurple",id:"rebeccapurple-color",importName:"postcssColorRebeccapurple"},{packageName:"postcss-custom-media",id:"custom-media-queries",importName:"postcssCustomMedia"},{packageName:"postcss-custom-properties",id:"custom-properties",importName:"postcssCustomProperties"},{packageName:"postcss-custom-selectors",id:"custom-selectors",importName:"postcssCustomSelectors"},{packageName:"postcss-dir-pseudo-class",id:"dir-pseudo-class",importName:"postcssDirPseudoClass"},{packageName:"postcss-double-position-gradients",id:"double-position-gradients",importName:"postcssDoublePositionGradients"},{packageName:"@csstools/postcss-exponential-functions",id:"exponential-functions",importName:"postcssExponentialFunctions"},{packageName:"postcss-focus-visible",id:"focus-visible-pseudo-class",importName:"postcssFocusVisible"},{packageName:"postcss-focus-within",id:"focus-within-pseudo-class",importName:"postcssFocusWithin"},{packageName:"@csstools/postcss-font-format-keywords",id:"font-format-keywords",importName:"postcssFontFormatKeywords"},{packageName:"postcss-font-variant",id:"font-variant-property",importName:"postcssFontVariant"},{packageName:"@csstools/postcss-gamut-mapping",id:"gamut-mapping",importName:"postcssGamutMapping"},{packageName:"postcss-gap-properties",id:"gap-properties",importName:"postcssGapProperties"},{packageName:"@csstools/postcss-gradients-interpolation-method",id:"gradients-interpolation-method",importName:"postcssGradientsInterpolationMethod"},{packageName:"@csstools/postcss-hwb-function",id:"hwb-function",importName:"postcssHWBFunction"},{packageName:"@csstools/postcss-ic-unit",id:"ic-unit",importName:"postcssICUnit"},{packageName:"postcss-image-set-function",id:"image-set-function",importName:"postcssImageSetFunction"},{packageName:"@csstools/postcss-initial",id:"all-property",importName:"postcssInitial"},{packageName:"@csstools/postcss-is-pseudo-class",id:"is-pseudo-class",importName:"postcssIsPseudoClass"},{packageName:"@csstools/postcss-scope-pseudo-class",id:"scope-pseudo-class",importName:"postcssScopePseudoClass"},{packageName:"postcss-lab-function",id:"lab-function",importName:"postcssLabFunction"},{packageName:"@csstools/postcss-light-dark-function",id:"light-dark-function",importName:"postcssLightDarkFunction"},{packageName:"postcss-logical",id:"logical-properties-and-values",importName:"postcssLogical"},{packageName:"@csstools/postcss-logical-float-and-clear",id:"float-clear-logical-values",importName:"postcssLogicalFloatAndClear"},{packageName:"@csstools/postcss-logical-overflow",id:"logical-overflow",importName:"postcssLogicalOverflow"},{packageName:"@csstools/postcss-logical-overscroll-behavior",id:"logical-overscroll-behavior",importName:"postcssLogicalOverscrollBehavor"},{packageName:"@csstools/postcss-logical-resize",id:"logical-resize",importName:"postcssLogicalResize"},{packageName:"@csstools/postcss-logical-viewport-units",id:"logical-viewport-units",importName:"postcssLogicalViewportUnits"},{packageName:"@csstools/postcss-media-minmax",id:"media-query-ranges",importName:"postcssMediaMinmax"},{packageName:"@csstools/postcss-media-queries-aspect-ratio-number-values",id:"media-queries-aspect-ratio-number-values",importName:"postcssMediaQueriesAspectRatioNumberValues"},{packageName:"postcss-nesting",id:"nesting-rules",importName:"postcssNesting"},{packageName:"@csstools/postcss-normalize-display-values",id:"display-two-values",importName:"postcssNormalizeDisplayValues"},{packageName:"@csstools/postcss-oklab-function",id:"oklab-function",importName:"postcssOKLabFunction"},{packageName:"@csstools/postcss-relative-color-syntax",id:"relative-color-syntax",importName:"postcssRelativeColorSyntax"},{packageName:"postcss-opacity-percentage",id:"opacity-percentage",importName:"postcssOpacityPercentage"},{packageName:"postcss-overflow-shorthand",id:"overflow-property",importName:"postcssOverflowShorthand"},{packageName:"postcss-page-break",id:"break-properties",importName:"postcssPageBreak"},{packageName:"postcss-place",id:"place-properties",importName:"postcssPlace"},{packageName:"postcss-pseudo-class-any-link",id:"any-link-pseudo-class",importName:"postcssPseudoClassAnyLink"},{packageName:"postcss-replace-overflow-wrap",id:"overflow-wrap-property",importName:"postcssReplaceOverflowWrap"},{packageName:"postcss-selector-not",id:"not-pseudo-class",importName:"postcssSelectorNot"},{packageName:"@csstools/postcss-stepped-value-functions",id:"stepped-value-functions",importName:"postcssSteppedValueFunctions"},{packageName:"postcss-system-ui-font-family",importedPackage:"../patch/postcss-system-ui-font-family.mjs",id:"system-ui-font-family",importName:"postcssFontFamilySystemUI"},{packageName:"@csstools/postcss-unset-value",id:"unset-value",importName:"postcssUnsetValue"},{packageName:"@csstools/postcss-cascade-layers",id:"cascade-layers",importName:"postcssCascadeLayers"},{packageName:"@csstools/postcss-trigonometric-functions",id:"trigonometric-functions",importName:"postcssTrigonometricFunctions"},{packageName:"@csstools/postcss-nested-calc",id:"nested-calc",importName:"postcssNestedCalc"},{packageName:"@csstools/postcss-text-decoration-shorthand",id:"text-decoration-shorthand",importName:"postcssTextDecorationShorthand"},{packageName:"@csstools/postcss-sign-functions",id:"sign-functions",importName:"postcssSignFunctions"},{packageName:"@csstools/postcss-random-function",id:"random-function",importName:"postcssRandomFunction"},{packageName:"@csstools/postcss-progressive-custom-properties",id:"progressive-custom-properties",importName:"postcssProgressiveCustomProperties",omitTypedOptions:!0,omitDocs:!0}];function getPackageNamesToIds(){const s={};return Os.forEach((e=>{s[e.packageName]=e.id})),s}function pluginIdHelp(s,e,o){const t=Os.map((s=>s.id)),i=Os.map((s=>s.packageName)),r=getPackageNamesToIds();s.forEach((s=>{if(t.includes(s))return;const a=[...t.map((e=>[e,levenshteinDistance(s,e)])),...i.map((e=>[r[e],levenshteinDistance(s,e)]))].sort(((s,e)=>s[1]-e[1])).filter((s=>s[1]<10)),c=new Set;for(let s=0;s<a.length&&(c.add(a[s][0]),!(c.size>=3));s++);if(!c.size)return void e.warn(o,`Unknown feature: "${s}", see the list of features https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/FEATURES.md`);let n='"';n+=Array.from(c).join('", "'),n+='"',e.warn(o,`Unknown feature: "${s}", did you mean one of: ${n}`)}))}function levenshteinDistance(s,e){if(!s.length)return e.length;if(!e.length)return s.length;const o=[];for(let t=0;t<=e.length;t++){o[t]=[t];for(let i=1;i<=s.length;i++)o[t][i]=0===t?i:Math.min(o[t-1][i]+1,o[t][i-1]+1,o[t-1][i-1]+(s[i-1]===e[t-1]?0:1))}return o[e.length][s.length]}const creator=o=>{const t=new Logger,i=Object(o),r=Object.keys(Object(i.features)),a=i.browsers?void 0:i.env,c=i.browsers,n=initializeSharedOptions(i),p=listFeatures(e,i,n,t),l=p.map((s=>s.plugin));!1!==i.autoprefixer&&l.push(s(Object.assign({env:a,overrideBrowserslist:c},i.autoprefixer))),logFeaturesList(p,i,t);const internalPlugin=()=>({postcssPlugin:"postcss-preset-env",OnceExit(s,{result:e}){pluginIdHelp(r,s,e),i.debug&&t.emitLogs(e),t.resetLogger()}});return internalPlugin.postcss=!0,{postcssPlugin:"postcss-preset-env",plugins:[...l,internalPlugin()]}};creator.postcss=!0,module.exports=creator;
|
|
1
|
+
"use strict";var s=require("autoprefixer"),e=require("cssdb"),o=require("browserslist"),t=require("@csstools/postcss-initial"),i=require("@csstools/postcss-alpha-function"),a=require("postcss-pseudo-class-any-link"),r=require("css-blank-pseudo"),c=require("postcss-page-break"),n=require("@csstools/postcss-cascade-layers"),p=require("postcss-attribute-case-insensitive"),l=require("postcss-clamp"),u=require("@csstools/postcss-color-function"),m=require("@csstools/postcss-color-function-display-p3-linear"),d=require("postcss-color-functional-notation"),g=require("@csstools/postcss-color-mix-function"),f=require("@csstools/postcss-color-mix-variadic-function-arguments"),h=require("@csstools/postcss-content-alt-text"),b=require("postcss-custom-media"),v=require("postcss-custom-properties"),N=require("postcss-custom-selectors"),y=require("postcss-dir-pseudo-class"),k=require("@csstools/postcss-normalize-display-values"),w=require("postcss-double-position-gradients"),q=require("@csstools/postcss-exponential-functions"),x=require("@csstools/postcss-logical-float-and-clear"),F=require("postcss-focus-visible"),$=require("postcss-focus-within"),O=require("@csstools/postcss-font-format-keywords"),S=require("postcss-font-variant"),C=require("@csstools/postcss-gamut-mapping"),P=require("postcss-gap-properties"),A=require("@csstools/postcss-gradients-interpolation-method"),E=require("css-has-pseudo"),I=require("postcss-color-hex-alpha"),L=require("@csstools/postcss-hwb-function"),B=require("@csstools/postcss-ic-unit"),_=require("postcss-image-set-function"),U=require("@csstools/postcss-is-pseudo-class"),j=require("postcss-lab-function"),M=require("@csstools/postcss-light-dark-function"),D=require("@csstools/postcss-logical-overflow"),z=require("@csstools/postcss-logical-overscroll-behavior"),R=require("postcss-logical"),T=require("@csstools/postcss-logical-resize"),V=require("@csstools/postcss-logical-viewport-units"),H=require("@csstools/postcss-media-queries-aspect-ratio-number-values"),W=require("@csstools/postcss-media-minmax"),G=require("@csstools/postcss-nested-calc"),K=require("postcss-nesting"),Z=require("postcss-selector-not"),Q=require("@csstools/postcss-oklab-function"),J=require("postcss-opacity-percentage"),X=require("postcss-overflow-shorthand"),Y=require("postcss-replace-overflow-wrap"),ss=require("postcss-place"),es=require("css-prefers-color-scheme"),os=require("@csstools/postcss-progressive-custom-properties"),ts=require("@csstools/postcss-random-function"),is=require("postcss-color-rebeccapurple"),as=require("@csstools/postcss-relative-color-syntax"),rs=require("@csstools/postcss-scope-pseudo-class"),cs=require("@csstools/postcss-sign-functions"),ns=require("@csstools/postcss-stepped-value-functions"),ps=require("@csstools/postcss-text-decoration-shorthand"),ls=require("@csstools/postcss-trigonometric-functions"),us=require("@csstools/postcss-unset-value");const ms={"blank-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-blank-pseudo/README.md#browser","focus-visible-pseudo-class":"https://github.com/WICG/focus-visible","focus-within-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/postcss-focus-within/README.md#browser","has-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-has-pseudo/README.md#browser","prefers-color-scheme-query":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-prefers-color-scheme/README.md#browser"},ds=["blank-pseudo-class","focus-visible-pseudo-class","focus-within-pseudo-class","has-pseudo-class","prefers-color-scheme-query"];function logFeaturesList(s,e,o){if(e.debug){o.log("Enabling the following feature(s):");const t=[],i=[];!1!==e.autoprefixer&&i.push(" autoprefixer"),s.forEach(s=>{s.id.startsWith("before")||s.id.startsWith("after")?i.push(` ${s.id} (injected via options)`):i.push(` ${s.id}`),void 0!==ms[s.id]&&t.push(s.id)}),i.sort((s,e)=>s.localeCompare(e)),t.sort((s,e)=>s.localeCompare(e)),i.forEach(s=>o.log(s)),t.length&&(o.log("These feature(s) need a browser library to work:"),t.forEach(s=>o.log(` ${s}: ${ms[s]}`)))}}function initializeSharedOptions(s){if("preserve"in s){const e={};return e.preserve=s.preserve,e}return!1}function clamp(s,e,o){return Math.max(s,Math.min(e,o))}function stageFromOptions(s,e){let o=2;if(void 0===s.stage)return e.log("Using features from Stage 2 (default)."),o;if(!1===s.stage)o=5;else{let e=parseInt(s.stage,10);Number.isNaN(e)&&(e=0),o=clamp(0,e,5)}return 5===o?e.log('Stage has been disabled, features will be handled via the "features" option.'):e.log(`Using features from Stage ${o}.`),o}const gs=Symbol("insertBefore"),fs=Symbol("insertAfter"),hs=Symbol("insertOrder"),bs=Symbol("plugin");function getTransformedInsertions(s,e,o){if("insertBefore"!==o&&"insertAfter"!==o)return[];const t="insertBefore"===o?gs:fs,i=[];for(const o in e){if(!Object.hasOwnProperty.call(e,o))continue;if(!s.find(s=>s.id===o))continue;let a=e[o];Array.isArray(a)||(a=[a]);for(let s=0;s<a.length;s++)i.push({id:o,[bs]:a[s],[hs]:s,[t]:!0})}return i}var vs=["custom-media-queries","environment-variables","image-set-function","media-query-ranges","media-queries-aspect-ratio-number-values","prefers-color-scheme-query","nesting-rules","custom-selectors","any-link-pseudo-class","case-insensitive-attributes","focus-visible-pseudo-class","focus-within-pseudo-class","not-pseudo-class","logical-properties-and-values","float-clear-logical-values","logical-overflow","logical-overscroll-behavior","logical-resize","logical-viewport-units","dir-pseudo-class","all-property","gradients-interpolation-method","color-mix-variadic-function-arguments","color-mix","alpha-function","relative-color-syntax","lab-function","oklab-function","color-function-display-p3-linear","color-function","hwb-function","color-functional-notation","rebeccapurple-color","hexadecimal-alpha-notation","light-dark-function","double-position-gradients","blank-pseudo-class","break-properties","font-variant-property","is-pseudo-class","scope-pseudo-class","has-pseudo-class","gap-properties","overflow-property","overflow-wrap-property","place-properties","system-ui-font-family","font-format-keywords","display-two-values","content-alt-text","ic-unit","opacity-percentage","text-decoration-shorthand","unset-value","random-function","sign-functions","stepped-value-functions","trigonometric-functions","exponential-functions","clamp","nested-calc","custom-properties","cascade-layers","progressive-custom-properties","gamut-mapping"];function featureIsLess(s,e){return s.id===e.id?s[gs]&&e[gs]||s[fs]&&e[fs]?clamp(-1,s[hs]-e[hs],1):s[gs]||e[fs]?-1:s[fs]||e[gs]?1:0:clamp(-1,vs.indexOf(s.id)-vs.indexOf(e.id),1)}function postcssSystemUiFont(){return{postcssPlugin:"postcss-system-ui-font",Declaration(s){Ns.test(s.prop)&&(s.value.includes(ws)||(s.value=s.value.replace(qs,xs)))}}}postcssSystemUiFont.postcss=!0;const Ns=/(?:^(?:-|\\002d){2})|(?:^font(?:-family)?$)/i,ys="[\\f\\n\\r\\x09\\x20]",ks=["system-ui","-apple-system","Segoe UI","Roboto","Ubuntu","Cantarell","Noto Sans","sans-serif"],ws=ks.join(", "),qs=new RegExp(`(^|,|${ys}+)(?:system-ui${ys}*)(?:,${ys}*(?:${ks.join("|")})${ys}*)?(,|$)`,"i"),xs=`$1${ws}$2`,Fs=new Map([["all-property",t],["alpha-function",i],["any-link-pseudo-class",a],["blank-pseudo-class",r],["break-properties",c],["cascade-layers",n],["case-insensitive-attributes",p],["clamp",l],["color-function",u],["color-function-display-p3-linear",m],["color-functional-notation",d],["color-mix",g],["color-mix-variadic-function-arguments",f],["content-alt-text",h],["custom-media-queries",b],["custom-properties",v],["custom-selectors",N],["dir-pseudo-class",y],["display-two-values",k],["double-position-gradients",w],["exponential-functions",q],["float-clear-logical-values",x],["focus-visible-pseudo-class",F],["focus-within-pseudo-class",$],["font-format-keywords",O],["font-variant-property",S],["gamut-mapping",C],["gap-properties",P],["gradients-interpolation-method",A],["has-pseudo-class",E],["hexadecimal-alpha-notation",I],["hwb-function",L],["ic-unit",B],["image-set-function",_],["is-pseudo-class",U],["lab-function",j],["light-dark-function",M],["logical-overflow",D],["logical-overscroll-behavior",z],["logical-properties-and-values",R],["logical-resize",T],["logical-viewport-units",V],["media-queries-aspect-ratio-number-values",H],["media-query-ranges",W],["nested-calc",G],["nesting-rules",K],["not-pseudo-class",Z],["oklab-function",Q],["opacity-percentage",J],["overflow-property",X],["overflow-wrap-property",Y],["place-properties",ss],["prefers-color-scheme-query",es],["progressive-custom-properties",os],["random-function",ts],["rebeccapurple-color",is],["relative-color-syntax",as],["scope-pseudo-class",rs],["sign-functions",cs],["stepped-value-functions",ns],["system-ui-font-family",postcssSystemUiFont],["text-decoration-shorthand",ps],["trigonometric-functions",ls],["unset-value",us]]);function featureIsInsertedOrHasAPlugin(s){return!!s[gs]||(!!s[fs]||!!Fs.has(s.id))}function prepareFeaturesList(s,e,o){return s.concat(getTransformedInsertions(s,e,"insertBefore"),getTransformedInsertions(s,o,"insertAfter")).filter(s=>featureIsInsertedOrHasAPlugin(s)).sort((s,e)=>featureIsLess(s,e))}function getOptionsForBrowsersByFeature(s,e,o,t){switch(e.id){case"is-pseudo-class":return{onComplexSelector:"warning"};case"any-link-pseudo-class":if(s.find(s=>s.startsWith("ie ")||"edge 12"===s||"edge 13"===s||"edge 14"===s||"edge 15"===s||"edge 16"===s||"edge 17"===s||"edge 18"===s))return t.log("- 'any-link-pseudo-class' setting 'subFeatures: { areaHrefNeedsFixing: true }' due to lack of browser support for area[href] in Edge and IE."),{subFeatures:{areaHrefNeedsFixing:!0}};return{};case"logical-properties-and-values":case"float-clear-logical-values":case"logical-resize":case"logical-viewport-units":case"logical-overflow":case"logical-overscroll-behavior":return"logical"in o?o.logical:{};default:return{}}}const $s=["and_chr","and_ff","android","chrome","edge","firefox","ie","ios_saf","op_mini","op_mob","opera","safari","samsung"];function getUnsupportedBrowsersByFeature(s){if(!s)return[];if(!("browser_support"in s))return["> 0%"];const e=[];return $s.forEach(o=>{if("op_mini"===o&&void 0===s.browser_support[o])return void e.push("op_mini all");const t=s.browser_support[o];"string"==typeof t&&Os.test(t)?e.push(`${o} < ${s.browser_support[o]}`):e.push(`${o} >= 1`)}),e}const Os=/^[0-9|.]+$/;function formatPolyfillableFeature(s){const e=getUnsupportedBrowsersByFeature(s);if(s[gs]||s[fs]){let o=s.id;return o=s.insertBefore?`before-${o}`:`after-${o}`,{browsers:e,vendors_implementations:s.vendors_implementations,plugin:s[bs],id:o,stage:6}}return{browsers:e,vendors_implementations:s.vendors_implementations,plugin:Fs.get(s.id),id:s.id,stage:s.stage}}function formatStagedFeature(s,e,o,t,i,a){let r,c;return r=getOptionsForBrowsersByFeature(s,o,i,a),r=t?Object.assign({},r,t,featureOptions(e,o.id)):Object.assign({},r,featureOptions(e,o.id)),"progressive-custom-properties"!==o.id&&(r.enableProgressiveCustomProperties=!1),"overflow-wrap-property"===o.id&&"preserve"in r&&(r.method=r.preserve?"copy":"replace"),c=o.plugin.postcss&&"function"==typeof o.plugin?o.plugin(r):o.plugin&&o.plugin.default&&"function"==typeof o.plugin.default&&o.plugin.default.postcss?o.plugin.default(r):o.plugin,{browsers:o.browsers,vendors_implementations:o.vendors_implementations,plugin:c,pluginOptions:r,id:o.id}}function featureOptions(s,e){if(!(e in s))return;const o=s[e];return Array.isArray(o)?o[1]:o}function intOrZero(s){const e=parseInt(s,10);return Number.isNaN(e)?0:e}const Ss=new Set(["progressive-custom-properties"]);function listFeatures(s,e,t,i){const a=Object(e.features),r="enableClientSidePolyfills"in e&&e.enableClientSidePolyfills,c=Object(e.insertBefore),n=Object(e.insertAfter),p=e.browsers?void 0:e.env,l=e.browsers,u=clamp(0,intOrZero(e.minimumVendorImplementations),3);u>0&&i.log(`Using features with ${u} or more vendor implementations.`);const m=stageFromOptions(e,i),d=prepareFeaturesList([...s,{id:"progressive-custom-properties"}],c,n).map(s=>formatPolyfillableFeature(s)).filter(s=>!!Ss.has(s.id)||(0===u||(!(!s[gs]&&!s[fs])||(u<=s.vendors_implementations||(!0===featureEnabledByOptions(a,s.id)?(i.log(`- '${s.id}' enabled manually even when it lacks the required interop (${s.vendors_implementations} out of ${u}).`),!0):(i.log(`- '${s.id}' disabled because it lacks the required interop (${s.vendors_implementations} out of ${u}).`),!1)))))),g=o(l,{env:p,ignoreUnknownVersions:!0}).filter(s=>$s.includes(s.split(" ")[0]));return d.filter(s=>{if(Ss.has(s.id))return!0;const e=s.stage>=m,o=r||!ds.includes(s.id),t=featureEnabledByOptions(a,s.id),c=!1===t,n=!0===t||e&&o;return c?i.log(`- '${s.id}' disabled manually`):e?o||i.log(`- '${s.id}' disabled because 'enableClientSidePolyfills' is 'false'.`):n?i.log(`- '${s.id}' enabled manually even when it lacks the required stage (${s.stage} out of ${m}).`):i.log(`- '${s.id}' disabled because it lacks the required stage (${s.stage} out of ${m}).`),!c&&n}).map(s=>formatStagedFeature(g,a,s,t,e,i)).filter(s=>{if(Ss.has(s.id))return!0;const e=featureEnabledByOptions(a,s.id);if(!0===e||!1===e)return e;const t=o(s.browsers,{ignoreUnknownVersions:!0}),r=g.filter(s=>t.some(e=>e===s));return r.length>0?i.log(`- '${s.id}' enabled for:\n ${r.join("\n ")}`):i.log(`- '${s.id}' disabled because all targeted browsers support it.`),r.length>0})}function featureEnabledByOptions(s,e){if(!(e in s))return"auto";const o=s[e];return Array.isArray(o)?!0===o[0]||!1!==o[0]&&"auto":Boolean(o)}class Logger{constructor(){this.logs=[]}log(s){this.logs.push(s)}resetLogger(){this.logs.length=0}emitLogs(s){s&&s.warn(this.logs.join("\n")),this.resetLogger()}}var Cs=[{packageName:"css-blank-pseudo",id:"blank-pseudo-class",importName:"postcssBlankPseudo"},{packageName:"css-has-pseudo",id:"has-pseudo-class",importName:"postcssHasPseudo"},{packageName:"css-prefers-color-scheme",id:"prefers-color-scheme-query",importName:"postcssPrefersColorScheme"},{packageName:"postcss-attribute-case-insensitive",id:"case-insensitive-attributes",importName:"postcssAttributeCaseInsensitive"},{packageName:"postcss-clamp",id:"clamp",importName:"postcssClamp"},{packageName:"@csstools/postcss-alpha-function",id:"alpha-function",importName:"postcssAlphaFunction"},{packageName:"@csstools/postcss-color-mix-variadic-function-arguments",id:"color-mix-variadic-function-arguments",importName:"postcssColorMixVariadicFunctionArguments"},{packageName:"@csstools/postcss-color-mix-function",id:"color-mix",importName:"postcssColorMixFunction"},{packageName:"@csstools/postcss-color-function",id:"color-function",importName:"postcssColorFunction"},{packageName:"@csstools/postcss-color-function-display-p3-linear",id:"color-function-display-p3-linear",importName:"postcssColorFunctionDisplayP3Linear"},{packageName:"postcss-color-functional-notation",id:"color-functional-notation",importName:"postcssColorFunctionalNotation"},{packageName:"postcss-color-hex-alpha",id:"hexadecimal-alpha-notation",importName:"postcssColorHexAlpha"},{packageName:"@csstools/postcss-content-alt-text",id:"content-alt-text",importName:"postcssContentAltText"},{packageName:"postcss-color-rebeccapurple",id:"rebeccapurple-color",importName:"postcssColorRebeccapurple"},{packageName:"postcss-custom-media",id:"custom-media-queries",importName:"postcssCustomMedia"},{packageName:"postcss-custom-properties",id:"custom-properties",importName:"postcssCustomProperties"},{packageName:"postcss-custom-selectors",id:"custom-selectors",importName:"postcssCustomSelectors"},{packageName:"postcss-dir-pseudo-class",id:"dir-pseudo-class",importName:"postcssDirPseudoClass"},{packageName:"postcss-double-position-gradients",id:"double-position-gradients",importName:"postcssDoublePositionGradients"},{packageName:"@csstools/postcss-exponential-functions",id:"exponential-functions",importName:"postcssExponentialFunctions"},{packageName:"postcss-focus-visible",id:"focus-visible-pseudo-class",importName:"postcssFocusVisible"},{packageName:"postcss-focus-within",id:"focus-within-pseudo-class",importName:"postcssFocusWithin"},{packageName:"@csstools/postcss-font-format-keywords",id:"font-format-keywords",importName:"postcssFontFormatKeywords"},{packageName:"postcss-font-variant",id:"font-variant-property",importName:"postcssFontVariant"},{packageName:"@csstools/postcss-gamut-mapping",id:"gamut-mapping",importName:"postcssGamutMapping"},{packageName:"postcss-gap-properties",id:"gap-properties",importName:"postcssGapProperties"},{packageName:"@csstools/postcss-gradients-interpolation-method",id:"gradients-interpolation-method",importName:"postcssGradientsInterpolationMethod"},{packageName:"@csstools/postcss-hwb-function",id:"hwb-function",importName:"postcssHWBFunction"},{packageName:"@csstools/postcss-ic-unit",id:"ic-unit",importName:"postcssICUnit"},{packageName:"postcss-image-set-function",id:"image-set-function",importName:"postcssImageSetFunction"},{packageName:"@csstools/postcss-initial",id:"all-property",importName:"postcssInitial"},{packageName:"@csstools/postcss-is-pseudo-class",id:"is-pseudo-class",importName:"postcssIsPseudoClass"},{packageName:"@csstools/postcss-scope-pseudo-class",id:"scope-pseudo-class",importName:"postcssScopePseudoClass"},{packageName:"postcss-lab-function",id:"lab-function",importName:"postcssLabFunction"},{packageName:"@csstools/postcss-light-dark-function",id:"light-dark-function",importName:"postcssLightDarkFunction"},{packageName:"postcss-logical",id:"logical-properties-and-values",importName:"postcssLogical"},{packageName:"@csstools/postcss-logical-float-and-clear",id:"float-clear-logical-values",importName:"postcssLogicalFloatAndClear"},{packageName:"@csstools/postcss-logical-overflow",id:"logical-overflow",importName:"postcssLogicalOverflow"},{packageName:"@csstools/postcss-logical-overscroll-behavior",id:"logical-overscroll-behavior",importName:"postcssLogicalOverscrollBehavor"},{packageName:"@csstools/postcss-logical-resize",id:"logical-resize",importName:"postcssLogicalResize"},{packageName:"@csstools/postcss-logical-viewport-units",id:"logical-viewport-units",importName:"postcssLogicalViewportUnits"},{packageName:"@csstools/postcss-media-minmax",id:"media-query-ranges",importName:"postcssMediaMinmax"},{packageName:"@csstools/postcss-media-queries-aspect-ratio-number-values",id:"media-queries-aspect-ratio-number-values",importName:"postcssMediaQueriesAspectRatioNumberValues"},{packageName:"postcss-nesting",id:"nesting-rules",importName:"postcssNesting"},{packageName:"@csstools/postcss-normalize-display-values",id:"display-two-values",importName:"postcssNormalizeDisplayValues"},{packageName:"@csstools/postcss-oklab-function",id:"oklab-function",importName:"postcssOKLabFunction"},{packageName:"@csstools/postcss-relative-color-syntax",id:"relative-color-syntax",importName:"postcssRelativeColorSyntax"},{packageName:"postcss-opacity-percentage",id:"opacity-percentage",importName:"postcssOpacityPercentage"},{packageName:"postcss-overflow-shorthand",id:"overflow-property",importName:"postcssOverflowShorthand"},{packageName:"postcss-page-break",id:"break-properties",importName:"postcssPageBreak"},{packageName:"postcss-place",id:"place-properties",importName:"postcssPlace"},{packageName:"postcss-pseudo-class-any-link",id:"any-link-pseudo-class",importName:"postcssPseudoClassAnyLink"},{packageName:"postcss-replace-overflow-wrap",id:"overflow-wrap-property",importName:"postcssReplaceOverflowWrap"},{packageName:"postcss-selector-not",id:"not-pseudo-class",importName:"postcssSelectorNot"},{packageName:"@csstools/postcss-stepped-value-functions",id:"stepped-value-functions",importName:"postcssSteppedValueFunctions"},{packageName:"postcss-system-ui-font-family",importedPackage:"../patch/postcss-system-ui-font-family.mjs",id:"system-ui-font-family",importName:"postcssFontFamilySystemUI"},{packageName:"@csstools/postcss-unset-value",id:"unset-value",importName:"postcssUnsetValue"},{packageName:"@csstools/postcss-cascade-layers",id:"cascade-layers",importName:"postcssCascadeLayers"},{packageName:"@csstools/postcss-trigonometric-functions",id:"trigonometric-functions",importName:"postcssTrigonometricFunctions"},{packageName:"@csstools/postcss-nested-calc",id:"nested-calc",importName:"postcssNestedCalc"},{packageName:"@csstools/postcss-text-decoration-shorthand",id:"text-decoration-shorthand",importName:"postcssTextDecorationShorthand"},{packageName:"@csstools/postcss-sign-functions",id:"sign-functions",importName:"postcssSignFunctions"},{packageName:"@csstools/postcss-random-function",id:"random-function",importName:"postcssRandomFunction"},{packageName:"@csstools/postcss-progressive-custom-properties",id:"progressive-custom-properties",importName:"postcssProgressiveCustomProperties",omitTypedOptions:!0,omitDocs:!0}];function getPackageNamesToIds(){const s={};return Cs.forEach(e=>{s[e.packageName]=e.id}),s}function pluginIdHelp(s,e,o){const t=Cs.map(s=>s.id),i=Cs.map(s=>s.packageName),a=getPackageNamesToIds();s.forEach(s=>{if(t.includes(s))return;const r=[...t.map(e=>[e,levenshteinDistance(s,e)]),...i.map(e=>[a[e],levenshteinDistance(s,e)])].sort((s,e)=>s[1]-e[1]).filter(s=>s[1]<10),c=new Set;for(let s=0;s<r.length&&(c.add(r[s][0]),!(c.size>=3));s++);if(!c.size)return void e.warn(o,`Unknown feature: "${s}", see the list of features https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/FEATURES.md`);let n='"';n+=Array.from(c).join('", "'),n+='"',e.warn(o,`Unknown feature: "${s}", did you mean one of: ${n}`)})}function levenshteinDistance(s,e){if(!s.length)return e.length;if(!e.length)return s.length;const o=[];for(let t=0;t<=e.length;t++){o[t]=[t];for(let i=1;i<=s.length;i++)o[t][i]=0===t?i:Math.min(o[t-1][i]+1,o[t][i-1]+1,o[t-1][i-1]+(s[i-1]===e[t-1]?0:1))}return o[e.length][s.length]}const creator=o=>{const t=new Logger,i=Object(o),a=Object.keys(Object(i.features)),r=i.browsers?void 0:i.env,c=i.browsers,n=initializeSharedOptions(i),p=listFeatures(e,i,n,t),l=p.map(s=>s.plugin);!1!==i.autoprefixer&&l.push(s(Object.assign({env:r,overrideBrowserslist:c},i.autoprefixer))),logFeaturesList(p,i,t);const internalPlugin=()=>({postcssPlugin:"postcss-preset-env",OnceExit(s,{result:e}){pluginIdHelp(a,s,e),i.debug&&t.emitLogs(e),t.resetLogger()}});return internalPlugin.postcss=!0,{postcssPlugin:"postcss-preset-env",plugins:[...l,internalPlugin()]}};creator.postcss=!0,module.exports=creator;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,60 +1,62 @@
|
|
|
1
1
|
import type autoprefixer from 'autoprefixer';
|
|
2
2
|
import type { PluginCreator } from 'postcss';
|
|
3
|
-
import type { pluginOptions as pluginOptions_10 } from '
|
|
4
|
-
import type { pluginOptions as pluginOptions_11 } from '@csstools/postcss-
|
|
5
|
-
import type { pluginOptions as pluginOptions_12 } from 'postcss-
|
|
6
|
-
import type { pluginOptions as pluginOptions_13 } from 'postcss-
|
|
7
|
-
import type { pluginOptions as pluginOptions_14 } from 'postcss-custom-
|
|
8
|
-
import type { pluginOptions as pluginOptions_15 } from 'postcss-
|
|
9
|
-
import type { pluginOptions as pluginOptions_16 } from '
|
|
10
|
-
import type { pluginOptions as pluginOptions_17 } from 'postcss-
|
|
11
|
-
import type { pluginOptions as pluginOptions_18 } from '@csstools/postcss-
|
|
12
|
-
import type { pluginOptions as pluginOptions_19 } from '
|
|
3
|
+
import type { pluginOptions as pluginOptions_10 } from 'postcss-color-functional-notation';
|
|
4
|
+
import type { pluginOptions as pluginOptions_11 } from '@csstools/postcss-color-mix-function';
|
|
5
|
+
import type { pluginOptions as pluginOptions_12 } from '@csstools/postcss-color-mix-variadic-function-arguments';
|
|
6
|
+
import type { pluginOptions as pluginOptions_13 } from '@csstools/postcss-content-alt-text';
|
|
7
|
+
import type { pluginOptions as pluginOptions_14 } from 'postcss-custom-media';
|
|
8
|
+
import type { pluginOptions as pluginOptions_15 } from 'postcss-custom-properties';
|
|
9
|
+
import type { pluginOptions as pluginOptions_16 } from 'postcss-custom-selectors';
|
|
10
|
+
import type { pluginOptions as pluginOptions_17 } from 'postcss-dir-pseudo-class';
|
|
11
|
+
import type { pluginOptions as pluginOptions_18 } from '@csstools/postcss-normalize-display-values';
|
|
12
|
+
import type { pluginOptions as pluginOptions_19 } from 'postcss-double-position-gradients';
|
|
13
13
|
import type { pluginOptions as pluginOptions_2 } from '@csstools/postcss-initial';
|
|
14
|
-
import type { pluginOptions as pluginOptions_20 } from 'postcss-
|
|
15
|
-
import type { pluginOptions as pluginOptions_21 } from 'postcss-
|
|
16
|
-
import type { pluginOptions as pluginOptions_22 } from '
|
|
17
|
-
import type { pluginOptions as pluginOptions_23 } from '
|
|
18
|
-
import type { pluginOptions as pluginOptions_24 } from 'postcss-
|
|
19
|
-
import type { pluginOptions as pluginOptions_25 } from '@csstools/postcss-
|
|
20
|
-
import type { pluginOptions as pluginOptions_26 } from '
|
|
21
|
-
import type { pluginOptions as pluginOptions_27 } from 'postcss-
|
|
22
|
-
import type { pluginOptions as pluginOptions_28 } from '
|
|
23
|
-
import type { pluginOptions as pluginOptions_29 } from '
|
|
24
|
-
import type { pluginOptions as pluginOptions_3 } from 'postcss-
|
|
25
|
-
import type { pluginOptions as pluginOptions_30 } from 'postcss-
|
|
26
|
-
import type { pluginOptions as pluginOptions_31 } from '@csstools/postcss-
|
|
27
|
-
import type { pluginOptions as pluginOptions_32 } from 'postcss-
|
|
28
|
-
import type { pluginOptions as pluginOptions_33 } from '@csstools/postcss-
|
|
29
|
-
import type { pluginOptions as pluginOptions_34 } from '
|
|
30
|
-
import type { pluginOptions as pluginOptions_35 } from '@csstools/postcss-
|
|
31
|
-
import type { pluginOptions as pluginOptions_36 } from 'postcss-logical';
|
|
32
|
-
import type { pluginOptions as pluginOptions_37 } from '@csstools/postcss-logical-
|
|
33
|
-
import type { pluginOptions as pluginOptions_38 } from '
|
|
34
|
-
import type { pluginOptions as pluginOptions_39 } from '@csstools/postcss-
|
|
35
|
-
import type { pluginOptions as pluginOptions_4 } from '
|
|
36
|
-
import type { pluginOptions as pluginOptions_40 } from '@csstools/postcss-
|
|
37
|
-
import type { pluginOptions as pluginOptions_41 } from '@csstools/postcss-
|
|
38
|
-
import type { pluginOptions as pluginOptions_42 } from 'postcss-
|
|
39
|
-
import type { pluginOptions as pluginOptions_43 } from 'postcss-
|
|
40
|
-
import type { pluginOptions as pluginOptions_44 } from '
|
|
41
|
-
import type { pluginOptions as pluginOptions_45 } from 'postcss-
|
|
42
|
-
import type { pluginOptions as pluginOptions_46 } from 'postcss-
|
|
43
|
-
import type { pluginOptions as pluginOptions_47 } from '
|
|
44
|
-
import type { pluginOptions as pluginOptions_48 } from '
|
|
45
|
-
import type { pluginOptions as pluginOptions_49 } from '
|
|
46
|
-
import type { pluginOptions as pluginOptions_5 } from '
|
|
47
|
-
import type { pluginOptions as pluginOptions_50 } from '@csstools/postcss-
|
|
48
|
-
import type { pluginOptions as pluginOptions_51 } from '
|
|
49
|
-
import type { pluginOptions as pluginOptions_52 } from '@csstools/postcss-
|
|
50
|
-
import type { pluginOptions as pluginOptions_53 } from '@csstools/postcss-
|
|
51
|
-
import type { pluginOptions as pluginOptions_54 } from '@csstools/postcss-
|
|
52
|
-
import type { pluginOptions as pluginOptions_55 } from '@csstools/postcss-
|
|
53
|
-
import type { pluginOptions as pluginOptions_56 } from '@csstools/postcss-
|
|
54
|
-
import type { pluginOptions as
|
|
55
|
-
import type { pluginOptions as
|
|
56
|
-
import type { pluginOptions as
|
|
57
|
-
import type { pluginOptions as
|
|
14
|
+
import type { pluginOptions as pluginOptions_20 } from '@csstools/postcss-exponential-functions';
|
|
15
|
+
import type { pluginOptions as pluginOptions_21 } from '@csstools/postcss-logical-float-and-clear';
|
|
16
|
+
import type { pluginOptions as pluginOptions_22 } from 'postcss-focus-visible';
|
|
17
|
+
import type { pluginOptions as pluginOptions_23 } from 'postcss-focus-within';
|
|
18
|
+
import type { pluginOptions as pluginOptions_24 } from '@csstools/postcss-font-format-keywords';
|
|
19
|
+
import type { pluginOptions as pluginOptions_25 } from '@csstools/postcss-gamut-mapping';
|
|
20
|
+
import type { pluginOptions as pluginOptions_26 } from 'postcss-gap-properties';
|
|
21
|
+
import type { pluginOptions as pluginOptions_27 } from '@csstools/postcss-gradients-interpolation-method';
|
|
22
|
+
import type { pluginOptions as pluginOptions_28 } from 'css-has-pseudo';
|
|
23
|
+
import type { pluginOptions as pluginOptions_29 } from 'postcss-color-hex-alpha';
|
|
24
|
+
import type { pluginOptions as pluginOptions_3 } from '@csstools/postcss-alpha-function';
|
|
25
|
+
import type { pluginOptions as pluginOptions_30 } from '@csstools/postcss-hwb-function';
|
|
26
|
+
import type { pluginOptions as pluginOptions_31 } from '@csstools/postcss-ic-unit';
|
|
27
|
+
import type { pluginOptions as pluginOptions_32 } from 'postcss-image-set-function';
|
|
28
|
+
import type { pluginOptions as pluginOptions_33 } from '@csstools/postcss-is-pseudo-class';
|
|
29
|
+
import type { pluginOptions as pluginOptions_34 } from 'postcss-lab-function';
|
|
30
|
+
import type { pluginOptions as pluginOptions_35 } from '@csstools/postcss-light-dark-function';
|
|
31
|
+
import type { pluginOptions as pluginOptions_36 } from '@csstools/postcss-logical-overflow';
|
|
32
|
+
import type { pluginOptions as pluginOptions_37 } from '@csstools/postcss-logical-overscroll-behavior';
|
|
33
|
+
import type { pluginOptions as pluginOptions_38 } from 'postcss-logical';
|
|
34
|
+
import type { pluginOptions as pluginOptions_39 } from '@csstools/postcss-logical-resize';
|
|
35
|
+
import type { pluginOptions as pluginOptions_4 } from 'postcss-pseudo-class-any-link';
|
|
36
|
+
import type { pluginOptions as pluginOptions_40 } from '@csstools/postcss-logical-viewport-units';
|
|
37
|
+
import type { pluginOptions as pluginOptions_41 } from '@csstools/postcss-media-queries-aspect-ratio-number-values';
|
|
38
|
+
import type { pluginOptions as pluginOptions_42 } from '@csstools/postcss-media-minmax';
|
|
39
|
+
import type { pluginOptions as pluginOptions_43 } from '@csstools/postcss-nested-calc';
|
|
40
|
+
import type { pluginOptions as pluginOptions_44 } from 'postcss-nesting';
|
|
41
|
+
import type { pluginOptions as pluginOptions_45 } from 'postcss-selector-not';
|
|
42
|
+
import type { pluginOptions as pluginOptions_46 } from '@csstools/postcss-oklab-function';
|
|
43
|
+
import type { pluginOptions as pluginOptions_47 } from 'postcss-overflow-shorthand';
|
|
44
|
+
import type { pluginOptions as pluginOptions_48 } from 'postcss-place';
|
|
45
|
+
import type { pluginOptions as pluginOptions_49 } from 'css-prefers-color-scheme';
|
|
46
|
+
import type { pluginOptions as pluginOptions_5 } from 'css-blank-pseudo';
|
|
47
|
+
import type { pluginOptions as pluginOptions_50 } from '@csstools/postcss-random-function';
|
|
48
|
+
import type { pluginOptions as pluginOptions_51 } from 'postcss-color-rebeccapurple';
|
|
49
|
+
import type { pluginOptions as pluginOptions_52 } from '@csstools/postcss-relative-color-syntax';
|
|
50
|
+
import type { pluginOptions as pluginOptions_53 } from '@csstools/postcss-scope-pseudo-class';
|
|
51
|
+
import type { pluginOptions as pluginOptions_54 } from '@csstools/postcss-sign-functions';
|
|
52
|
+
import type { pluginOptions as pluginOptions_55 } from '@csstools/postcss-stepped-value-functions';
|
|
53
|
+
import type { pluginOptions as pluginOptions_56 } from '@csstools/postcss-text-decoration-shorthand';
|
|
54
|
+
import type { pluginOptions as pluginOptions_57 } from '@csstools/postcss-trigonometric-functions';
|
|
55
|
+
import type { pluginOptions as pluginOptions_58 } from '@csstools/postcss-unset-value';
|
|
56
|
+
import type { pluginOptions as pluginOptions_6 } from '@csstools/postcss-cascade-layers';
|
|
57
|
+
import type { pluginOptions as pluginOptions_7 } from 'postcss-attribute-case-insensitive';
|
|
58
|
+
import type { pluginOptions as pluginOptions_8 } from '@csstools/postcss-color-function';
|
|
59
|
+
import type { pluginOptions as pluginOptions_9 } from '@csstools/postcss-color-function-display-p3-linear';
|
|
58
60
|
|
|
59
61
|
declare const creator: PluginCreator<pluginOptions>;
|
|
60
62
|
export default creator;
|
|
@@ -154,126 +156,130 @@ export declare type pluginOptions = {
|
|
|
154
156
|
export declare type pluginsOptions = {
|
|
155
157
|
/** plugin options for "@csstools/postcss-initial" */
|
|
156
158
|
'all-property'?: subPluginOptions<pluginOptions_2>;
|
|
159
|
+
/** plugin options for "@csstools/postcss-alpha-function" */
|
|
160
|
+
'alpha-function'?: subPluginOptions<pluginOptions_3>;
|
|
157
161
|
/** plugin options for "postcss-pseudo-class-any-link" */
|
|
158
|
-
'any-link-pseudo-class'?: subPluginOptions<
|
|
162
|
+
'any-link-pseudo-class'?: subPluginOptions<pluginOptions_4>;
|
|
159
163
|
/** plugin options for "css-blank-pseudo" */
|
|
160
|
-
'blank-pseudo-class'?: subPluginOptions<
|
|
164
|
+
'blank-pseudo-class'?: subPluginOptions<pluginOptions_5>;
|
|
161
165
|
/** plugin options for "postcss-page-break" */
|
|
162
166
|
'break-properties'?: subPluginOptions<postcssPageBreakOptions>;
|
|
163
167
|
/** plugin options for "@csstools/postcss-cascade-layers" */
|
|
164
|
-
'cascade-layers'?: subPluginOptions<
|
|
168
|
+
'cascade-layers'?: subPluginOptions<pluginOptions_6>;
|
|
165
169
|
/** plugin options for "postcss-attribute-case-insensitive" */
|
|
166
|
-
'case-insensitive-attributes'?: subPluginOptions<
|
|
170
|
+
'case-insensitive-attributes'?: subPluginOptions<pluginOptions_7>;
|
|
167
171
|
/** plugin options for "postcss-clamp" */
|
|
168
172
|
'clamp'?: subPluginOptions<postcssClampOptions>;
|
|
169
173
|
/** plugin options for "@csstools/postcss-color-function" */
|
|
170
|
-
'color-function'?: subPluginOptions<
|
|
174
|
+
'color-function'?: subPluginOptions<pluginOptions_8>;
|
|
175
|
+
/** plugin options for "@csstools/postcss-color-function-display-p3-linear" */
|
|
176
|
+
'color-function-display-p3-linear'?: subPluginOptions<pluginOptions_9>;
|
|
171
177
|
/** plugin options for "postcss-color-functional-notation" */
|
|
172
|
-
'color-functional-notation'?: subPluginOptions<
|
|
178
|
+
'color-functional-notation'?: subPluginOptions<pluginOptions_10>;
|
|
173
179
|
/** plugin options for "@csstools/postcss-color-mix-function" */
|
|
174
|
-
'color-mix'?: subPluginOptions<
|
|
180
|
+
'color-mix'?: subPluginOptions<pluginOptions_11>;
|
|
175
181
|
/** plugin options for "@csstools/postcss-color-mix-variadic-function-arguments" */
|
|
176
|
-
'color-mix-variadic-function-arguments'?: subPluginOptions<
|
|
182
|
+
'color-mix-variadic-function-arguments'?: subPluginOptions<pluginOptions_12>;
|
|
177
183
|
/** plugin options for "@csstools/postcss-content-alt-text" */
|
|
178
|
-
'content-alt-text'?: subPluginOptions<
|
|
184
|
+
'content-alt-text'?: subPluginOptions<pluginOptions_13>;
|
|
179
185
|
/** plugin options for "postcss-custom-media" */
|
|
180
|
-
'custom-media-queries'?: subPluginOptions<
|
|
186
|
+
'custom-media-queries'?: subPluginOptions<pluginOptions_14>;
|
|
181
187
|
/** plugin options for "postcss-custom-properties" */
|
|
182
|
-
'custom-properties'?: subPluginOptions<
|
|
188
|
+
'custom-properties'?: subPluginOptions<pluginOptions_15>;
|
|
183
189
|
/** plugin options for "postcss-custom-selectors" */
|
|
184
|
-
'custom-selectors'?: subPluginOptions<
|
|
190
|
+
'custom-selectors'?: subPluginOptions<pluginOptions_16>;
|
|
185
191
|
/** plugin options for "postcss-dir-pseudo-class" */
|
|
186
|
-
'dir-pseudo-class'?: subPluginOptions<
|
|
192
|
+
'dir-pseudo-class'?: subPluginOptions<pluginOptions_17>;
|
|
187
193
|
/** plugin options for "@csstools/postcss-normalize-display-values" */
|
|
188
|
-
'display-two-values'?: subPluginOptions<
|
|
194
|
+
'display-two-values'?: subPluginOptions<pluginOptions_18>;
|
|
189
195
|
/** plugin options for "postcss-double-position-gradients" */
|
|
190
|
-
'double-position-gradients'?: subPluginOptions<
|
|
196
|
+
'double-position-gradients'?: subPluginOptions<pluginOptions_19>;
|
|
191
197
|
/** plugin options for "@csstools/postcss-exponential-functions" */
|
|
192
|
-
'exponential-functions'?: subPluginOptions<
|
|
198
|
+
'exponential-functions'?: subPluginOptions<pluginOptions_20>;
|
|
193
199
|
/** plugin options for "@csstools/postcss-logical-float-and-clear" */
|
|
194
|
-
'float-clear-logical-values'?: subPluginOptions<
|
|
200
|
+
'float-clear-logical-values'?: subPluginOptions<pluginOptions_21>;
|
|
195
201
|
/** plugin options for "postcss-focus-visible" */
|
|
196
|
-
'focus-visible-pseudo-class'?: subPluginOptions<
|
|
202
|
+
'focus-visible-pseudo-class'?: subPluginOptions<pluginOptions_22>;
|
|
197
203
|
/** plugin options for "postcss-focus-within" */
|
|
198
|
-
'focus-within-pseudo-class'?: subPluginOptions<
|
|
204
|
+
'focus-within-pseudo-class'?: subPluginOptions<pluginOptions_23>;
|
|
199
205
|
/** plugin options for "@csstools/postcss-font-format-keywords" */
|
|
200
|
-
'font-format-keywords'?: subPluginOptions<
|
|
206
|
+
'font-format-keywords'?: subPluginOptions<pluginOptions_24>;
|
|
201
207
|
/** plugin options for "postcss-font-variant" */
|
|
202
208
|
'font-variant-property'?: subPluginOptions<postcssFontVariantOptions>;
|
|
203
209
|
/** plugin options for "@csstools/postcss-gamut-mapping" */
|
|
204
|
-
'gamut-mapping'?: subPluginOptions<
|
|
210
|
+
'gamut-mapping'?: subPluginOptions<pluginOptions_25>;
|
|
205
211
|
/** plugin options for "postcss-gap-properties" */
|
|
206
|
-
'gap-properties'?: subPluginOptions<
|
|
212
|
+
'gap-properties'?: subPluginOptions<pluginOptions_26>;
|
|
207
213
|
/** plugin options for "@csstools/postcss-gradients-interpolation-method" */
|
|
208
|
-
'gradients-interpolation-method'?: subPluginOptions<
|
|
214
|
+
'gradients-interpolation-method'?: subPluginOptions<pluginOptions_27>;
|
|
209
215
|
/** plugin options for "css-has-pseudo" */
|
|
210
|
-
'has-pseudo-class'?: subPluginOptions<
|
|
216
|
+
'has-pseudo-class'?: subPluginOptions<pluginOptions_28>;
|
|
211
217
|
/** plugin options for "postcss-color-hex-alpha" */
|
|
212
|
-
'hexadecimal-alpha-notation'?: subPluginOptions<
|
|
218
|
+
'hexadecimal-alpha-notation'?: subPluginOptions<pluginOptions_29>;
|
|
213
219
|
/** plugin options for "@csstools/postcss-hwb-function" */
|
|
214
|
-
'hwb-function'?: subPluginOptions<
|
|
220
|
+
'hwb-function'?: subPluginOptions<pluginOptions_30>;
|
|
215
221
|
/** plugin options for "@csstools/postcss-ic-unit" */
|
|
216
|
-
'ic-unit'?: subPluginOptions<
|
|
222
|
+
'ic-unit'?: subPluginOptions<pluginOptions_31>;
|
|
217
223
|
/** plugin options for "postcss-image-set-function" */
|
|
218
|
-
'image-set-function'?: subPluginOptions<
|
|
224
|
+
'image-set-function'?: subPluginOptions<pluginOptions_32>;
|
|
219
225
|
/** plugin options for "@csstools/postcss-is-pseudo-class" */
|
|
220
|
-
'is-pseudo-class'?: subPluginOptions<
|
|
226
|
+
'is-pseudo-class'?: subPluginOptions<pluginOptions_33>;
|
|
221
227
|
/** plugin options for "postcss-lab-function" */
|
|
222
|
-
'lab-function'?: subPluginOptions<
|
|
228
|
+
'lab-function'?: subPluginOptions<pluginOptions_34>;
|
|
223
229
|
/** plugin options for "@csstools/postcss-light-dark-function" */
|
|
224
|
-
'light-dark-function'?: subPluginOptions<
|
|
230
|
+
'light-dark-function'?: subPluginOptions<pluginOptions_35>;
|
|
225
231
|
/** plugin options for "@csstools/postcss-logical-overflow" */
|
|
226
|
-
'logical-overflow'?: subPluginOptions<
|
|
232
|
+
'logical-overflow'?: subPluginOptions<pluginOptions_36>;
|
|
227
233
|
/** plugin options for "@csstools/postcss-logical-overscroll-behavior" */
|
|
228
|
-
'logical-overscroll-behavior'?: subPluginOptions<
|
|
234
|
+
'logical-overscroll-behavior'?: subPluginOptions<pluginOptions_37>;
|
|
229
235
|
/** plugin options for "postcss-logical" */
|
|
230
|
-
'logical-properties-and-values'?: subPluginOptions<
|
|
236
|
+
'logical-properties-and-values'?: subPluginOptions<pluginOptions_38>;
|
|
231
237
|
/** plugin options for "@csstools/postcss-logical-resize" */
|
|
232
|
-
'logical-resize'?: subPluginOptions<
|
|
238
|
+
'logical-resize'?: subPluginOptions<pluginOptions_39>;
|
|
233
239
|
/** plugin options for "@csstools/postcss-logical-viewport-units" */
|
|
234
|
-
'logical-viewport-units'?: subPluginOptions<
|
|
240
|
+
'logical-viewport-units'?: subPluginOptions<pluginOptions_40>;
|
|
235
241
|
/** plugin options for "@csstools/postcss-media-queries-aspect-ratio-number-values" */
|
|
236
|
-
'media-queries-aspect-ratio-number-values'?: subPluginOptions<
|
|
242
|
+
'media-queries-aspect-ratio-number-values'?: subPluginOptions<pluginOptions_41>;
|
|
237
243
|
/** plugin options for "@csstools/postcss-media-minmax" */
|
|
238
|
-
'media-query-ranges'?: subPluginOptions<
|
|
244
|
+
'media-query-ranges'?: subPluginOptions<pluginOptions_42>;
|
|
239
245
|
/** plugin options for "@csstools/postcss-nested-calc" */
|
|
240
|
-
'nested-calc'?: subPluginOptions<
|
|
246
|
+
'nested-calc'?: subPluginOptions<pluginOptions_43>;
|
|
241
247
|
/** plugin options for "postcss-nesting" */
|
|
242
|
-
'nesting-rules'?: subPluginOptions<
|
|
248
|
+
'nesting-rules'?: subPluginOptions<pluginOptions_44>;
|
|
243
249
|
/** plugin options for "postcss-selector-not" */
|
|
244
|
-
'not-pseudo-class'?: subPluginOptions<
|
|
250
|
+
'not-pseudo-class'?: subPluginOptions<pluginOptions_45>;
|
|
245
251
|
/** plugin options for "@csstools/postcss-oklab-function" */
|
|
246
|
-
'oklab-function'?: subPluginOptions<
|
|
252
|
+
'oklab-function'?: subPluginOptions<pluginOptions_46>;
|
|
247
253
|
/** plugin options for "postcss-opacity-percentage" */
|
|
248
254
|
'opacity-percentage'?: subPluginOptions<postcssOpacityPercentageOptions>;
|
|
249
255
|
/** plugin options for "postcss-overflow-shorthand" */
|
|
250
|
-
'overflow-property'?: subPluginOptions<
|
|
256
|
+
'overflow-property'?: subPluginOptions<pluginOptions_47>;
|
|
251
257
|
/** plugin options for "postcss-replace-overflow-wrap" */
|
|
252
258
|
'overflow-wrap-property'?: subPluginOptions<postcssReplaceOverflowWrapOptions>;
|
|
253
259
|
/** plugin options for "postcss-place" */
|
|
254
|
-
'place-properties'?: subPluginOptions<
|
|
260
|
+
'place-properties'?: subPluginOptions<pluginOptions_48>;
|
|
255
261
|
/** plugin options for "css-prefers-color-scheme" */
|
|
256
|
-
'prefers-color-scheme-query'?: subPluginOptions<
|
|
262
|
+
'prefers-color-scheme-query'?: subPluginOptions<pluginOptions_49>;
|
|
257
263
|
/** plugin options for "@csstools/postcss-random-function" */
|
|
258
|
-
'random-function'?: subPluginOptions<
|
|
264
|
+
'random-function'?: subPluginOptions<pluginOptions_50>;
|
|
259
265
|
/** plugin options for "postcss-color-rebeccapurple" */
|
|
260
|
-
'rebeccapurple-color'?: subPluginOptions<
|
|
266
|
+
'rebeccapurple-color'?: subPluginOptions<pluginOptions_51>;
|
|
261
267
|
/** plugin options for "@csstools/postcss-relative-color-syntax" */
|
|
262
|
-
'relative-color-syntax'?: subPluginOptions<
|
|
268
|
+
'relative-color-syntax'?: subPluginOptions<pluginOptions_52>;
|
|
263
269
|
/** plugin options for "@csstools/postcss-scope-pseudo-class" */
|
|
264
|
-
'scope-pseudo-class'?: subPluginOptions<
|
|
270
|
+
'scope-pseudo-class'?: subPluginOptions<pluginOptions_53>;
|
|
265
271
|
/** plugin options for "@csstools/postcss-sign-functions" */
|
|
266
|
-
'sign-functions'?: subPluginOptions<
|
|
272
|
+
'sign-functions'?: subPluginOptions<pluginOptions_54>;
|
|
267
273
|
/** plugin options for "@csstools/postcss-stepped-value-functions" */
|
|
268
|
-
'stepped-value-functions'?: subPluginOptions<
|
|
274
|
+
'stepped-value-functions'?: subPluginOptions<pluginOptions_55>;
|
|
269
275
|
/** plugin options for "postcss-system-ui-font-family" */
|
|
270
276
|
'system-ui-font-family'?: subPluginOptions<postcssFontFamilySystemUIOptions>;
|
|
271
277
|
/** plugin options for "@csstools/postcss-text-decoration-shorthand" */
|
|
272
|
-
'text-decoration-shorthand'?: subPluginOptions<
|
|
278
|
+
'text-decoration-shorthand'?: subPluginOptions<pluginOptions_56>;
|
|
273
279
|
/** plugin options for "@csstools/postcss-trigonometric-functions" */
|
|
274
|
-
'trigonometric-functions'?: subPluginOptions<
|
|
280
|
+
'trigonometric-functions'?: subPluginOptions<pluginOptions_57>;
|
|
275
281
|
/** plugin options for "@csstools/postcss-unset-value" */
|
|
276
|
-
'unset-value'?: subPluginOptions<
|
|
282
|
+
'unset-value'?: subPluginOptions<pluginOptions_58>;
|
|
277
283
|
};
|
|
278
284
|
|
|
279
285
|
/** postcss-clamp plugin options */
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import s from"autoprefixer";import o from"cssdb";import e from"browserslist";import t from"@csstools/postcss-initial";import i from"postcss-pseudo-class-any-link";import a from"css-blank-pseudo";import r from"postcss-page-break";import c from"@csstools/postcss-cascade-layers";import p from"postcss-attribute-case-insensitive";import n from"postcss-clamp";import l from"@csstools/postcss-color-function";import m from"postcss-color-functional-notation";import u from"@csstools/postcss-color-mix-function";import d from"@csstools/postcss-color-mix-variadic-function-arguments";import f from"@csstools/postcss-content-alt-text";import g from"postcss-custom-media";import h from"postcss-custom-properties";import b from"postcss-custom-selectors";import v from"postcss-dir-pseudo-class";import N from"@csstools/postcss-normalize-display-values";import k from"postcss-double-position-gradients";import y from"@csstools/postcss-exponential-functions";import w from"@csstools/postcss-logical-float-and-clear";import x from"postcss-focus-visible";import F from"postcss-focus-within";import $ from"@csstools/postcss-font-format-keywords";import O from"postcss-font-variant";import S from"@csstools/postcss-gamut-mapping";import C from"postcss-gap-properties";import P from"@csstools/postcss-gradients-interpolation-method";import E from"css-has-pseudo";import I from"postcss-color-hex-alpha";import A from"@csstools/postcss-hwb-function";import B from"@csstools/postcss-ic-unit";import L from"postcss-image-set-function";import q from"@csstools/postcss-is-pseudo-class";import _ from"postcss-lab-function";import U from"@csstools/postcss-light-dark-function";import j from"@csstools/postcss-logical-overflow";import M from"@csstools/postcss-logical-overscroll-behavior";import z from"postcss-logical";import D from"@csstools/postcss-logical-resize";import R from"@csstools/postcss-logical-viewport-units";import T from"@csstools/postcss-media-queries-aspect-ratio-number-values";import V from"@csstools/postcss-media-minmax";import H from"@csstools/postcss-nested-calc";import W from"postcss-nesting";import G from"postcss-selector-not";import K from"@csstools/postcss-oklab-function";import Z from"postcss-opacity-percentage";import Q from"postcss-overflow-shorthand";import J from"postcss-replace-overflow-wrap";import X from"postcss-place";import Y from"css-prefers-color-scheme";import ss from"@csstools/postcss-progressive-custom-properties";import os from"@csstools/postcss-random-function";import es from"postcss-color-rebeccapurple";import ts from"@csstools/postcss-relative-color-syntax";import is from"@csstools/postcss-scope-pseudo-class";import as from"@csstools/postcss-sign-functions";import rs from"@csstools/postcss-stepped-value-functions";import cs from"@csstools/postcss-text-decoration-shorthand";import ps from"@csstools/postcss-trigonometric-functions";import ns from"@csstools/postcss-unset-value";const ls={"blank-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-blank-pseudo/README.md#browser","focus-visible-pseudo-class":"https://github.com/WICG/focus-visible","focus-within-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/postcss-focus-within/README.md#browser","has-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-has-pseudo/README.md#browser","prefers-color-scheme-query":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-prefers-color-scheme/README.md#browser"},ms=["blank-pseudo-class","focus-visible-pseudo-class","focus-within-pseudo-class","has-pseudo-class","prefers-color-scheme-query"];function logFeaturesList(s,o,e){if(o.debug){e.log("Enabling the following feature(s):");const t=[],i=[];!1!==o.autoprefixer&&i.push(" autoprefixer"),s.forEach((s=>{s.id.startsWith("before")||s.id.startsWith("after")?i.push(` ${s.id} (injected via options)`):i.push(` ${s.id}`),void 0!==ls[s.id]&&t.push(s.id)})),i.sort(((s,o)=>s.localeCompare(o))),t.sort(((s,o)=>s.localeCompare(o))),i.forEach((s=>e.log(s))),t.length&&(e.log("These feature(s) need a browser library to work:"),t.forEach((s=>e.log(` ${s}: ${ls[s]}`))))}}function initializeSharedOptions(s){if("preserve"in s){const o={};return o.preserve=s.preserve,o}return!1}function clamp(s,o,e){return Math.max(s,Math.min(o,e))}function stageFromOptions(s,o){let e=2;if(void 0===s.stage)return o.log("Using features from Stage 2 (default)."),e;if(!1===s.stage)e=5;else{let o=parseInt(s.stage,10);Number.isNaN(o)&&(o=0),e=clamp(0,o,5)}return 5===e?o.log('Stage has been disabled, features will be handled via the "features" option.'):o.log(`Using features from Stage ${e}.`),e}const us=Symbol("insertBefore"),ds=Symbol("insertAfter"),fs=Symbol("insertOrder"),gs=Symbol("plugin");function getTransformedInsertions(s,o,e){if("insertBefore"!==e&&"insertAfter"!==e)return[];const t="insertBefore"===e?us:ds,i=[];for(const e in o){if(!Object.hasOwnProperty.call(o,e))continue;if(!s.find((s=>s.id===e)))continue;let a=o[e];Array.isArray(a)||(a=[a]);for(let s=0;s<a.length;s++)i.push({id:e,[gs]:a[s],[fs]:s,[t]:!0})}return i}var hs=["custom-media-queries","environment-variables","image-set-function","media-query-ranges","media-queries-aspect-ratio-number-values","prefers-color-scheme-query","nesting-rules","custom-selectors","any-link-pseudo-class","case-insensitive-attributes","focus-visible-pseudo-class","focus-within-pseudo-class","not-pseudo-class","logical-properties-and-values","float-clear-logical-values","logical-overflow","logical-overscroll-behavior","logical-resize","logical-viewport-units","dir-pseudo-class","all-property","gradients-interpolation-method","color-mix-variadic-function-arguments","color-mix","relative-color-syntax","lab-function","oklab-function","color-function","hwb-function","color-functional-notation","rebeccapurple-color","hexadecimal-alpha-notation","light-dark-function","double-position-gradients","blank-pseudo-class","break-properties","font-variant-property","is-pseudo-class","scope-pseudo-class","has-pseudo-class","gap-properties","overflow-property","overflow-wrap-property","place-properties","system-ui-font-family","font-format-keywords","display-two-values","content-alt-text","ic-unit","opacity-percentage","text-decoration-shorthand","unset-value","random-function","sign-functions","stepped-value-functions","trigonometric-functions","exponential-functions","clamp","nested-calc","custom-properties","cascade-layers","progressive-custom-properties","gamut-mapping"];function featureIsLess(s,o){return s.id===o.id?s[us]&&o[us]||s[ds]&&o[ds]?clamp(-1,s[fs]-o[fs],1):s[us]||o[ds]?-1:s[ds]||o[us]?1:0:clamp(-1,hs.indexOf(s.id)-hs.indexOf(o.id),1)}function postcssSystemUiFont(){return{postcssPlugin:"postcss-system-ui-font",Declaration(s){bs.test(s.prop)&&(s.value.includes(ks)||(s.value=s.value.replace(ys,ws)))}}}postcssSystemUiFont.postcss=!0;const bs=/(?:^(?:-|\\002d){2})|(?:^font(?:-family)?$)/i,vs="[\\f\\n\\r\\x09\\x20]",Ns=["system-ui","-apple-system","Segoe UI","Roboto","Ubuntu","Cantarell","Noto Sans","sans-serif"],ks=Ns.join(", "),ys=new RegExp(`(^|,|${vs}+)(?:system-ui${vs}*)(?:,${vs}*(?:${Ns.join("|")})${vs}*)?(,|$)`,"i"),ws=`$1${ks}$2`,xs=new Map([["all-property",t],["any-link-pseudo-class",i],["blank-pseudo-class",a],["break-properties",r],["cascade-layers",c],["case-insensitive-attributes",p],["clamp",n],["color-function",l],["color-functional-notation",m],["color-mix",u],["color-mix-variadic-function-arguments",d],["content-alt-text",f],["custom-media-queries",g],["custom-properties",h],["custom-selectors",b],["dir-pseudo-class",v],["display-two-values",N],["double-position-gradients",k],["exponential-functions",y],["float-clear-logical-values",w],["focus-visible-pseudo-class",x],["focus-within-pseudo-class",F],["font-format-keywords",$],["font-variant-property",O],["gamut-mapping",S],["gap-properties",C],["gradients-interpolation-method",P],["has-pseudo-class",E],["hexadecimal-alpha-notation",I],["hwb-function",A],["ic-unit",B],["image-set-function",L],["is-pseudo-class",q],["lab-function",_],["light-dark-function",U],["logical-overflow",j],["logical-overscroll-behavior",M],["logical-properties-and-values",z],["logical-resize",D],["logical-viewport-units",R],["media-queries-aspect-ratio-number-values",T],["media-query-ranges",V],["nested-calc",H],["nesting-rules",W],["not-pseudo-class",G],["oklab-function",K],["opacity-percentage",Z],["overflow-property",Q],["overflow-wrap-property",J],["place-properties",X],["prefers-color-scheme-query",Y],["progressive-custom-properties",ss],["random-function",os],["rebeccapurple-color",es],["relative-color-syntax",ts],["scope-pseudo-class",is],["sign-functions",as],["stepped-value-functions",rs],["system-ui-font-family",postcssSystemUiFont],["text-decoration-shorthand",cs],["trigonometric-functions",ps],["unset-value",ns]]);function featureIsInsertedOrHasAPlugin(s){return!!s[us]||(!!s[ds]||!!xs.has(s.id))}function prepareFeaturesList(s,o,e){return s.concat(getTransformedInsertions(s,o,"insertBefore"),getTransformedInsertions(s,e,"insertAfter")).filter((s=>featureIsInsertedOrHasAPlugin(s))).sort(((s,o)=>featureIsLess(s,o)))}function getOptionsForBrowsersByFeature(s,o,e,t){switch(o.id){case"is-pseudo-class":return{onComplexSelector:"warning"};case"any-link-pseudo-class":if(s.find((s=>s.startsWith("ie ")||"edge 12"===s||"edge 13"===s||"edge 14"===s||"edge 15"===s||"edge 16"===s||"edge 17"===s||"edge 18"===s)))return t.log("- 'any-link-pseudo-class' setting 'subFeatures: { areaHrefNeedsFixing: true }' due to lack of browser support for area[href] in Edge and IE."),{subFeatures:{areaHrefNeedsFixing:!0}};return{};case"logical-properties-and-values":case"float-clear-logical-values":case"logical-resize":case"logical-viewport-units":case"logical-overflow":case"logical-overscroll-behavior":return"logical"in e?e.logical:{};default:return{}}}const Fs=["and_chr","and_ff","android","chrome","edge","firefox","ie","ios_saf","op_mini","op_mob","opera","safari","samsung"];function getUnsupportedBrowsersByFeature(s){if(!s)return[];if(!("browser_support"in s))return["> 0%"];const o=[];return Fs.forEach((e=>{if("op_mini"===e&&void 0===s.browser_support[e])return void o.push("op_mini all");const t=s.browser_support[e];"string"==typeof t&&$s.test(t)?o.push(`${e} < ${s.browser_support[e]}`):o.push(`${e} >= 1`)})),o}const $s=/^[0-9|.]+$/;function formatPolyfillableFeature(s){const o=getUnsupportedBrowsersByFeature(s);if(s[us]||s[ds]){let e=s.id;return e=s.insertBefore?`before-${e}`:`after-${e}`,{browsers:o,vendors_implementations:s.vendors_implementations,plugin:s[gs],id:e,stage:6}}return{browsers:o,vendors_implementations:s.vendors_implementations,plugin:xs.get(s.id),id:s.id,stage:s.stage}}function formatStagedFeature(s,o,e,t,i,a){let r,c;return r=getOptionsForBrowsersByFeature(s,e,i,a),r=t?Object.assign({},r,t,featureOptions(o,e.id)):Object.assign({},r,featureOptions(o,e.id)),"progressive-custom-properties"!==e.id&&(r.enableProgressiveCustomProperties=!1),"overflow-wrap-property"===e.id&&"preserve"in r&&(r.method=r.preserve?"copy":"replace"),c=e.plugin.postcss&&"function"==typeof e.plugin?e.plugin(r):e.plugin&&e.plugin.default&&"function"==typeof e.plugin.default&&e.plugin.default.postcss?e.plugin.default(r):e.plugin,{browsers:e.browsers,vendors_implementations:e.vendors_implementations,plugin:c,pluginOptions:r,id:e.id}}function featureOptions(s,o){if(!(o in s))return;const e=s[o];return Array.isArray(e)?e[1]:e}function intOrZero(s){const o=parseInt(s,10);return Number.isNaN(o)?0:o}const Os=new Set(["progressive-custom-properties"]);function listFeatures(s,o,t,i){const a=Object(o.features),r="enableClientSidePolyfills"in o&&o.enableClientSidePolyfills,c=Object(o.insertBefore),p=Object(o.insertAfter),n=o.browsers?void 0:o.env,l=o.browsers,m=clamp(0,intOrZero(o.minimumVendorImplementations),3);m>0&&i.log(`Using features with ${m} or more vendor implementations.`);const u=stageFromOptions(o,i),d=prepareFeaturesList([...s,{id:"progressive-custom-properties"}],c,p).map((s=>formatPolyfillableFeature(s))).filter((s=>!!Os.has(s.id)||(0===m||(!(!s[us]&&!s[ds])||(m<=s.vendors_implementations||(!0===featureEnabledByOptions(a,s.id)?(i.log(`- '${s.id}' enabled manually even when it lacks the required interop (${s.vendors_implementations} out of ${m}).`),!0):(i.log(`- '${s.id}' disabled because it lacks the required interop (${s.vendors_implementations} out of ${m}).`),!1))))))),f=e(l,{env:n,ignoreUnknownVersions:!0}).filter((s=>Fs.includes(s.split(" ")[0])));return d.filter((s=>{if(Os.has(s.id))return!0;const o=s.stage>=u,e=r||!ms.includes(s.id),t=featureEnabledByOptions(a,s.id),c=!1===t,p=!0===t||o&&e;return c?i.log(`- '${s.id}' disabled manually`):o?e||i.log(`- '${s.id}' disabled because 'enableClientSidePolyfills' is 'false'.`):p?i.log(`- '${s.id}' enabled manually even when it lacks the required stage (${s.stage} out of ${u}).`):i.log(`- '${s.id}' disabled because it lacks the required stage (${s.stage} out of ${u}).`),!c&&p})).map((s=>formatStagedFeature(f,a,s,t,o,i))).filter((s=>{if(Os.has(s.id))return!0;const o=featureEnabledByOptions(a,s.id);if(!0===o||!1===o)return o;const t=e(s.browsers,{ignoreUnknownVersions:!0}),r=f.filter((s=>t.some((o=>o===s))));return r.length>0?i.log(`- '${s.id}' enabled for:\n ${r.join("\n ")}`):i.log(`- '${s.id}' disabled because all targeted browsers support it.`),r.length>0}))}function featureEnabledByOptions(s,o){if(!(o in s))return"auto";const e=s[o];return Array.isArray(e)?!0===e[0]||!1!==e[0]&&"auto":Boolean(e)}class Logger{constructor(){this.logs=[]}log(s){this.logs.push(s)}resetLogger(){this.logs.length=0}emitLogs(s){s&&s.warn(this.logs.join("\n")),this.resetLogger()}}var Ss=[{packageName:"css-blank-pseudo",id:"blank-pseudo-class",importName:"postcssBlankPseudo"},{packageName:"css-has-pseudo",id:"has-pseudo-class",importName:"postcssHasPseudo"},{packageName:"css-prefers-color-scheme",id:"prefers-color-scheme-query",importName:"postcssPrefersColorScheme"},{packageName:"postcss-attribute-case-insensitive",id:"case-insensitive-attributes",importName:"postcssAttributeCaseInsensitive"},{packageName:"postcss-clamp",id:"clamp",importName:"postcssClamp"},{packageName:"@csstools/postcss-color-mix-variadic-function-arguments",id:"color-mix-variadic-function-arguments",importName:"postcssColorMixVariadicFunctionArguments"},{packageName:"@csstools/postcss-color-mix-function",id:"color-mix",importName:"postcssColorMixFunction"},{packageName:"@csstools/postcss-color-function",id:"color-function",importName:"postcssColorFunction"},{packageName:"postcss-color-functional-notation",id:"color-functional-notation",importName:"postcssColorFunctionalNotation"},{packageName:"postcss-color-hex-alpha",id:"hexadecimal-alpha-notation",importName:"postcssColorHexAlpha"},{packageName:"@csstools/postcss-content-alt-text",id:"content-alt-text",importName:"postcssContentAltText"},{packageName:"postcss-color-rebeccapurple",id:"rebeccapurple-color",importName:"postcssColorRebeccapurple"},{packageName:"postcss-custom-media",id:"custom-media-queries",importName:"postcssCustomMedia"},{packageName:"postcss-custom-properties",id:"custom-properties",importName:"postcssCustomProperties"},{packageName:"postcss-custom-selectors",id:"custom-selectors",importName:"postcssCustomSelectors"},{packageName:"postcss-dir-pseudo-class",id:"dir-pseudo-class",importName:"postcssDirPseudoClass"},{packageName:"postcss-double-position-gradients",id:"double-position-gradients",importName:"postcssDoublePositionGradients"},{packageName:"@csstools/postcss-exponential-functions",id:"exponential-functions",importName:"postcssExponentialFunctions"},{packageName:"postcss-focus-visible",id:"focus-visible-pseudo-class",importName:"postcssFocusVisible"},{packageName:"postcss-focus-within",id:"focus-within-pseudo-class",importName:"postcssFocusWithin"},{packageName:"@csstools/postcss-font-format-keywords",id:"font-format-keywords",importName:"postcssFontFormatKeywords"},{packageName:"postcss-font-variant",id:"font-variant-property",importName:"postcssFontVariant"},{packageName:"@csstools/postcss-gamut-mapping",id:"gamut-mapping",importName:"postcssGamutMapping"},{packageName:"postcss-gap-properties",id:"gap-properties",importName:"postcssGapProperties"},{packageName:"@csstools/postcss-gradients-interpolation-method",id:"gradients-interpolation-method",importName:"postcssGradientsInterpolationMethod"},{packageName:"@csstools/postcss-hwb-function",id:"hwb-function",importName:"postcssHWBFunction"},{packageName:"@csstools/postcss-ic-unit",id:"ic-unit",importName:"postcssICUnit"},{packageName:"postcss-image-set-function",id:"image-set-function",importName:"postcssImageSetFunction"},{packageName:"@csstools/postcss-initial",id:"all-property",importName:"postcssInitial"},{packageName:"@csstools/postcss-is-pseudo-class",id:"is-pseudo-class",importName:"postcssIsPseudoClass"},{packageName:"@csstools/postcss-scope-pseudo-class",id:"scope-pseudo-class",importName:"postcssScopePseudoClass"},{packageName:"postcss-lab-function",id:"lab-function",importName:"postcssLabFunction"},{packageName:"@csstools/postcss-light-dark-function",id:"light-dark-function",importName:"postcssLightDarkFunction"},{packageName:"postcss-logical",id:"logical-properties-and-values",importName:"postcssLogical"},{packageName:"@csstools/postcss-logical-float-and-clear",id:"float-clear-logical-values",importName:"postcssLogicalFloatAndClear"},{packageName:"@csstools/postcss-logical-overflow",id:"logical-overflow",importName:"postcssLogicalOverflow"},{packageName:"@csstools/postcss-logical-overscroll-behavior",id:"logical-overscroll-behavior",importName:"postcssLogicalOverscrollBehavor"},{packageName:"@csstools/postcss-logical-resize",id:"logical-resize",importName:"postcssLogicalResize"},{packageName:"@csstools/postcss-logical-viewport-units",id:"logical-viewport-units",importName:"postcssLogicalViewportUnits"},{packageName:"@csstools/postcss-media-minmax",id:"media-query-ranges",importName:"postcssMediaMinmax"},{packageName:"@csstools/postcss-media-queries-aspect-ratio-number-values",id:"media-queries-aspect-ratio-number-values",importName:"postcssMediaQueriesAspectRatioNumberValues"},{packageName:"postcss-nesting",id:"nesting-rules",importName:"postcssNesting"},{packageName:"@csstools/postcss-normalize-display-values",id:"display-two-values",importName:"postcssNormalizeDisplayValues"},{packageName:"@csstools/postcss-oklab-function",id:"oklab-function",importName:"postcssOKLabFunction"},{packageName:"@csstools/postcss-relative-color-syntax",id:"relative-color-syntax",importName:"postcssRelativeColorSyntax"},{packageName:"postcss-opacity-percentage",id:"opacity-percentage",importName:"postcssOpacityPercentage"},{packageName:"postcss-overflow-shorthand",id:"overflow-property",importName:"postcssOverflowShorthand"},{packageName:"postcss-page-break",id:"break-properties",importName:"postcssPageBreak"},{packageName:"postcss-place",id:"place-properties",importName:"postcssPlace"},{packageName:"postcss-pseudo-class-any-link",id:"any-link-pseudo-class",importName:"postcssPseudoClassAnyLink"},{packageName:"postcss-replace-overflow-wrap",id:"overflow-wrap-property",importName:"postcssReplaceOverflowWrap"},{packageName:"postcss-selector-not",id:"not-pseudo-class",importName:"postcssSelectorNot"},{packageName:"@csstools/postcss-stepped-value-functions",id:"stepped-value-functions",importName:"postcssSteppedValueFunctions"},{packageName:"postcss-system-ui-font-family",importedPackage:"../patch/postcss-system-ui-font-family.mjs",id:"system-ui-font-family",importName:"postcssFontFamilySystemUI"},{packageName:"@csstools/postcss-unset-value",id:"unset-value",importName:"postcssUnsetValue"},{packageName:"@csstools/postcss-cascade-layers",id:"cascade-layers",importName:"postcssCascadeLayers"},{packageName:"@csstools/postcss-trigonometric-functions",id:"trigonometric-functions",importName:"postcssTrigonometricFunctions"},{packageName:"@csstools/postcss-nested-calc",id:"nested-calc",importName:"postcssNestedCalc"},{packageName:"@csstools/postcss-text-decoration-shorthand",id:"text-decoration-shorthand",importName:"postcssTextDecorationShorthand"},{packageName:"@csstools/postcss-sign-functions",id:"sign-functions",importName:"postcssSignFunctions"},{packageName:"@csstools/postcss-random-function",id:"random-function",importName:"postcssRandomFunction"},{packageName:"@csstools/postcss-progressive-custom-properties",id:"progressive-custom-properties",importName:"postcssProgressiveCustomProperties",omitTypedOptions:!0,omitDocs:!0}];function getPackageNamesToIds(){const s={};return Ss.forEach((o=>{s[o.packageName]=o.id})),s}function pluginIdHelp(s,o,e){const t=Ss.map((s=>s.id)),i=Ss.map((s=>s.packageName)),a=getPackageNamesToIds();s.forEach((s=>{if(t.includes(s))return;const r=[...t.map((o=>[o,levenshteinDistance(s,o)])),...i.map((o=>[a[o],levenshteinDistance(s,o)]))].sort(((s,o)=>s[1]-o[1])).filter((s=>s[1]<10)),c=new Set;for(let s=0;s<r.length&&(c.add(r[s][0]),!(c.size>=3));s++);if(!c.size)return void o.warn(e,`Unknown feature: "${s}", see the list of features https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/FEATURES.md`);let p='"';p+=Array.from(c).join('", "'),p+='"',o.warn(e,`Unknown feature: "${s}", did you mean one of: ${p}`)}))}function levenshteinDistance(s,o){if(!s.length)return o.length;if(!o.length)return s.length;const e=[];for(let t=0;t<=o.length;t++){e[t]=[t];for(let i=1;i<=s.length;i++)e[t][i]=0===t?i:Math.min(e[t-1][i]+1,e[t][i-1]+1,e[t-1][i-1]+(s[i-1]===o[t-1]?0:1))}return e[o.length][s.length]}const creator=e=>{const t=new Logger,i=Object(e),a=Object.keys(Object(i.features)),r=i.browsers?void 0:i.env,c=i.browsers,p=initializeSharedOptions(i),n=listFeatures(o,i,p,t),l=n.map((s=>s.plugin));!1!==i.autoprefixer&&l.push(s(Object.assign({env:r,overrideBrowserslist:c},i.autoprefixer))),logFeaturesList(n,i,t);const internalPlugin=()=>({postcssPlugin:"postcss-preset-env",OnceExit(s,{result:o}){pluginIdHelp(a,s,o),i.debug&&t.emitLogs(o),t.resetLogger()}});return internalPlugin.postcss=!0,{postcssPlugin:"postcss-preset-env",plugins:[...l,internalPlugin()]}};creator.postcss=!0;export{creator as default};
|
|
1
|
+
import s from"autoprefixer";import o from"cssdb";import e from"browserslist";import t from"@csstools/postcss-initial";import i from"@csstools/postcss-alpha-function";import a from"postcss-pseudo-class-any-link";import r from"css-blank-pseudo";import c from"postcss-page-break";import p from"@csstools/postcss-cascade-layers";import n from"postcss-attribute-case-insensitive";import l from"postcss-clamp";import m from"@csstools/postcss-color-function";import u from"@csstools/postcss-color-function-display-p3-linear";import d from"postcss-color-functional-notation";import f from"@csstools/postcss-color-mix-function";import g from"@csstools/postcss-color-mix-variadic-function-arguments";import h from"@csstools/postcss-content-alt-text";import b from"postcss-custom-media";import v from"postcss-custom-properties";import N from"postcss-custom-selectors";import y from"postcss-dir-pseudo-class";import k from"@csstools/postcss-normalize-display-values";import w from"postcss-double-position-gradients";import x from"@csstools/postcss-exponential-functions";import F from"@csstools/postcss-logical-float-and-clear";import $ from"postcss-focus-visible";import O from"postcss-focus-within";import S from"@csstools/postcss-font-format-keywords";import C from"postcss-font-variant";import P from"@csstools/postcss-gamut-mapping";import A from"postcss-gap-properties";import E from"@csstools/postcss-gradients-interpolation-method";import I from"css-has-pseudo";import L from"postcss-color-hex-alpha";import B from"@csstools/postcss-hwb-function";import q from"@csstools/postcss-ic-unit";import _ from"postcss-image-set-function";import U from"@csstools/postcss-is-pseudo-class";import j from"postcss-lab-function";import M from"@csstools/postcss-light-dark-function";import D from"@csstools/postcss-logical-overflow";import z from"@csstools/postcss-logical-overscroll-behavior";import R from"postcss-logical";import T from"@csstools/postcss-logical-resize";import V from"@csstools/postcss-logical-viewport-units";import H from"@csstools/postcss-media-queries-aspect-ratio-number-values";import W from"@csstools/postcss-media-minmax";import G from"@csstools/postcss-nested-calc";import K from"postcss-nesting";import Z from"postcss-selector-not";import Q from"@csstools/postcss-oklab-function";import J from"postcss-opacity-percentage";import X from"postcss-overflow-shorthand";import Y from"postcss-replace-overflow-wrap";import ss from"postcss-place";import os from"css-prefers-color-scheme";import es from"@csstools/postcss-progressive-custom-properties";import ts from"@csstools/postcss-random-function";import is from"postcss-color-rebeccapurple";import as from"@csstools/postcss-relative-color-syntax";import rs from"@csstools/postcss-scope-pseudo-class";import cs from"@csstools/postcss-sign-functions";import ps from"@csstools/postcss-stepped-value-functions";import ns from"@csstools/postcss-text-decoration-shorthand";import ls from"@csstools/postcss-trigonometric-functions";import ms from"@csstools/postcss-unset-value";const us={"blank-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-blank-pseudo/README.md#browser","focus-visible-pseudo-class":"https://github.com/WICG/focus-visible","focus-within-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/postcss-focus-within/README.md#browser","has-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-has-pseudo/README.md#browser","prefers-color-scheme-query":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-prefers-color-scheme/README.md#browser"},ds=["blank-pseudo-class","focus-visible-pseudo-class","focus-within-pseudo-class","has-pseudo-class","prefers-color-scheme-query"];function logFeaturesList(s,o,e){if(o.debug){e.log("Enabling the following feature(s):");const t=[],i=[];!1!==o.autoprefixer&&i.push(" autoprefixer"),s.forEach(s=>{s.id.startsWith("before")||s.id.startsWith("after")?i.push(` ${s.id} (injected via options)`):i.push(` ${s.id}`),void 0!==us[s.id]&&t.push(s.id)}),i.sort((s,o)=>s.localeCompare(o)),t.sort((s,o)=>s.localeCompare(o)),i.forEach(s=>e.log(s)),t.length&&(e.log("These feature(s) need a browser library to work:"),t.forEach(s=>e.log(` ${s}: ${us[s]}`)))}}function initializeSharedOptions(s){if("preserve"in s){const o={};return o.preserve=s.preserve,o}return!1}function clamp(s,o,e){return Math.max(s,Math.min(o,e))}function stageFromOptions(s,o){let e=2;if(void 0===s.stage)return o.log("Using features from Stage 2 (default)."),e;if(!1===s.stage)e=5;else{let o=parseInt(s.stage,10);Number.isNaN(o)&&(o=0),e=clamp(0,o,5)}return 5===e?o.log('Stage has been disabled, features will be handled via the "features" option.'):o.log(`Using features from Stage ${e}.`),e}const fs=Symbol("insertBefore"),gs=Symbol("insertAfter"),hs=Symbol("insertOrder"),bs=Symbol("plugin");function getTransformedInsertions(s,o,e){if("insertBefore"!==e&&"insertAfter"!==e)return[];const t="insertBefore"===e?fs:gs,i=[];for(const e in o){if(!Object.hasOwnProperty.call(o,e))continue;if(!s.find(s=>s.id===e))continue;let a=o[e];Array.isArray(a)||(a=[a]);for(let s=0;s<a.length;s++)i.push({id:e,[bs]:a[s],[hs]:s,[t]:!0})}return i}var vs=["custom-media-queries","environment-variables","image-set-function","media-query-ranges","media-queries-aspect-ratio-number-values","prefers-color-scheme-query","nesting-rules","custom-selectors","any-link-pseudo-class","case-insensitive-attributes","focus-visible-pseudo-class","focus-within-pseudo-class","not-pseudo-class","logical-properties-and-values","float-clear-logical-values","logical-overflow","logical-overscroll-behavior","logical-resize","logical-viewport-units","dir-pseudo-class","all-property","gradients-interpolation-method","color-mix-variadic-function-arguments","color-mix","alpha-function","relative-color-syntax","lab-function","oklab-function","color-function-display-p3-linear","color-function","hwb-function","color-functional-notation","rebeccapurple-color","hexadecimal-alpha-notation","light-dark-function","double-position-gradients","blank-pseudo-class","break-properties","font-variant-property","is-pseudo-class","scope-pseudo-class","has-pseudo-class","gap-properties","overflow-property","overflow-wrap-property","place-properties","system-ui-font-family","font-format-keywords","display-two-values","content-alt-text","ic-unit","opacity-percentage","text-decoration-shorthand","unset-value","random-function","sign-functions","stepped-value-functions","trigonometric-functions","exponential-functions","clamp","nested-calc","custom-properties","cascade-layers","progressive-custom-properties","gamut-mapping"];function featureIsLess(s,o){return s.id===o.id?s[fs]&&o[fs]||s[gs]&&o[gs]?clamp(-1,s[hs]-o[hs],1):s[fs]||o[gs]?-1:s[gs]||o[fs]?1:0:clamp(-1,vs.indexOf(s.id)-vs.indexOf(o.id),1)}function postcssSystemUiFont(){return{postcssPlugin:"postcss-system-ui-font",Declaration(s){Ns.test(s.prop)&&(s.value.includes(ws)||(s.value=s.value.replace(xs,Fs)))}}}postcssSystemUiFont.postcss=!0;const Ns=/(?:^(?:-|\\002d){2})|(?:^font(?:-family)?$)/i,ys="[\\f\\n\\r\\x09\\x20]",ks=["system-ui","-apple-system","Segoe UI","Roboto","Ubuntu","Cantarell","Noto Sans","sans-serif"],ws=ks.join(", "),xs=new RegExp(`(^|,|${ys}+)(?:system-ui${ys}*)(?:,${ys}*(?:${ks.join("|")})${ys}*)?(,|$)`,"i"),Fs=`$1${ws}$2`,$s=new Map([["all-property",t],["alpha-function",i],["any-link-pseudo-class",a],["blank-pseudo-class",r],["break-properties",c],["cascade-layers",p],["case-insensitive-attributes",n],["clamp",l],["color-function",m],["color-function-display-p3-linear",u],["color-functional-notation",d],["color-mix",f],["color-mix-variadic-function-arguments",g],["content-alt-text",h],["custom-media-queries",b],["custom-properties",v],["custom-selectors",N],["dir-pseudo-class",y],["display-two-values",k],["double-position-gradients",w],["exponential-functions",x],["float-clear-logical-values",F],["focus-visible-pseudo-class",$],["focus-within-pseudo-class",O],["font-format-keywords",S],["font-variant-property",C],["gamut-mapping",P],["gap-properties",A],["gradients-interpolation-method",E],["has-pseudo-class",I],["hexadecimal-alpha-notation",L],["hwb-function",B],["ic-unit",q],["image-set-function",_],["is-pseudo-class",U],["lab-function",j],["light-dark-function",M],["logical-overflow",D],["logical-overscroll-behavior",z],["logical-properties-and-values",R],["logical-resize",T],["logical-viewport-units",V],["media-queries-aspect-ratio-number-values",H],["media-query-ranges",W],["nested-calc",G],["nesting-rules",K],["not-pseudo-class",Z],["oklab-function",Q],["opacity-percentage",J],["overflow-property",X],["overflow-wrap-property",Y],["place-properties",ss],["prefers-color-scheme-query",os],["progressive-custom-properties",es],["random-function",ts],["rebeccapurple-color",is],["relative-color-syntax",as],["scope-pseudo-class",rs],["sign-functions",cs],["stepped-value-functions",ps],["system-ui-font-family",postcssSystemUiFont],["text-decoration-shorthand",ns],["trigonometric-functions",ls],["unset-value",ms]]);function featureIsInsertedOrHasAPlugin(s){return!!s[fs]||(!!s[gs]||!!$s.has(s.id))}function prepareFeaturesList(s,o,e){return s.concat(getTransformedInsertions(s,o,"insertBefore"),getTransformedInsertions(s,e,"insertAfter")).filter(s=>featureIsInsertedOrHasAPlugin(s)).sort((s,o)=>featureIsLess(s,o))}function getOptionsForBrowsersByFeature(s,o,e,t){switch(o.id){case"is-pseudo-class":return{onComplexSelector:"warning"};case"any-link-pseudo-class":if(s.find(s=>s.startsWith("ie ")||"edge 12"===s||"edge 13"===s||"edge 14"===s||"edge 15"===s||"edge 16"===s||"edge 17"===s||"edge 18"===s))return t.log("- 'any-link-pseudo-class' setting 'subFeatures: { areaHrefNeedsFixing: true }' due to lack of browser support for area[href] in Edge and IE."),{subFeatures:{areaHrefNeedsFixing:!0}};return{};case"logical-properties-and-values":case"float-clear-logical-values":case"logical-resize":case"logical-viewport-units":case"logical-overflow":case"logical-overscroll-behavior":return"logical"in e?e.logical:{};default:return{}}}const Os=["and_chr","and_ff","android","chrome","edge","firefox","ie","ios_saf","op_mini","op_mob","opera","safari","samsung"];function getUnsupportedBrowsersByFeature(s){if(!s)return[];if(!("browser_support"in s))return["> 0%"];const o=[];return Os.forEach(e=>{if("op_mini"===e&&void 0===s.browser_support[e])return void o.push("op_mini all");const t=s.browser_support[e];"string"==typeof t&&Ss.test(t)?o.push(`${e} < ${s.browser_support[e]}`):o.push(`${e} >= 1`)}),o}const Ss=/^[0-9|.]+$/;function formatPolyfillableFeature(s){const o=getUnsupportedBrowsersByFeature(s);if(s[fs]||s[gs]){let e=s.id;return e=s.insertBefore?`before-${e}`:`after-${e}`,{browsers:o,vendors_implementations:s.vendors_implementations,plugin:s[bs],id:e,stage:6}}return{browsers:o,vendors_implementations:s.vendors_implementations,plugin:$s.get(s.id),id:s.id,stage:s.stage}}function formatStagedFeature(s,o,e,t,i,a){let r,c;return r=getOptionsForBrowsersByFeature(s,e,i,a),r=t?Object.assign({},r,t,featureOptions(o,e.id)):Object.assign({},r,featureOptions(o,e.id)),"progressive-custom-properties"!==e.id&&(r.enableProgressiveCustomProperties=!1),"overflow-wrap-property"===e.id&&"preserve"in r&&(r.method=r.preserve?"copy":"replace"),c=e.plugin.postcss&&"function"==typeof e.plugin?e.plugin(r):e.plugin&&e.plugin.default&&"function"==typeof e.plugin.default&&e.plugin.default.postcss?e.plugin.default(r):e.plugin,{browsers:e.browsers,vendors_implementations:e.vendors_implementations,plugin:c,pluginOptions:r,id:e.id}}function featureOptions(s,o){if(!(o in s))return;const e=s[o];return Array.isArray(e)?e[1]:e}function intOrZero(s){const o=parseInt(s,10);return Number.isNaN(o)?0:o}const Cs=new Set(["progressive-custom-properties"]);function listFeatures(s,o,t,i){const a=Object(o.features),r="enableClientSidePolyfills"in o&&o.enableClientSidePolyfills,c=Object(o.insertBefore),p=Object(o.insertAfter),n=o.browsers?void 0:o.env,l=o.browsers,m=clamp(0,intOrZero(o.minimumVendorImplementations),3);m>0&&i.log(`Using features with ${m} or more vendor implementations.`);const u=stageFromOptions(o,i),d=prepareFeaturesList([...s,{id:"progressive-custom-properties"}],c,p).map(s=>formatPolyfillableFeature(s)).filter(s=>!!Cs.has(s.id)||(0===m||(!(!s[fs]&&!s[gs])||(m<=s.vendors_implementations||(!0===featureEnabledByOptions(a,s.id)?(i.log(`- '${s.id}' enabled manually even when it lacks the required interop (${s.vendors_implementations} out of ${m}).`),!0):(i.log(`- '${s.id}' disabled because it lacks the required interop (${s.vendors_implementations} out of ${m}).`),!1)))))),f=e(l,{env:n,ignoreUnknownVersions:!0}).filter(s=>Os.includes(s.split(" ")[0]));return d.filter(s=>{if(Cs.has(s.id))return!0;const o=s.stage>=u,e=r||!ds.includes(s.id),t=featureEnabledByOptions(a,s.id),c=!1===t,p=!0===t||o&&e;return c?i.log(`- '${s.id}' disabled manually`):o?e||i.log(`- '${s.id}' disabled because 'enableClientSidePolyfills' is 'false'.`):p?i.log(`- '${s.id}' enabled manually even when it lacks the required stage (${s.stage} out of ${u}).`):i.log(`- '${s.id}' disabled because it lacks the required stage (${s.stage} out of ${u}).`),!c&&p}).map(s=>formatStagedFeature(f,a,s,t,o,i)).filter(s=>{if(Cs.has(s.id))return!0;const o=featureEnabledByOptions(a,s.id);if(!0===o||!1===o)return o;const t=e(s.browsers,{ignoreUnknownVersions:!0}),r=f.filter(s=>t.some(o=>o===s));return r.length>0?i.log(`- '${s.id}' enabled for:\n ${r.join("\n ")}`):i.log(`- '${s.id}' disabled because all targeted browsers support it.`),r.length>0})}function featureEnabledByOptions(s,o){if(!(o in s))return"auto";const e=s[o];return Array.isArray(e)?!0===e[0]||!1!==e[0]&&"auto":Boolean(e)}class Logger{constructor(){this.logs=[]}log(s){this.logs.push(s)}resetLogger(){this.logs.length=0}emitLogs(s){s&&s.warn(this.logs.join("\n")),this.resetLogger()}}var Ps=[{packageName:"css-blank-pseudo",id:"blank-pseudo-class",importName:"postcssBlankPseudo"},{packageName:"css-has-pseudo",id:"has-pseudo-class",importName:"postcssHasPseudo"},{packageName:"css-prefers-color-scheme",id:"prefers-color-scheme-query",importName:"postcssPrefersColorScheme"},{packageName:"postcss-attribute-case-insensitive",id:"case-insensitive-attributes",importName:"postcssAttributeCaseInsensitive"},{packageName:"postcss-clamp",id:"clamp",importName:"postcssClamp"},{packageName:"@csstools/postcss-alpha-function",id:"alpha-function",importName:"postcssAlphaFunction"},{packageName:"@csstools/postcss-color-mix-variadic-function-arguments",id:"color-mix-variadic-function-arguments",importName:"postcssColorMixVariadicFunctionArguments"},{packageName:"@csstools/postcss-color-mix-function",id:"color-mix",importName:"postcssColorMixFunction"},{packageName:"@csstools/postcss-color-function",id:"color-function",importName:"postcssColorFunction"},{packageName:"@csstools/postcss-color-function-display-p3-linear",id:"color-function-display-p3-linear",importName:"postcssColorFunctionDisplayP3Linear"},{packageName:"postcss-color-functional-notation",id:"color-functional-notation",importName:"postcssColorFunctionalNotation"},{packageName:"postcss-color-hex-alpha",id:"hexadecimal-alpha-notation",importName:"postcssColorHexAlpha"},{packageName:"@csstools/postcss-content-alt-text",id:"content-alt-text",importName:"postcssContentAltText"},{packageName:"postcss-color-rebeccapurple",id:"rebeccapurple-color",importName:"postcssColorRebeccapurple"},{packageName:"postcss-custom-media",id:"custom-media-queries",importName:"postcssCustomMedia"},{packageName:"postcss-custom-properties",id:"custom-properties",importName:"postcssCustomProperties"},{packageName:"postcss-custom-selectors",id:"custom-selectors",importName:"postcssCustomSelectors"},{packageName:"postcss-dir-pseudo-class",id:"dir-pseudo-class",importName:"postcssDirPseudoClass"},{packageName:"postcss-double-position-gradients",id:"double-position-gradients",importName:"postcssDoublePositionGradients"},{packageName:"@csstools/postcss-exponential-functions",id:"exponential-functions",importName:"postcssExponentialFunctions"},{packageName:"postcss-focus-visible",id:"focus-visible-pseudo-class",importName:"postcssFocusVisible"},{packageName:"postcss-focus-within",id:"focus-within-pseudo-class",importName:"postcssFocusWithin"},{packageName:"@csstools/postcss-font-format-keywords",id:"font-format-keywords",importName:"postcssFontFormatKeywords"},{packageName:"postcss-font-variant",id:"font-variant-property",importName:"postcssFontVariant"},{packageName:"@csstools/postcss-gamut-mapping",id:"gamut-mapping",importName:"postcssGamutMapping"},{packageName:"postcss-gap-properties",id:"gap-properties",importName:"postcssGapProperties"},{packageName:"@csstools/postcss-gradients-interpolation-method",id:"gradients-interpolation-method",importName:"postcssGradientsInterpolationMethod"},{packageName:"@csstools/postcss-hwb-function",id:"hwb-function",importName:"postcssHWBFunction"},{packageName:"@csstools/postcss-ic-unit",id:"ic-unit",importName:"postcssICUnit"},{packageName:"postcss-image-set-function",id:"image-set-function",importName:"postcssImageSetFunction"},{packageName:"@csstools/postcss-initial",id:"all-property",importName:"postcssInitial"},{packageName:"@csstools/postcss-is-pseudo-class",id:"is-pseudo-class",importName:"postcssIsPseudoClass"},{packageName:"@csstools/postcss-scope-pseudo-class",id:"scope-pseudo-class",importName:"postcssScopePseudoClass"},{packageName:"postcss-lab-function",id:"lab-function",importName:"postcssLabFunction"},{packageName:"@csstools/postcss-light-dark-function",id:"light-dark-function",importName:"postcssLightDarkFunction"},{packageName:"postcss-logical",id:"logical-properties-and-values",importName:"postcssLogical"},{packageName:"@csstools/postcss-logical-float-and-clear",id:"float-clear-logical-values",importName:"postcssLogicalFloatAndClear"},{packageName:"@csstools/postcss-logical-overflow",id:"logical-overflow",importName:"postcssLogicalOverflow"},{packageName:"@csstools/postcss-logical-overscroll-behavior",id:"logical-overscroll-behavior",importName:"postcssLogicalOverscrollBehavor"},{packageName:"@csstools/postcss-logical-resize",id:"logical-resize",importName:"postcssLogicalResize"},{packageName:"@csstools/postcss-logical-viewport-units",id:"logical-viewport-units",importName:"postcssLogicalViewportUnits"},{packageName:"@csstools/postcss-media-minmax",id:"media-query-ranges",importName:"postcssMediaMinmax"},{packageName:"@csstools/postcss-media-queries-aspect-ratio-number-values",id:"media-queries-aspect-ratio-number-values",importName:"postcssMediaQueriesAspectRatioNumberValues"},{packageName:"postcss-nesting",id:"nesting-rules",importName:"postcssNesting"},{packageName:"@csstools/postcss-normalize-display-values",id:"display-two-values",importName:"postcssNormalizeDisplayValues"},{packageName:"@csstools/postcss-oklab-function",id:"oklab-function",importName:"postcssOKLabFunction"},{packageName:"@csstools/postcss-relative-color-syntax",id:"relative-color-syntax",importName:"postcssRelativeColorSyntax"},{packageName:"postcss-opacity-percentage",id:"opacity-percentage",importName:"postcssOpacityPercentage"},{packageName:"postcss-overflow-shorthand",id:"overflow-property",importName:"postcssOverflowShorthand"},{packageName:"postcss-page-break",id:"break-properties",importName:"postcssPageBreak"},{packageName:"postcss-place",id:"place-properties",importName:"postcssPlace"},{packageName:"postcss-pseudo-class-any-link",id:"any-link-pseudo-class",importName:"postcssPseudoClassAnyLink"},{packageName:"postcss-replace-overflow-wrap",id:"overflow-wrap-property",importName:"postcssReplaceOverflowWrap"},{packageName:"postcss-selector-not",id:"not-pseudo-class",importName:"postcssSelectorNot"},{packageName:"@csstools/postcss-stepped-value-functions",id:"stepped-value-functions",importName:"postcssSteppedValueFunctions"},{packageName:"postcss-system-ui-font-family",importedPackage:"../patch/postcss-system-ui-font-family.mjs",id:"system-ui-font-family",importName:"postcssFontFamilySystemUI"},{packageName:"@csstools/postcss-unset-value",id:"unset-value",importName:"postcssUnsetValue"},{packageName:"@csstools/postcss-cascade-layers",id:"cascade-layers",importName:"postcssCascadeLayers"},{packageName:"@csstools/postcss-trigonometric-functions",id:"trigonometric-functions",importName:"postcssTrigonometricFunctions"},{packageName:"@csstools/postcss-nested-calc",id:"nested-calc",importName:"postcssNestedCalc"},{packageName:"@csstools/postcss-text-decoration-shorthand",id:"text-decoration-shorthand",importName:"postcssTextDecorationShorthand"},{packageName:"@csstools/postcss-sign-functions",id:"sign-functions",importName:"postcssSignFunctions"},{packageName:"@csstools/postcss-random-function",id:"random-function",importName:"postcssRandomFunction"},{packageName:"@csstools/postcss-progressive-custom-properties",id:"progressive-custom-properties",importName:"postcssProgressiveCustomProperties",omitTypedOptions:!0,omitDocs:!0}];function getPackageNamesToIds(){const s={};return Ps.forEach(o=>{s[o.packageName]=o.id}),s}function pluginIdHelp(s,o,e){const t=Ps.map(s=>s.id),i=Ps.map(s=>s.packageName),a=getPackageNamesToIds();s.forEach(s=>{if(t.includes(s))return;const r=[...t.map(o=>[o,levenshteinDistance(s,o)]),...i.map(o=>[a[o],levenshteinDistance(s,o)])].sort((s,o)=>s[1]-o[1]).filter(s=>s[1]<10),c=new Set;for(let s=0;s<r.length&&(c.add(r[s][0]),!(c.size>=3));s++);if(!c.size)return void o.warn(e,`Unknown feature: "${s}", see the list of features https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/FEATURES.md`);let p='"';p+=Array.from(c).join('", "'),p+='"',o.warn(e,`Unknown feature: "${s}", did you mean one of: ${p}`)})}function levenshteinDistance(s,o){if(!s.length)return o.length;if(!o.length)return s.length;const e=[];for(let t=0;t<=o.length;t++){e[t]=[t];for(let i=1;i<=s.length;i++)e[t][i]=0===t?i:Math.min(e[t-1][i]+1,e[t][i-1]+1,e[t-1][i-1]+(s[i-1]===o[t-1]?0:1))}return e[o.length][s.length]}const creator=e=>{const t=new Logger,i=Object(e),a=Object.keys(Object(i.features)),r=i.browsers?void 0:i.env,c=i.browsers,p=initializeSharedOptions(i),n=listFeatures(o,i,p,t),l=n.map(s=>s.plugin);!1!==i.autoprefixer&&l.push(s(Object.assign({env:r,overrideBrowserslist:c},i.autoprefixer))),logFeaturesList(n,i,t);const internalPlugin=()=>({postcssPlugin:"postcss-preset-env",OnceExit(s,{result:o}){pluginIdHelp(a,s,o),i.debug&&t.emitLogs(o),t.resetLogger()}});return internalPlugin.postcss=!0,{postcssPlugin:"postcss-preset-env",plugins:[...l,internalPlugin()]}};creator.postcss=!0;export{creator as default};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postcss-preset-env",
|
|
3
3
|
"description": "Convert modern CSS into something browsers understand",
|
|
4
|
-
"version": "10.
|
|
4
|
+
"version": "10.3.1",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
7
7
|
"name": "Antonio Laguna",
|
|
@@ -52,20 +52,22 @@
|
|
|
52
52
|
"dist"
|
|
53
53
|
],
|
|
54
54
|
"dependencies": {
|
|
55
|
+
"@csstools/postcss-alpha-function": "^1.0.0",
|
|
55
56
|
"@csstools/postcss-cascade-layers": "^5.0.2",
|
|
56
|
-
"@csstools/postcss-color-function": "^4.0.
|
|
57
|
-
"@csstools/postcss-color-
|
|
58
|
-
"@csstools/postcss-color-mix-
|
|
59
|
-
"@csstools/postcss-
|
|
57
|
+
"@csstools/postcss-color-function": "^4.0.11",
|
|
58
|
+
"@csstools/postcss-color-function-display-p3-linear": "^1.0.0",
|
|
59
|
+
"@csstools/postcss-color-mix-function": "^3.0.11",
|
|
60
|
+
"@csstools/postcss-color-mix-variadic-function-arguments": "^1.0.1",
|
|
61
|
+
"@csstools/postcss-content-alt-text": "^2.0.7",
|
|
60
62
|
"@csstools/postcss-exponential-functions": "^2.0.9",
|
|
61
63
|
"@csstools/postcss-font-format-keywords": "^4.0.0",
|
|
62
|
-
"@csstools/postcss-gamut-mapping": "^2.0.
|
|
63
|
-
"@csstools/postcss-gradients-interpolation-method": "^5.0.
|
|
64
|
-
"@csstools/postcss-hwb-function": "^4.0.
|
|
65
|
-
"@csstools/postcss-ic-unit": "^4.0.
|
|
64
|
+
"@csstools/postcss-gamut-mapping": "^2.0.11",
|
|
65
|
+
"@csstools/postcss-gradients-interpolation-method": "^5.0.11",
|
|
66
|
+
"@csstools/postcss-hwb-function": "^4.0.11",
|
|
67
|
+
"@csstools/postcss-ic-unit": "^4.0.3",
|
|
66
68
|
"@csstools/postcss-initial": "^2.0.1",
|
|
67
69
|
"@csstools/postcss-is-pseudo-class": "^5.0.3",
|
|
68
|
-
"@csstools/postcss-light-dark-function": "^2.0.
|
|
70
|
+
"@csstools/postcss-light-dark-function": "^2.0.10",
|
|
69
71
|
"@csstools/postcss-logical-float-and-clear": "^3.0.0",
|
|
70
72
|
"@csstools/postcss-logical-overflow": "^2.0.0",
|
|
71
73
|
"@csstools/postcss-logical-overscroll-behavior": "^2.0.0",
|
|
@@ -75,38 +77,38 @@
|
|
|
75
77
|
"@csstools/postcss-media-queries-aspect-ratio-number-values": "^3.0.5",
|
|
76
78
|
"@csstools/postcss-nested-calc": "^4.0.0",
|
|
77
79
|
"@csstools/postcss-normalize-display-values": "^4.0.0",
|
|
78
|
-
"@csstools/postcss-oklab-function": "^4.0.
|
|
79
|
-
"@csstools/postcss-progressive-custom-properties": "^4.
|
|
80
|
+
"@csstools/postcss-oklab-function": "^4.0.11",
|
|
81
|
+
"@csstools/postcss-progressive-custom-properties": "^4.2.0",
|
|
80
82
|
"@csstools/postcss-random-function": "^2.0.1",
|
|
81
|
-
"@csstools/postcss-relative-color-syntax": "^3.0.
|
|
83
|
+
"@csstools/postcss-relative-color-syntax": "^3.0.11",
|
|
82
84
|
"@csstools/postcss-scope-pseudo-class": "^4.0.1",
|
|
83
85
|
"@csstools/postcss-sign-functions": "^1.1.4",
|
|
84
86
|
"@csstools/postcss-stepped-value-functions": "^4.0.9",
|
|
85
|
-
"@csstools/postcss-text-decoration-shorthand": "^4.0.
|
|
87
|
+
"@csstools/postcss-text-decoration-shorthand": "^4.0.3",
|
|
86
88
|
"@csstools/postcss-trigonometric-functions": "^4.0.9",
|
|
87
89
|
"@csstools/postcss-unset-value": "^4.0.0",
|
|
88
90
|
"autoprefixer": "^10.4.21",
|
|
89
|
-
"browserslist": "^4.25.
|
|
91
|
+
"browserslist": "^4.25.1",
|
|
90
92
|
"css-blank-pseudo": "^7.0.1",
|
|
91
|
-
"css-has-pseudo": "^7.0.
|
|
93
|
+
"css-has-pseudo": "^7.0.3",
|
|
92
94
|
"css-prefers-color-scheme": "^10.0.0",
|
|
93
|
-
"cssdb": "^8.
|
|
95
|
+
"cssdb": "^8.4.0",
|
|
94
96
|
"postcss-attribute-case-insensitive": "^7.0.1",
|
|
95
97
|
"postcss-clamp": "^4.1.0",
|
|
96
|
-
"postcss-color-functional-notation": "^7.0.
|
|
98
|
+
"postcss-color-functional-notation": "^7.0.11",
|
|
97
99
|
"postcss-color-hex-alpha": "^10.0.0",
|
|
98
100
|
"postcss-color-rebeccapurple": "^10.0.0",
|
|
99
101
|
"postcss-custom-media": "^11.0.6",
|
|
100
102
|
"postcss-custom-properties": "^14.0.6",
|
|
101
103
|
"postcss-custom-selectors": "^8.0.5",
|
|
102
104
|
"postcss-dir-pseudo-class": "^9.0.1",
|
|
103
|
-
"postcss-double-position-gradients": "^6.0.
|
|
105
|
+
"postcss-double-position-gradients": "^6.0.3",
|
|
104
106
|
"postcss-focus-visible": "^10.0.1",
|
|
105
107
|
"postcss-focus-within": "^9.0.1",
|
|
106
108
|
"postcss-font-variant": "^5.0.0",
|
|
107
109
|
"postcss-gap-properties": "^6.0.0",
|
|
108
110
|
"postcss-image-set-function": "^7.0.0",
|
|
109
|
-
"postcss-lab-function": "^7.0.
|
|
111
|
+
"postcss-lab-function": "^7.0.11",
|
|
110
112
|
"postcss-logical": "^8.1.0",
|
|
111
113
|
"postcss-nesting": "^13.0.2",
|
|
112
114
|
"postcss-opacity-percentage": "^3.0.0",
|