From 2a8eabe48b86fc3434a8bc5c4e07016ea46f1eb6 Mon Sep 17 00:00:00 2001 From: Romain Menke Date: Sat, 20 Apr 2024 11:46:54 +0200 Subject: [PATCH 1/7] remove outdated internal logic --- .../postcss-preset-env/dist/index.cjs | 2 +- .../postcss-preset-env/dist/index.mjs | 2 +- .../src/lib/format-feature.mjs | 4 +- .../get-options-for-browsers-by-feature.mjs | 39 +------------------ .../src/lib/list-features.mjs | 2 +- .../src/test/lib/format-staged-feature.mjs | 6 --- .../test/basic.autoprefixer.expect.css | 2 +- .../test/basic.autoprefixer.false.expect.css | 2 +- ...basic.autoprefixer.remove.false.expect.css | 2 +- .../test/basic.ch38.expect.css | 2 +- .../test/basic.ch88-ff78-saf10.expect.css | 2 +- .../test/basic.ch88-ff78.expect.css | 2 +- .../postcss-preset-env/test/basic.expect.css | 2 +- .../test/basic.ff49.expect.css | 2 +- .../test/basic.ff66.expect.css | 2 +- .../test/basic.hebrew.expect.css | 2 +- .../test/basic.ie10.expect.css | 2 +- .../test/basic.nesting.true.expect.css | 2 +- .../test/basic.op_mini.expect.css | 2 +- .../test/basic.preserve.false.expect.css | 2 +- .../test/basic.preserve.true.expect.css | 9 ++++- .../test/basic.stage0-ff49.expect.css | 2 +- .../test/basic.stage0-ff66.expect.css | 2 +- .../test/basic.stage0.expect.css | 2 +- .../test/basic.vendors-1.expect.css | 2 +- .../test/basic.vendors-2.expect.css | 2 +- .../test/basic.vendors-3.expect.css | 2 +- .../test/layers-basic.expect.css | 2 +- .../layers-basic.preserve.true.expect.css | 9 ++++- 29 files changed, 43 insertions(+), 72 deletions(-) diff --git a/plugin-packs/postcss-preset-env/dist/index.cjs b/plugin-packs/postcss-preset-env/dist/index.cjs index 3095497b7..4e9026848 100644 --- a/plugin-packs/postcss-preset-env/dist/index.cjs +++ b/plugin-packs/postcss-preset-env/dist/index.cjs @@ -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("postcss-custom-media"),g=require("postcss-custom-properties"),f=require("postcss-custom-selectors"),b=require("postcss-dir-pseudo-class"),h=require("@csstools/postcss-normalize-display-values"),v=require("postcss-double-position-gradients"),N=require("@csstools/postcss-exponential-functions"),y=require("@csstools/postcss-logical-float-and-clear"),k=require("postcss-focus-visible"),w=require("postcss-focus-within"),q=require("@csstools/postcss-font-format-keywords"),x=require("postcss-font-variant"),F=require("@csstools/postcss-gamut-mapping"),O=require("postcss-gap-properties"),$=require("@csstools/postcss-gradients-interpolation-method"),S=require("css-has-pseudo"),P=require("postcss-color-hex-alpha"),C=require("@csstools/postcss-hwb-function"),I=require("@csstools/postcss-ic-unit"),B=require("postcss-image-set-function"),E=require("@csstools/postcss-is-pseudo-class"),A=require("postcss-lab-function"),L=require("@csstools/postcss-light-dark-function"),U=require("@csstools/postcss-logical-overflow"),_=require("@csstools/postcss-logical-overscroll-behavior"),j=require("postcss-logical"),D=require("@csstools/postcss-logical-resize"),M=require("@csstools/postcss-logical-viewport-units"),z=require("@csstools/postcss-media-queries-aspect-ratio-number-values"),R=require("@csstools/postcss-media-minmax"),V=require("@csstools/postcss-nested-calc"),T=require("postcss-nesting"),H=require("postcss-selector-not"),W=require("@csstools/postcss-oklab-function"),G=require("postcss-opacity-percentage"),K=require("postcss-overflow-shorthand"),Z=require("postcss-replace-overflow-wrap"),Q=require("postcss-place"),J=require("css-prefers-color-scheme"),X=require("@csstools/postcss-progressive-custom-properties"),Y=require("postcss-color-rebeccapurple"),ss=require("@csstools/postcss-relative-color-syntax"),es=require("@csstools/postcss-scope-pseudo-class"),os=require("@csstools/postcss-stepped-value-functions"),ts=require("@csstools/postcss-text-decoration-shorthand"),is=require("@csstools/postcss-trigonometric-functions"),rs=require("@csstools/postcss-unset-value");const as={"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"},cs=["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!==as[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}: ${as[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))}const ns=2,ps=5;function stageFromOptions(s,e){let o=ns;if(void 0===s.stage)return e.log(`Using features from Stage ${o} (default)`),o;if(!1===s.stage)o=ps;else{let e=parseInt(s.stage,10);Number.isNaN(e)&&(e=0),o=clamp(0,e,ps)}return o===ps?e.log('Stage has been disabled, features will be handled via the "features" option.'):e.log(`Using features from Stage ${o}`),o}const ls=Symbol("insertBefore"),us=Symbol("insertAfter"),ms=Symbol("insertOrder"),ds=Symbol("plugin");function getTransformedInsertions(s,e,o){if("insertBefore"!==o&&"insertAfter"!==o)return[];const t="insertBefore"===o?ls:us,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;sfeatureIsInsertedOrHasAPlugin(s))).sort(((s,e)=>featureIsLess(s,e)))}const ws=["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 ws.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&&qs.test(t)?e.push(`${o} < ${s.browser_support[o]}`):e.push(`${o} >= 1`)})),e}const qs=/^[0-9|.]+$/;function getOptionsForBrowsersByFeature(s,e,o,t,i){switch(e.id){case"is-pseudo-class":return{onComplexSelector:"warning"};case"nesting-rules":if(needsOptionFor(o.find((s=>"is-pseudo-class"===s.id)),s))return i.log('Disabling :is on "nesting-rules" due to lack of browser support.'),{noIsPseudoSelector:!0};return{};case"any-link-pseudo-class":if(s.find((s=>s.startsWith("ie ")||s.startsWith("edge "))))return i.log('Adding area[href] fallbacks for ":any-link" support 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 t?t.logical:{};default:return{}}}function needsOptionFor(s,e){const t=getUnsupportedBrowsersByFeature(s),i=o(t,{ignoreUnknownVersions:!0});return!!e.some((s=>i.some((e=>e===s))))}function formatPolyfillableFeature(s){const e=getUnsupportedBrowsersByFeature(s);if(s[ls]||s[us]){let o=s.id;return o=s.insertBefore?`before-${o}`:`after-${o}`,{browsers:e,vendors_implementations:s.vendors_implementations,plugin:s[ds],id:o,stage:ps+1}}return{browsers:e,vendors_implementations:s.vendors_implementations,plugin:ks.get(s.id),id:s.id,stage:s.stage}}function formatStagedFeature(s,e,o,t,i,r,a){let c,n;return c=getOptionsForBrowsersByFeature(e,t,s,r,a),c=i?Object.assign({},c,i,featureOptions(o,t.id)):Object.assign({},c,featureOptions(o,t.id)),"progressive-custom-properties"!==t.id&&(c.enableProgressiveCustomProperties=!1),"overflow-wrap-property"===t.id&&"preserve"in c&&(c.method=c.preserve?"copy":"replace"),n=t.plugin.postcss&&"function"==typeof t.plugin?t.plugin(c):t.plugin&&t.plugin.default&&"function"==typeof t.plugin.default&&t.plugin.default.postcss?t.plugin.default(c):t.plugin,{browsers:t.browsers,vendors_implementations:t.vendors_implementations,plugin:n,pluginOptions:c,id:t.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 xs=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=>!!xs.has(s.id)||(0===u||(!(!s[ls]&&!s[us])||(u<=s.vendors_implementations||(!0===featureEnabledByOptions(r,s.id)?(i.log(` ${s.id} does not meet the required vendor implementations but has been enabled by options`),!0):(i.log(` ${s.id} with ${s.vendors_implementations} vendor implementations has been disabled`),!1))))))),g=o(l,{env:p,ignoreUnknownVersions:!0}).filter((s=>ws.includes(s.split(" ")[0])));return d.filter((s=>{if(xs.has(s.id))return!0;const e=s.stage>=m,o=a||!cs.includes(s.id),t=featureEnabledByOptions(r,s.id),c=!1===t,n=!0===t||e&&o;return c?i.log(` ${s.id} has been disabled by options`):e?o||i.log(` ${s.id} has been disabled by "enableClientSidePolyfills: false".`):n?i.log(` ${s.id} does not meet the required stage but has been enabled by options`):i.log(` ${s.id} with stage ${s.stage} has been disabled`),!c&&n})).map((o=>formatStagedFeature(s,g,r,o,t,e,i))).filter((s=>{if(xs.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.some((s=>t.some((e=>e===s))));return a||i.log(`${s.id} disabled due to browser support`),a}))}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}dumpLogs(s){s&&s.warn(this.logs.join("\n")),this.resetLogger()}}var Fs=[{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-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:"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-progressive-custom-properties",id:"progressive-custom-properties",importName:"postcssProgressiveCustomProperties",omitTypedOptions:!0,omitDocs:!0}];function getPackageNamesToIds(){const s={};return Fs.forEach((e=>{s[e.packageName]=e.id})),s}function pluginIdHelp(s,e,o){const t=Fs.map((s=>s.id)),i=Fs.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=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.dumpLogs(e),t.resetLogger()}});return internalPlugin.postcss=!0,{postcssPlugin:"postcss-preset-env",plugins:[...l,internalPlugin()]}};creator.postcss=!0,module.exports=creator; +"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("postcss-custom-media"),g=require("postcss-custom-properties"),f=require("postcss-custom-selectors"),b=require("postcss-dir-pseudo-class"),h=require("@csstools/postcss-normalize-display-values"),v=require("postcss-double-position-gradients"),N=require("@csstools/postcss-exponential-functions"),y=require("@csstools/postcss-logical-float-and-clear"),k=require("postcss-focus-visible"),w=require("postcss-focus-within"),q=require("@csstools/postcss-font-format-keywords"),x=require("postcss-font-variant"),F=require("@csstools/postcss-gamut-mapping"),O=require("postcss-gap-properties"),$=require("@csstools/postcss-gradients-interpolation-method"),S=require("css-has-pseudo"),P=require("postcss-color-hex-alpha"),C=require("@csstools/postcss-hwb-function"),E=require("@csstools/postcss-ic-unit"),I=require("postcss-image-set-function"),A=require("@csstools/postcss-is-pseudo-class"),B=require("postcss-lab-function"),L=require("@csstools/postcss-light-dark-function"),U=require("@csstools/postcss-logical-overflow"),_=require("@csstools/postcss-logical-overscroll-behavior"),j=require("postcss-logical"),M=require("@csstools/postcss-logical-resize"),z=require("@csstools/postcss-logical-viewport-units"),D=require("@csstools/postcss-media-queries-aspect-ratio-number-values"),R=require("@csstools/postcss-media-minmax"),T=require("@csstools/postcss-nested-calc"),V=require("postcss-nesting"),H=require("postcss-selector-not"),W=require("@csstools/postcss-oklab-function"),G=require("postcss-opacity-percentage"),K=require("postcss-overflow-shorthand"),Z=require("postcss-replace-overflow-wrap"),Q=require("postcss-place"),J=require("css-prefers-color-scheme"),X=require("@csstools/postcss-progressive-custom-properties"),Y=require("postcss-color-rebeccapurple"),ss=require("@csstools/postcss-relative-color-syntax"),es=require("@csstools/postcss-scope-pseudo-class"),os=require("@csstools/postcss-stepped-value-functions"),ts=require("@csstools/postcss-text-decoration-shorthand"),is=require("@csstools/postcss-trigonometric-functions"),rs=require("@csstools/postcss-unset-value");const as={"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"},cs=["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!==as[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}: ${as[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))}const ns=2,ps=5;function stageFromOptions(s,e){let o=ns;if(void 0===s.stage)return e.log(`Using features from Stage ${o} (default)`),o;if(!1===s.stage)o=ps;else{let e=parseInt(s.stage,10);Number.isNaN(e)&&(e=0),o=clamp(0,e,ps)}return o===ps?e.log('Stage has been disabled, features will be handled via the "features" option.'):e.log(`Using features from Stage ${o}`),o}const ls=Symbol("insertBefore"),us=Symbol("insertAfter"),ms=Symbol("insertOrder"),ds=Symbol("plugin");function getTransformedInsertions(s,e,o){if("insertBefore"!==o&&"insertAfter"!==o)return[];const t="insertBefore"===o?ls:us,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;sfeatureIsInsertedOrHasAPlugin(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 ")||s.startsWith("edge "))))return t.log('Adding area[href] fallbacks for ":any-link" support 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 ws=["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 ws.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&&qs.test(t)?e.push(`${o} < ${s.browser_support[o]}`):e.push(`${o} >= 1`)})),e}const qs=/^[0-9|.]+$/;function formatPolyfillableFeature(s){const e=getUnsupportedBrowsersByFeature(s);if(s[ls]||s[us]){let o=s.id;return o=s.insertBefore?`before-${o}`:`after-${o}`,{browsers:e,vendors_implementations:s.vendors_implementations,plugin:s[ds],id:o,stage:ps+1}}return{browsers:e,vendors_implementations:s.vendors_implementations,plugin:ks.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 xs=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=>!!xs.has(s.id)||(0===u||(!(!s[ls]&&!s[us])||(u<=s.vendors_implementations||(!0===featureEnabledByOptions(r,s.id)?(i.log(` ${s.id} does not meet the required vendor implementations but has been enabled by options`),!0):(i.log(` ${s.id} with ${s.vendors_implementations} vendor implementations has been disabled`),!1))))))),g=o(l,{env:p,ignoreUnknownVersions:!0}).filter((s=>ws.includes(s.split(" ")[0])));return d.filter((s=>{if(xs.has(s.id))return!0;const e=s.stage>=m,o=a||!cs.includes(s.id),t=featureEnabledByOptions(r,s.id),c=!1===t,n=!0===t||e&&o;return c?i.log(` ${s.id} has been disabled by options`):e?o||i.log(` ${s.id} has been disabled by "enableClientSidePolyfills: false".`):n?i.log(` ${s.id} does not meet the required stage but has been enabled by options`):i.log(` ${s.id} with stage ${s.stage} has been disabled`),!c&&n})).map((s=>formatStagedFeature(g,r,s,t,e,i))).filter((s=>{if(xs.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.some((s=>t.some((e=>e===s))));return a||i.log(`${s.id} disabled due to browser support`),a}))}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}dumpLogs(s){s&&s.warn(this.logs.join("\n")),this.resetLogger()}}var Fs=[{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-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:"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-progressive-custom-properties",id:"progressive-custom-properties",importName:"postcssProgressiveCustomProperties",omitTypedOptions:!0,omitDocs:!0}];function getPackageNamesToIds(){const s={};return Fs.forEach((e=>{s[e.packageName]=e.id})),s}function pluginIdHelp(s,e,o){const t=Fs.map((s=>s.id)),i=Fs.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=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.dumpLogs(e),t.resetLogger()}});return internalPlugin.postcss=!0,{postcssPlugin:"postcss-preset-env",plugins:[...l,internalPlugin()]}};creator.postcss=!0,module.exports=creator; diff --git a/plugin-packs/postcss-preset-env/dist/index.mjs b/plugin-packs/postcss-preset-env/dist/index.mjs index 93078b0e9..084a142c7 100644 --- a/plugin-packs/postcss-preset-env/dist/index.mjs +++ b/plugin-packs/postcss-preset-env/dist/index.mjs @@ -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 r from"css-blank-pseudo";import a from"postcss-page-break";import p from"@csstools/postcss-cascade-layers";import c 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"postcss-custom-media";import f from"postcss-custom-properties";import g from"postcss-custom-selectors";import b from"postcss-dir-pseudo-class";import h from"@csstools/postcss-normalize-display-values";import v from"postcss-double-position-gradients";import N from"@csstools/postcss-exponential-functions";import y from"@csstools/postcss-logical-float-and-clear";import k from"postcss-focus-visible";import w from"postcss-focus-within";import x from"@csstools/postcss-font-format-keywords";import F from"postcss-font-variant";import O from"@csstools/postcss-gamut-mapping";import $ from"postcss-gap-properties";import S from"@csstools/postcss-gradients-interpolation-method";import P from"css-has-pseudo";import C from"postcss-color-hex-alpha";import I from"@csstools/postcss-hwb-function";import B from"@csstools/postcss-ic-unit";import E from"postcss-image-set-function";import A from"@csstools/postcss-is-pseudo-class";import L from"postcss-lab-function";import U from"@csstools/postcss-light-dark-function";import _ from"@csstools/postcss-logical-overflow";import q from"@csstools/postcss-logical-overscroll-behavior";import j from"postcss-logical";import D from"@csstools/postcss-logical-resize";import M from"@csstools/postcss-logical-viewport-units";import z from"@csstools/postcss-media-queries-aspect-ratio-number-values";import R from"@csstools/postcss-media-minmax";import V from"@csstools/postcss-nested-calc";import T from"postcss-nesting";import H from"postcss-selector-not";import W from"@csstools/postcss-oklab-function";import G from"postcss-opacity-percentage";import K from"postcss-overflow-shorthand";import Z from"postcss-replace-overflow-wrap";import Q from"postcss-place";import J from"css-prefers-color-scheme";import X from"@csstools/postcss-progressive-custom-properties";import Y from"postcss-color-rebeccapurple";import ss from"@csstools/postcss-relative-color-syntax";import os from"@csstools/postcss-scope-pseudo-class";import es from"@csstools/postcss-stepped-value-functions";import ts from"@csstools/postcss-text-decoration-shorthand";import is from"@csstools/postcss-trigonometric-functions";import rs from"@csstools/postcss-unset-value";const as={"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"},ps=["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!==as[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}: ${as[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))}const cs=2,ns=5;function stageFromOptions(s,o){let e=cs;if(void 0===s.stage)return o.log(`Using features from Stage ${e} (default)`),e;if(!1===s.stage)e=ns;else{let o=parseInt(s.stage,10);Number.isNaN(o)&&(o=0),e=clamp(0,o,ns)}return e===ns?o.log('Stage has been disabled, features will be handled via the "features" option.'):o.log(`Using features from Stage ${e}`),e}const ls=Symbol("insertBefore"),ms=Symbol("insertAfter"),us=Symbol("insertOrder"),ds=Symbol("plugin");function getTransformedInsertions(s,o,e){if("insertBefore"!==e&&"insertAfter"!==e)return[];const t="insertBefore"===e?ls:ms,i=[];for(const e in o){if(!Object.hasOwnProperty.call(o,e))continue;if(!s.find((s=>s.id===e)))continue;let r=o[e];Array.isArray(r)||(r=[r]);for(let s=0;sfeatureIsInsertedOrHasAPlugin(s))).sort(((s,o)=>featureIsLess(s,o)))}const ws=["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 ws.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&&xs.test(t)?o.push(`${e} < ${s.browser_support[e]}`):o.push(`${e} >= 1`)})),o}const xs=/^[0-9|.]+$/;function getOptionsForBrowsersByFeature(s,o,e,t,i){switch(o.id){case"is-pseudo-class":return{onComplexSelector:"warning"};case"nesting-rules":if(needsOptionFor(e.find((s=>"is-pseudo-class"===s.id)),s))return i.log('Disabling :is on "nesting-rules" due to lack of browser support.'),{noIsPseudoSelector:!0};return{};case"any-link-pseudo-class":if(s.find((s=>s.startsWith("ie ")||s.startsWith("edge "))))return i.log('Adding area[href] fallbacks for ":any-link" support 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 t?t.logical:{};default:return{}}}function needsOptionFor(s,o){const t=getUnsupportedBrowsersByFeature(s),i=e(t,{ignoreUnknownVersions:!0});return!!o.some((s=>i.some((o=>o===s))))}function formatPolyfillableFeature(s){const o=getUnsupportedBrowsersByFeature(s);if(s[ls]||s[ms]){let e=s.id;return e=s.insertBefore?`before-${e}`:`after-${e}`,{browsers:o,vendors_implementations:s.vendors_implementations,plugin:s[ds],id:e,stage:ns+1}}return{browsers:o,vendors_implementations:s.vendors_implementations,plugin:ks.get(s.id),id:s.id,stage:s.stage}}function formatStagedFeature(s,o,e,t,i,r,a){let p,c;return p=getOptionsForBrowsersByFeature(o,t,s,r,a),p=i?Object.assign({},p,i,featureOptions(e,t.id)):Object.assign({},p,featureOptions(e,t.id)),"progressive-custom-properties"!==t.id&&(p.enableProgressiveCustomProperties=!1),"overflow-wrap-property"===t.id&&"preserve"in p&&(p.method=p.preserve?"copy":"replace"),c=t.plugin.postcss&&"function"==typeof t.plugin?t.plugin(p):t.plugin&&t.plugin.default&&"function"==typeof t.plugin.default&&t.plugin.default.postcss?t.plugin.default(p):t.plugin,{browsers:t.browsers,vendors_implementations:t.vendors_implementations,plugin:c,pluginOptions:p,id:t.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 Fs=new Set(["progressive-custom-properties"]);function listFeatures(s,o,t,i){const r=Object(o.features),a="enableClientSidePolyfills"in o&&o.enableClientSidePolyfills,p=Object(o.insertBefore),c=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"}],p,c).map((s=>formatPolyfillableFeature(s))).filter((s=>!!Fs.has(s.id)||(0===m||(!(!s[ls]&&!s[ms])||(m<=s.vendors_implementations||(!0===featureEnabledByOptions(r,s.id)?(i.log(` ${s.id} does not meet the required vendor implementations but has been enabled by options`),!0):(i.log(` ${s.id} with ${s.vendors_implementations} vendor implementations has been disabled`),!1))))))),f=e(l,{env:n,ignoreUnknownVersions:!0}).filter((s=>ws.includes(s.split(" ")[0])));return d.filter((s=>{if(Fs.has(s.id))return!0;const o=s.stage>=u,e=a||!ps.includes(s.id),t=featureEnabledByOptions(r,s.id),p=!1===t,c=!0===t||o&&e;return p?i.log(` ${s.id} has been disabled by options`):o?e||i.log(` ${s.id} has been disabled by "enableClientSidePolyfills: false".`):c?i.log(` ${s.id} does not meet the required stage but has been enabled by options`):i.log(` ${s.id} with stage ${s.stage} has been disabled`),!p&&c})).map((e=>formatStagedFeature(s,f,r,e,t,o,i))).filter((s=>{if(Fs.has(s.id))return!0;const o=featureEnabledByOptions(r,s.id);if(!0===o||!1===o)return o;const t=e(s.browsers,{ignoreUnknownVersions:!0}),a=f.some((s=>t.some((o=>o===s))));return a||i.log(`${s.id} disabled due to browser support`),a}))}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}dumpLogs(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-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:"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-progressive-custom-properties",id:"progressive-custom-properties",importName:"postcssProgressiveCustomProperties",omitTypedOptions:!0,omitDocs:!0}];function getPackageNamesToIds(){const s={};return Os.forEach((o=>{s[o.packageName]=o.id})),s}function pluginIdHelp(s,o,e){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((o=>[o,levenshteinDistance(s,o)])),...i.map((o=>[r[o],levenshteinDistance(s,o)]))].sort(((s,o)=>s[1]-o[1])).filter((s=>s[1]<10)),p=new Set;for(let s=0;s=3));s++);if(!p.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 c='"';c+=Array.from(p).join('", "'),c+='"',o.warn(e,`Unknown feature: "${s}", did you mean one of: ${c}`)}))}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),r=Object.keys(Object(i.features)),a=i.browsers?void 0:i.env,p=i.browsers,c=initializeSharedOptions(i),n=listFeatures(o,i,c,t),l=n.map((s=>s.plugin));!1!==i.autoprefixer&&l.push(s(Object.assign({env:a,overrideBrowserslist:p},i.autoprefixer))),logFeaturesList(n,i,t);const internalPlugin=()=>({postcssPlugin:"postcss-preset-env",OnceExit(s,{result:o}){pluginIdHelp(r,s,o),i.debug&&t.dumpLogs(o),t.resetLogger()}});return internalPlugin.postcss=!0,{postcssPlugin:"postcss-preset-env",plugins:[...l,internalPlugin()]}};creator.postcss=!0;export{creator as default}; +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 r from"css-blank-pseudo";import a 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"postcss-custom-media";import f from"postcss-custom-properties";import g from"postcss-custom-selectors";import b from"postcss-dir-pseudo-class";import h from"@csstools/postcss-normalize-display-values";import v from"postcss-double-position-gradients";import N from"@csstools/postcss-exponential-functions";import y from"@csstools/postcss-logical-float-and-clear";import k from"postcss-focus-visible";import w from"postcss-focus-within";import x from"@csstools/postcss-font-format-keywords";import F from"postcss-font-variant";import O from"@csstools/postcss-gamut-mapping";import $ from"postcss-gap-properties";import S from"@csstools/postcss-gradients-interpolation-method";import P from"css-has-pseudo";import C from"postcss-color-hex-alpha";import E from"@csstools/postcss-hwb-function";import I from"@csstools/postcss-ic-unit";import A from"postcss-image-set-function";import B from"@csstools/postcss-is-pseudo-class";import L from"postcss-lab-function";import U from"@csstools/postcss-light-dark-function";import _ from"@csstools/postcss-logical-overflow";import q from"@csstools/postcss-logical-overscroll-behavior";import j from"postcss-logical";import M from"@csstools/postcss-logical-resize";import z from"@csstools/postcss-logical-viewport-units";import D from"@csstools/postcss-media-queries-aspect-ratio-number-values";import R from"@csstools/postcss-media-minmax";import T from"@csstools/postcss-nested-calc";import V from"postcss-nesting";import H from"postcss-selector-not";import W from"@csstools/postcss-oklab-function";import G from"postcss-opacity-percentage";import K from"postcss-overflow-shorthand";import Z from"postcss-replace-overflow-wrap";import Q from"postcss-place";import J from"css-prefers-color-scheme";import X from"@csstools/postcss-progressive-custom-properties";import Y from"postcss-color-rebeccapurple";import ss from"@csstools/postcss-relative-color-syntax";import os from"@csstools/postcss-scope-pseudo-class";import es from"@csstools/postcss-stepped-value-functions";import ts from"@csstools/postcss-text-decoration-shorthand";import is from"@csstools/postcss-trigonometric-functions";import rs from"@csstools/postcss-unset-value";const as={"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"},cs=["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!==as[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}: ${as[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))}const ps=2,ns=5;function stageFromOptions(s,o){let e=ps;if(void 0===s.stage)return o.log(`Using features from Stage ${e} (default)`),e;if(!1===s.stage)e=ns;else{let o=parseInt(s.stage,10);Number.isNaN(o)&&(o=0),e=clamp(0,o,ns)}return e===ns?o.log('Stage has been disabled, features will be handled via the "features" option.'):o.log(`Using features from Stage ${e}`),e}const ls=Symbol("insertBefore"),ms=Symbol("insertAfter"),us=Symbol("insertOrder"),ds=Symbol("plugin");function getTransformedInsertions(s,o,e){if("insertBefore"!==e&&"insertAfter"!==e)return[];const t="insertBefore"===e?ls:ms,i=[];for(const e in o){if(!Object.hasOwnProperty.call(o,e))continue;if(!s.find((s=>s.id===e)))continue;let r=o[e];Array.isArray(r)||(r=[r]);for(let s=0;sfeatureIsInsertedOrHasAPlugin(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 ")||s.startsWith("edge "))))return t.log('Adding area[href] fallbacks for ":any-link" support 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 ws=["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 ws.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&&xs.test(t)?o.push(`${e} < ${s.browser_support[e]}`):o.push(`${e} >= 1`)})),o}const xs=/^[0-9|.]+$/;function formatPolyfillableFeature(s){const o=getUnsupportedBrowsersByFeature(s);if(s[ls]||s[ms]){let e=s.id;return e=s.insertBefore?`before-${e}`:`after-${e}`,{browsers:o,vendors_implementations:s.vendors_implementations,plugin:s[ds],id:e,stage:ns+1}}return{browsers:o,vendors_implementations:s.vendors_implementations,plugin:ks.get(s.id),id:s.id,stage:s.stage}}function formatStagedFeature(s,o,e,t,i,r){let a,c;return a=getOptionsForBrowsersByFeature(s,e,i,r),a=t?Object.assign({},a,t,featureOptions(o,e.id)):Object.assign({},a,featureOptions(o,e.id)),"progressive-custom-properties"!==e.id&&(a.enableProgressiveCustomProperties=!1),"overflow-wrap-property"===e.id&&"preserve"in a&&(a.method=a.preserve?"copy":"replace"),c=e.plugin.postcss&&"function"==typeof e.plugin?e.plugin(a):e.plugin&&e.plugin.default&&"function"==typeof e.plugin.default&&e.plugin.default.postcss?e.plugin.default(a):e.plugin,{browsers:e.browsers,vendors_implementations:e.vendors_implementations,plugin:c,pluginOptions:a,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 Fs=new Set(["progressive-custom-properties"]);function listFeatures(s,o,t,i){const r=Object(o.features),a="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=>!!Fs.has(s.id)||(0===m||(!(!s[ls]&&!s[ms])||(m<=s.vendors_implementations||(!0===featureEnabledByOptions(r,s.id)?(i.log(` ${s.id} does not meet the required vendor implementations but has been enabled by options`),!0):(i.log(` ${s.id} with ${s.vendors_implementations} vendor implementations has been disabled`),!1))))))),f=e(l,{env:n,ignoreUnknownVersions:!0}).filter((s=>ws.includes(s.split(" ")[0])));return d.filter((s=>{if(Fs.has(s.id))return!0;const o=s.stage>=u,e=a||!cs.includes(s.id),t=featureEnabledByOptions(r,s.id),c=!1===t,p=!0===t||o&&e;return c?i.log(` ${s.id} has been disabled by options`):o?e||i.log(` ${s.id} has been disabled by "enableClientSidePolyfills: false".`):p?i.log(` ${s.id} does not meet the required stage but has been enabled by options`):i.log(` ${s.id} with stage ${s.stage} has been disabled`),!c&&p})).map((s=>formatStagedFeature(f,r,s,t,o,i))).filter((s=>{if(Fs.has(s.id))return!0;const o=featureEnabledByOptions(r,s.id);if(!0===o||!1===o)return o;const t=e(s.browsers,{ignoreUnknownVersions:!0}),a=f.some((s=>t.some((o=>o===s))));return a||i.log(`${s.id} disabled due to browser support`),a}))}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}dumpLogs(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-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:"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-progressive-custom-properties",id:"progressive-custom-properties",importName:"postcssProgressiveCustomProperties",omitTypedOptions:!0,omitDocs:!0}];function getPackageNamesToIds(){const s={};return Os.forEach((o=>{s[o.packageName]=o.id})),s}function pluginIdHelp(s,o,e){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((o=>[o,levenshteinDistance(s,o)])),...i.map((o=>[r[o],levenshteinDistance(s,o)]))].sort(((s,o)=>s[1]-o[1])).filter((s=>s[1]<10)),c=new Set;for(let s=0;s=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),r=Object.keys(Object(i.features)),a=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:a,overrideBrowserslist:c},i.autoprefixer))),logFeaturesList(n,i,t);const internalPlugin=()=>({postcssPlugin:"postcss-preset-env",OnceExit(s,{result:o}){pluginIdHelp(r,s,o),i.debug&&t.dumpLogs(o),t.resetLogger()}});return internalPlugin.postcss=!0,{postcssPlugin:"postcss-preset-env",plugins:[...l,internalPlugin()]}};creator.postcss=!0;export{creator as default}; diff --git a/plugin-packs/postcss-preset-env/src/lib/format-feature.mjs b/plugin-packs/postcss-preset-env/src/lib/format-feature.mjs index d62d56f6b..5d4d36ceb 100644 --- a/plugin-packs/postcss-preset-env/src/lib/format-feature.mjs +++ b/plugin-packs/postcss-preset-env/src/lib/format-feature.mjs @@ -33,11 +33,11 @@ export function formatPolyfillableFeature(feature) { }; } -export function formatStagedFeature(cssdbList, supportedBrowsers, features, feature, sharedOptions, options, logger) { +export function formatStagedFeature(supportedBrowsers, features, feature, sharedOptions, options, logger) { let pluginOption; let plugin; - pluginOption = getOptionsForBrowsersByFeature(supportedBrowsers, feature, cssdbList, options, logger); + pluginOption = getOptionsForBrowsersByFeature(supportedBrowsers, feature, options, logger); if (sharedOptions) { pluginOption = Object.assign({}, pluginOption, sharedOptions, featureOptions(features, feature.id)); diff --git a/plugin-packs/postcss-preset-env/src/lib/get-options-for-browsers-by-feature.mjs b/plugin-packs/postcss-preset-env/src/lib/get-options-for-browsers-by-feature.mjs index a928c9263..1bc7d5a82 100644 --- a/plugin-packs/postcss-preset-env/src/lib/get-options-for-browsers-by-feature.mjs +++ b/plugin-packs/postcss-preset-env/src/lib/get-options-for-browsers-by-feature.mjs @@ -1,8 +1,5 @@ -import browserslist from 'browserslist'; -import { getUnsupportedBrowsersByFeature } from './get-unsupported-browsers-by-feature.mjs'; - // add extra options for certain browsers by feature -export default function getOptionsForBrowsersByFeature(supportedBrowsers, feature, cssdbList, options, logger) { +export default function getOptionsForBrowsersByFeature(supportedBrowsers, feature, options, logger) { switch (feature.id) { case 'is-pseudo-class': // Emit a warning to avoid making unresolved removal of `:is()` a feature. @@ -10,25 +7,6 @@ export default function getOptionsForBrowsersByFeature(supportedBrowsers, featur return { onComplexSelector: 'warning', }; - case 'nesting-rules': - { - // TODO : remove this in a next major release - - // Nesting rules can transform selectors to use :is pseudo. - // This is more spec compliant but it's not supported by all browsers. - // If we can't use :is pseudo according to preset-env options, we add an extra option to avoid :is pseudo. - const feature = cssdbList.find(feature => feature.id === 'is-pseudo-class'); - - if (needsOptionFor(feature, supportedBrowsers)) { - logger.log('Disabling :is on "nesting-rules" due to lack of browser support.'); - return { - noIsPseudoSelector: true, - }; - } - } - - return {}; - case 'any-link-pseudo-class': { const hasIEOrEdge = supportedBrowsers.find((browserslistEntry) => { @@ -64,18 +42,3 @@ export default function getOptionsForBrowsersByFeature(supportedBrowsers, featur return {}; } } - -function needsOptionFor(feature, supportedBrowsers) { - const unsupportedIn = getUnsupportedBrowsersByFeature(feature); - const unsupportedBrowsers = browserslist(unsupportedIn, { - ignoreUnknownVersions: true, - }); - - if (supportedBrowsers.some((supportedBrowser) => { - return unsupportedBrowsers.some(polyfillBrowser => polyfillBrowser === supportedBrowser); - })) { - return true; - } - - return false; -} diff --git a/plugin-packs/postcss-preset-env/src/lib/list-features.mjs b/plugin-packs/postcss-preset-env/src/lib/list-features.mjs index 757a1e145..90e1b0c3a 100644 --- a/plugin-packs/postcss-preset-env/src/lib/list-features.mjs +++ b/plugin-packs/postcss-preset-env/src/lib/list-features.mjs @@ -104,7 +104,7 @@ export function listFeatures(cssdbList, options, sharedOptions, logger) { return !isDisabled && isAllowedFeature; }).map((feature) => { - return formatStagedFeature(cssdbList, supportedBrowsers, features, feature, sharedOptions, options, logger); + return formatStagedFeature(supportedBrowsers, features, feature, sharedOptions, options, logger); }); // - features supported by the stage diff --git a/plugin-packs/postcss-preset-env/src/test/lib/format-staged-feature.mjs b/plugin-packs/postcss-preset-env/src/test/lib/format-staged-feature.mjs index bc7c71494..76ab5e2c3 100644 --- a/plugin-packs/postcss-preset-env/src/test/lib/format-staged-feature.mjs +++ b/plugin-packs/postcss-preset-env/src/test/lib/format-staged-feature.mjs @@ -7,7 +7,6 @@ const testLogger = newTestLogger(); assert.deepStrictEqual( formatStagedFeature( - [], browserslist(['ie >= 1'], { ignoreUnknownVersions: true }), {}, { @@ -40,7 +39,6 @@ assert.deepStrictEqual( assert.deepStrictEqual( formatStagedFeature( - [], browserslist(['ie >= 1'], { ignoreUnknownVersions: true }), { 'any-link-pseudo-class': true, @@ -75,7 +73,6 @@ assert.deepStrictEqual( assert.deepStrictEqual( formatStagedFeature( - [], browserslist(['ie >= 1'], { ignoreUnknownVersions: true }), { 'any-link-pseudo-class': true, @@ -113,7 +110,6 @@ assert.deepStrictEqual( assert.deepStrictEqual( formatStagedFeature( - [], browserslist(['ie >= 1'], { ignoreUnknownVersions: true }), {}, { @@ -150,7 +146,6 @@ assert.deepStrictEqual( // Logical does not get passed to a non-logical plugin assert.deepStrictEqual( formatStagedFeature( - [], browserslist(['ie >= 1'], { ignoreUnknownVersions: true }), {}, { @@ -203,7 +198,6 @@ assert.deepStrictEqual( for (const plugin of logicalPlugins) { assert.deepStrictEqual( formatStagedFeature( - [], browserslist(['ie >= 1'], { ignoreUnknownVersions: true }), {}, { diff --git a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css index 337c472e4..d77574824 100644 --- a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css @@ -58,7 +58,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css index 8f9a3dfe2..ffa4aadf3 100644 --- a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css @@ -58,7 +58,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.remove.false.expect.css b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.remove.false.expect.css index fb66bb13e..eec71fbfb 100644 --- a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.remove.false.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.remove.false.expect.css @@ -59,7 +59,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css b/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css index 7e6edfedd..8cc9fd22b 100644 --- a/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css @@ -51,7 +51,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/basic.ch88-ff78-saf10.expect.css b/plugin-packs/postcss-preset-env/test/basic.ch88-ff78-saf10.expect.css index 13f237838..bfb90e08f 100644 --- a/plugin-packs/postcss-preset-env/test/basic.ch88-ff78-saf10.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.ch88-ff78-saf10.expect.css @@ -58,7 +58,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/basic.ch88-ff78.expect.css b/plugin-packs/postcss-preset-env/test/basic.ch88-ff78.expect.css index 2ba9a5a58..e1039806f 100644 --- a/plugin-packs/postcss-preset-env/test/basic.ch88-ff78.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.ch88-ff78.expect.css @@ -58,7 +58,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/basic.expect.css b/plugin-packs/postcss-preset-env/test/basic.expect.css index e839ed785..8419991b7 100644 --- a/plugin-packs/postcss-preset-env/test/basic.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.expect.css @@ -59,7 +59,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css b/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css index 0341adadd..c75a75b26 100644 --- a/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css @@ -57,7 +57,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/basic.ff66.expect.css b/plugin-packs/postcss-preset-env/test/basic.ff66.expect.css index da47cbb92..5c0fdc432 100644 --- a/plugin-packs/postcss-preset-env/test/basic.ff66.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.ff66.expect.css @@ -56,7 +56,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/basic.hebrew.expect.css b/plugin-packs/postcss-preset-env/test/basic.hebrew.expect.css index bab0df223..d094a1970 100644 --- a/plugin-packs/postcss-preset-env/test/basic.hebrew.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.hebrew.expect.css @@ -59,7 +59,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/basic.ie10.expect.css b/plugin-packs/postcss-preset-env/test/basic.ie10.expect.css index e911a6237..4d36958e6 100644 --- a/plugin-packs/postcss-preset-env/test/basic.ie10.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.ie10.expect.css @@ -69,7 +69,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { -ms-flex-order: 8; order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/basic.nesting.true.expect.css b/plugin-packs/postcss-preset-env/test/basic.nesting.true.expect.css index 3ad7180dd..818a9a613 100644 --- a/plugin-packs/postcss-preset-env/test/basic.nesting.true.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.nesting.true.expect.css @@ -48,7 +48,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +:is(.test-nesting-rules,#test-is-pseudo) + p { order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/basic.op_mini.expect.css b/plugin-packs/postcss-preset-env/test/basic.op_mini.expect.css index 6f52edfaf..bfb1b492e 100644 --- a/plugin-packs/postcss-preset-env/test/basic.op_mini.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.op_mini.expect.css @@ -58,7 +58,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/basic.preserve.false.expect.css b/plugin-packs/postcss-preset-env/test/basic.preserve.false.expect.css index 582dbd204..6694fc797 100644 --- a/plugin-packs/postcss-preset-env/test/basic.preserve.false.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.preserve.false.expect.css @@ -87,7 +87,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { -webkit-box-ordinal-group: 9; -webkit-order: 8; -moz-box-ordinal-group: 9; diff --git a/plugin-packs/postcss-preset-env/test/basic.preserve.true.expect.css b/plugin-packs/postcss-preset-env/test/basic.preserve.true.expect.css index bf63b82e9..7b58c338a 100644 --- a/plugin-packs/postcss-preset-env/test/basic.preserve.true.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.preserve.true.expect.css @@ -102,7 +102,14 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { + -webkit-box-ordinal-group: 9; + -webkit-order: 8; + -moz-box-ordinal-group: 9; + order: 8; + } + +:is(.test-nesting-rules,#test-is-pseudo) + p { -webkit-box-ordinal-group: 9; -webkit-order: 8; -moz-box-ordinal-group: 9; diff --git a/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css b/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css index f0cc5d0e4..d01ae4495 100644 --- a/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css @@ -57,7 +57,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/basic.stage0-ff66.expect.css b/plugin-packs/postcss-preset-env/test/basic.stage0-ff66.expect.css index c29f9b73a..4c6fcc8ac 100644 --- a/plugin-packs/postcss-preset-env/test/basic.stage0-ff66.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.stage0-ff66.expect.css @@ -56,7 +56,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css b/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css index 4e9c66a9f..c5a91d6be 100644 --- a/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css @@ -59,7 +59,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/basic.vendors-1.expect.css b/plugin-packs/postcss-preset-env/test/basic.vendors-1.expect.css index 6c20b825c..f9b076714 100644 --- a/plugin-packs/postcss-preset-env/test/basic.vendors-1.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.vendors-1.expect.css @@ -59,7 +59,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/basic.vendors-2.expect.css b/plugin-packs/postcss-preset-env/test/basic.vendors-2.expect.css index 6c20b825c..f9b076714 100644 --- a/plugin-packs/postcss-preset-env/test/basic.vendors-2.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.vendors-2.expect.css @@ -59,7 +59,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/basic.vendors-3.expect.css b/plugin-packs/postcss-preset-env/test/basic.vendors-3.expect.css index 28aa00a71..54a0328f8 100644 --- a/plugin-packs/postcss-preset-env/test/basic.vendors-3.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.vendors-3.expect.css @@ -59,7 +59,7 @@ order: 9; } -.test-nesting-rules + p, #test-is-pseudo + p { +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } diff --git a/plugin-packs/postcss-preset-env/test/layers-basic.expect.css b/plugin-packs/postcss-preset-env/test/layers-basic.expect.css index 02b774efe..3376f9052 100644 --- a/plugin-packs/postcss-preset-env/test/layers-basic.expect.css +++ b/plugin-packs/postcss-preset-env/test/layers-basic.expect.css @@ -97,7 +97,7 @@ order: 9; } -.test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p, #test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p { +.test-nesting-rules:not(#does-not-exist):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p,#test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p { -webkit-box-ordinal-group: 9; -webkit-order: 8; -moz-box-ordinal-group: 9; diff --git a/plugin-packs/postcss-preset-env/test/layers-basic.preserve.true.expect.css b/plugin-packs/postcss-preset-env/test/layers-basic.preserve.true.expect.css index bf75e10f8..08692a54b 100644 --- a/plugin-packs/postcss-preset-env/test/layers-basic.preserve.true.expect.css +++ b/plugin-packs/postcss-preset-env/test/layers-basic.preserve.true.expect.css @@ -106,7 +106,14 @@ order: 9; } -.test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p, #test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p { +.test-nesting-rules:not(#does-not-exist):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p,#test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p { + -webkit-box-ordinal-group: 9; + -webkit-order: 8; + -moz-box-ordinal-group: 9; + order: 8; + } + +:is(.test-nesting-rules,#test-is-pseudo):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p { -webkit-box-ordinal-group: 9; -webkit-order: 8; -moz-box-ordinal-group: 9; From d7a6de93756a1fc50c53a98fbf909cde4387606f Mon Sep 17 00:00:00 2001 From: Romain Menke <11521496+romainmenke@users.noreply.github.com> Date: Sun, 21 Apr 2024 11:58:15 +0200 Subject: [PATCH 2/7] make node 18 the lowest supported version (#1371) --- .github/bin/format-package-json.mjs | 2 +- .github/workflows/test.yml | 4 ++-- cli/csstools-cli/CHANGELOG.md | 4 ++++ cli/csstools-cli/package.json | 2 +- experimental/css-has-pseudo/CHANGELOG.md | 4 ++++ experimental/css-has-pseudo/package.json | 2 +- experimental/postcss-gradient-stop-increments/CHANGELOG.md | 4 ++++ experimental/postcss-gradient-stop-increments/package.json | 2 +- experimental/postcss-nesting/CHANGELOG.md | 4 ++++ experimental/postcss-nesting/package.json | 2 +- packages/base-cli/CHANGELOG.md | 4 ++++ packages/base-cli/package.json | 2 +- packages/cascade-layer-name-parser/CHANGELOG.md | 4 ++++ packages/cascade-layer-name-parser/package.json | 2 +- packages/color-helpers/CHANGELOG.md | 4 ++++ packages/color-helpers/package.json | 2 +- packages/css-calc/CHANGELOG.md | 4 ++++ packages/css-calc/package.json | 2 +- packages/css-color-parser/CHANGELOG.md | 4 ++++ packages/css-color-parser/package.json | 2 +- packages/css-parser-algorithms/CHANGELOG.md | 4 ++++ packages/css-parser-algorithms/package.json | 2 +- packages/css-tokenizer/CHANGELOG.md | 4 ++++ packages/css-tokenizer/package.json | 2 +- packages/generate-test-cases/package.json | 2 +- packages/media-query-list-parser/CHANGELOG.md | 4 ++++ packages/media-query-list-parser/package.json | 2 +- packages/postcss-tape/CHANGELOG.md | 4 ++++ packages/postcss-tape/package.json | 2 +- packages/selector-resolve-nested/CHANGELOG.md | 4 ++++ packages/selector-resolve-nested/package.json | 2 +- packages/selector-specificity/CHANGELOG.md | 4 ++++ packages/selector-specificity/package.json | 2 +- packages/utilities/CHANGELOG.md | 4 ++++ packages/utilities/package.json | 2 +- plugin-packs/postcss-bundler/CHANGELOG.md | 4 ++++ plugin-packs/postcss-bundler/package.json | 2 +- plugin-packs/postcss-preset-env/CHANGELOG.md | 4 ++++ plugin-packs/postcss-preset-env/package.json | 2 +- plugins-stylelint/at-risk/CHANGELOG.md | 4 ++++ plugins-stylelint/at-risk/package.json | 2 +- plugins-stylelint/no-at-nest-rule/CHANGELOG.md | 4 ++++ plugins-stylelint/no-at-nest-rule/package.json | 2 +- .../no-invalid-at-import-rules-when-bundling/CHANGELOG.md | 4 ++++ .../no-invalid-at-import-rules-when-bundling/package.json | 2 +- plugins/css-blank-pseudo/CHANGELOG.md | 4 ++++ plugins/css-blank-pseudo/package.json | 2 +- plugins/css-has-pseudo/CHANGELOG.md | 4 ++++ plugins/css-has-pseudo/package.json | 2 +- plugins/css-prefers-color-scheme/CHANGELOG.md | 4 ++++ plugins/css-prefers-color-scheme/package.json | 2 +- plugins/postcss-attribute-case-insensitive/CHANGELOG.md | 4 ++++ plugins/postcss-attribute-case-insensitive/package.json | 2 +- plugins/postcss-base-plugin/CHANGELOG.md | 4 ++++ plugins/postcss-base-plugin/package.json | 2 +- plugins/postcss-cascade-layers/CHANGELOG.md | 4 ++++ plugins/postcss-cascade-layers/package.json | 2 +- plugins/postcss-color-function/CHANGELOG.md | 4 ++++ plugins/postcss-color-function/package.json | 2 +- plugins/postcss-color-functional-notation/CHANGELOG.md | 4 ++++ plugins/postcss-color-functional-notation/package.json | 2 +- plugins/postcss-color-hex-alpha/CHANGELOG.md | 4 ++++ plugins/postcss-color-hex-alpha/package.json | 2 +- plugins/postcss-color-mix-function/CHANGELOG.md | 4 ++++ plugins/postcss-color-mix-function/package.json | 2 +- plugins/postcss-color-rebeccapurple/CHANGELOG.md | 4 ++++ plugins/postcss-color-rebeccapurple/package.json | 2 +- plugins/postcss-conditional-values/CHANGELOG.md | 4 ++++ plugins/postcss-conditional-values/package.json | 2 +- plugins/postcss-contrast-color-function/CHANGELOG.md | 4 ++++ plugins/postcss-contrast-color-function/package.json | 2 +- plugins/postcss-custom-media/CHANGELOG.md | 4 ++++ plugins/postcss-custom-media/package.json | 2 +- plugins/postcss-custom-properties/CHANGELOG.md | 4 ++++ plugins/postcss-custom-properties/package.json | 2 +- plugins/postcss-custom-selectors/CHANGELOG.md | 4 ++++ plugins/postcss-custom-selectors/package.json | 2 +- plugins/postcss-debug-logger/CHANGELOG.md | 4 ++++ plugins/postcss-debug-logger/package.json | 2 +- plugins/postcss-design-tokens/CHANGELOG.md | 4 ++++ plugins/postcss-design-tokens/package.json | 2 +- plugins/postcss-dir-pseudo-class/CHANGELOG.md | 4 ++++ plugins/postcss-dir-pseudo-class/package.json | 2 +- plugins/postcss-double-position-gradients/CHANGELOG.md | 4 ++++ plugins/postcss-double-position-gradients/package.json | 2 +- plugins/postcss-env-function/CHANGELOG.md | 4 ++++ plugins/postcss-env-function/package.json | 2 +- plugins/postcss-exponential-functions/CHANGELOG.md | 4 ++++ plugins/postcss-exponential-functions/package.json | 2 +- plugins/postcss-extract/CHANGELOG.md | 4 ++++ plugins/postcss-extract/package.json | 2 +- plugins/postcss-focus-visible/CHANGELOG.md | 4 ++++ plugins/postcss-focus-visible/package.json | 2 +- plugins/postcss-focus-within/CHANGELOG.md | 4 ++++ plugins/postcss-focus-within/package.json | 2 +- plugins/postcss-font-format-keywords/CHANGELOG.md | 4 ++++ plugins/postcss-font-format-keywords/package.json | 2 +- plugins/postcss-gamut-mapping/CHANGELOG.md | 4 ++++ plugins/postcss-gamut-mapping/package.json | 2 +- plugins/postcss-gap-properties/CHANGELOG.md | 4 ++++ plugins/postcss-gap-properties/package.json | 2 +- plugins/postcss-global-data/CHANGELOG.md | 4 ++++ plugins/postcss-global-data/package.json | 2 +- plugins/postcss-gradients-interpolation-method/CHANGELOG.md | 4 ++++ plugins/postcss-gradients-interpolation-method/package.json | 2 +- plugins/postcss-hwb-function/CHANGELOG.md | 4 ++++ plugins/postcss-hwb-function/package.json | 2 +- plugins/postcss-ic-unit/CHANGELOG.md | 4 ++++ plugins/postcss-ic-unit/package.json | 2 +- plugins/postcss-image-set-function/CHANGELOG.md | 4 ++++ plugins/postcss-image-set-function/package.json | 2 +- plugins/postcss-initial/CHANGELOG.md | 4 ++++ plugins/postcss-initial/package.json | 2 +- plugins/postcss-is-pseudo-class/CHANGELOG.md | 4 ++++ plugins/postcss-is-pseudo-class/package.json | 2 +- plugins/postcss-lab-function/CHANGELOG.md | 4 ++++ plugins/postcss-lab-function/package.json | 2 +- plugins/postcss-light-dark-function/CHANGELOG.md | 4 ++++ plugins/postcss-light-dark-function/package.json | 2 +- plugins/postcss-logical-float-and-clear/CHANGELOG.md | 4 ++++ plugins/postcss-logical-float-and-clear/package.json | 2 +- plugins/postcss-logical-overflow/CHANGELOG.md | 4 ++++ plugins/postcss-logical-overflow/package.json | 2 +- plugins/postcss-logical-overscroll-behavior/CHANGELOG.md | 4 ++++ plugins/postcss-logical-overscroll-behavior/package.json | 2 +- plugins/postcss-logical-resize/CHANGELOG.md | 4 ++++ plugins/postcss-logical-resize/package.json | 2 +- plugins/postcss-logical-viewport-units/CHANGELOG.md | 4 ++++ plugins/postcss-logical-viewport-units/package.json | 2 +- plugins/postcss-logical/CHANGELOG.md | 4 ++++ plugins/postcss-logical/package.json | 2 +- plugins/postcss-media-minmax/CHANGELOG.md | 4 ++++ plugins/postcss-media-minmax/package.json | 2 +- .../CHANGELOG.md | 4 ++++ .../package.json | 2 +- plugins/postcss-minify/CHANGELOG.md | 4 ++++ plugins/postcss-minify/package.json | 2 +- plugins/postcss-nested-calc/CHANGELOG.md | 4 ++++ plugins/postcss-nested-calc/package.json | 2 +- plugins/postcss-nesting/CHANGELOG.md | 4 ++++ plugins/postcss-nesting/package.json | 2 +- plugins/postcss-normalize-display-values/CHANGELOG.md | 4 ++++ plugins/postcss-normalize-display-values/package.json | 2 +- plugins/postcss-oklab-function/CHANGELOG.md | 4 ++++ plugins/postcss-oklab-function/package.json | 2 +- plugins/postcss-overflow-shorthand/CHANGELOG.md | 4 ++++ plugins/postcss-overflow-shorthand/package.json | 2 +- plugins/postcss-place/CHANGELOG.md | 4 ++++ plugins/postcss-place/package.json | 2 +- plugins/postcss-progressive-custom-properties/CHANGELOG.md | 4 ++++ plugins/postcss-progressive-custom-properties/package.json | 2 +- plugins/postcss-pseudo-class-any-link/CHANGELOG.md | 4 ++++ plugins/postcss-pseudo-class-any-link/package.json | 2 +- plugins/postcss-rebase-url/CHANGELOG.md | 4 ++++ plugins/postcss-rebase-url/package.json | 2 +- plugins/postcss-relative-color-syntax/CHANGELOG.md | 4 ++++ plugins/postcss-relative-color-syntax/package.json | 2 +- plugins/postcss-rewrite-url/CHANGELOG.md | 4 ++++ plugins/postcss-rewrite-url/package.json | 2 +- plugins/postcss-scope-pseudo-class/CHANGELOG.md | 4 ++++ plugins/postcss-scope-pseudo-class/package.json | 2 +- plugins/postcss-selector-not/CHANGELOG.md | 4 ++++ plugins/postcss-selector-not/package.json | 2 +- plugins/postcss-slow-plugins/CHANGELOG.md | 4 ++++ plugins/postcss-slow-plugins/package.json | 2 +- plugins/postcss-stepped-value-functions/CHANGELOG.md | 4 ++++ plugins/postcss-stepped-value-functions/package.json | 2 +- plugins/postcss-text-decoration-shorthand/CHANGELOG.md | 4 ++++ plugins/postcss-text-decoration-shorthand/package.json | 2 +- plugins/postcss-todo-or-die/CHANGELOG.md | 4 ++++ plugins/postcss-todo-or-die/package.json | 2 +- plugins/postcss-trigonometric-functions/CHANGELOG.md | 4 ++++ plugins/postcss-trigonometric-functions/package.json | 2 +- plugins/postcss-unset-value/CHANGELOG.md | 4 ++++ plugins/postcss-unset-value/package.json | 2 +- 175 files changed, 434 insertions(+), 90 deletions(-) diff --git a/.github/bin/format-package-json.mjs b/.github/bin/format-package-json.mjs index 700da456c..fccb878f1 100644 --- a/.github/bin/format-package-json.mjs +++ b/.github/bin/format-package-json.mjs @@ -75,7 +75,7 @@ const formatted = {}; delete packageJSONInfo.private; formatted.engines = { - node: '^14 || ^16 || >=18' + node: '>=18' }; delete packageJSONInfo.engines; diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 15dc512f3..d444ad957 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,12 +15,12 @@ jobs: runs-on: ${{ matrix.os }} strategy: fail-fast: false - # Test node 14/16/18/20 on ubuntu + # Test node 18/20/* on ubuntu # Test node 20 on macos/windows # Enable annotations only for node 20 + ubuntu matrix: os: [ubuntu-latest] - node: [16, 18, 20] + node: [18, 20] include: - os: macos-latest node: 20 diff --git a/cli/csstools-cli/CHANGELOG.md b/cli/csstools-cli/CHANGELOG.md index 3648de303..e6d174a64 100644 --- a/cli/csstools-cli/CHANGELOG.md +++ b/cli/csstools-cli/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to CSSTools CLI +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 3.0.15 _April 18, 2024_ diff --git a/cli/csstools-cli/package.json b/cli/csstools-cli/package.json index 49a175377..6a590d47a 100644 --- a/cli/csstools-cli/package.json +++ b/cli/csstools-cli/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "bin": { "csstools-cli": "dist/cli.cjs" diff --git a/experimental/css-has-pseudo/CHANGELOG.md b/experimental/css-has-pseudo/CHANGELOG.md index f629cf6c6..9e7465691 100644 --- a/experimental/css-has-pseudo/CHANGELOG.md +++ b/experimental/css-has-pseudo/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to CSS Has Pseudo +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 0.6.1 _December 15, 2023_ diff --git a/experimental/css-has-pseudo/package.json b/experimental/css-has-pseudo/package.json index a56e13865..ec439cf09 100644 --- a/experimental/css-has-pseudo/package.json +++ b/experimental/css-has-pseudo/package.json @@ -15,7 +15,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/experimental/postcss-gradient-stop-increments/CHANGELOG.md b/experimental/postcss-gradient-stop-increments/CHANGELOG.md index 1ad213a69..d6e7d2d26 100644 --- a/experimental/postcss-gradient-stop-increments/CHANGELOG.md +++ b/experimental/postcss-gradient-stop-increments/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Gradient Stop Increments +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.0.8 _March 13, 2024_ diff --git a/experimental/postcss-gradient-stop-increments/package.json b/experimental/postcss-gradient-stop-increments/package.json index 9e2c78de9..bb1512b3c 100644 --- a/experimental/postcss-gradient-stop-increments/package.json +++ b/experimental/postcss-gradient-stop-increments/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/experimental/postcss-nesting/CHANGELOG.md b/experimental/postcss-nesting/CHANGELOG.md index 48c1c7788..f83d6fd8b 100644 --- a/experimental/postcss-nesting/CHANGELOG.md +++ b/experimental/postcss-nesting/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Nesting Experimental +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 2.0.1 _December 15, 2023_ diff --git a/experimental/postcss-nesting/package.json b/experimental/postcss-nesting/package.json index 987bc0132..17408d05d 100644 --- a/experimental/postcss-nesting/package.json +++ b/experimental/postcss-nesting/package.json @@ -15,7 +15,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/packages/base-cli/CHANGELOG.md b/packages/base-cli/CHANGELOG.md index 260cd8d51..283387d0e 100644 --- a/packages/base-cli/CHANGELOG.md +++ b/packages/base-cli/CHANGELOG.md @@ -1 +1,5 @@ # Changes to PostCSS Base CLI + +### Unreleased (major) + +- Updated: Support for Node v18+ (major). diff --git a/packages/base-cli/package.json b/packages/base-cli/package.json index 86b31777e..9e5ff894c 100644 --- a/packages/base-cli/package.json +++ b/packages/base-cli/package.json @@ -16,7 +16,7 @@ ], "private": true, "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/packages/cascade-layer-name-parser/CHANGELOG.md b/packages/cascade-layer-name-parser/CHANGELOG.md index ba442b298..73d185299 100644 --- a/packages/cascade-layer-name-parser/CHANGELOG.md +++ b/packages/cascade-layer-name-parser/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to Cascade Layer Name Parser +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.0.9 _March 13, 2024_ diff --git a/packages/cascade-layer-name-parser/package.json b/packages/cascade-layer-name-parser/package.json index 55b306c2c..50b7c8dda 100644 --- a/packages/cascade-layer-name-parser/package.json +++ b/packages/cascade-layer-name-parser/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/packages/color-helpers/CHANGELOG.md b/packages/color-helpers/CHANGELOG.md index 6b5f6dcd3..5b9cb214a 100644 --- a/packages/color-helpers/CHANGELOG.md +++ b/packages/color-helpers/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to Color Helpers +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 4.1.0 _March 31, 2024_ diff --git a/packages/color-helpers/package.json b/packages/color-helpers/package.json index ff83827fe..aa04fd386 100644 --- a/packages/color-helpers/package.json +++ b/packages/color-helpers/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/packages/css-calc/CHANGELOG.md b/packages/css-calc/CHANGELOG.md index bf1a1dc8c..33435d4f8 100644 --- a/packages/css-calc/CHANGELOG.md +++ b/packages/css-calc/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to CSS Calc +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.2.0 _March 13, 2024_ diff --git a/packages/css-calc/package.json b/packages/css-calc/package.json index cb27a3ff1..fd7e41142 100644 --- a/packages/css-calc/package.json +++ b/packages/css-calc/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/packages/css-color-parser/CHANGELOG.md b/packages/css-color-parser/CHANGELOG.md index 8b4502139..dc0a0e432 100644 --- a/packages/css-color-parser/CHANGELOG.md +++ b/packages/css-color-parser/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to CSS Color Parser +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.6.3 _March 31, 2024_ diff --git a/packages/css-color-parser/package.json b/packages/css-color-parser/package.json index 7d5906a30..3c81de7e0 100644 --- a/packages/css-color-parser/package.json +++ b/packages/css-color-parser/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/packages/css-parser-algorithms/CHANGELOG.md b/packages/css-parser-algorithms/CHANGELOG.md index 8cf818cd0..d40808a75 100644 --- a/packages/css-parser-algorithms/CHANGELOG.md +++ b/packages/css-parser-algorithms/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to CSS Parser Algorithms +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 2.6.1 _March 13, 2024_ diff --git a/packages/css-parser-algorithms/package.json b/packages/css-parser-algorithms/package.json index 6bc0e1d62..f02f5092b 100644 --- a/packages/css-parser-algorithms/package.json +++ b/packages/css-parser-algorithms/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/packages/css-tokenizer/CHANGELOG.md b/packages/css-tokenizer/CHANGELOG.md index dd693011b..7a5d5052f 100644 --- a/packages/css-tokenizer/CHANGELOG.md +++ b/packages/css-tokenizer/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to CSS Tokenizer +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 2.2.4 _March 13, 2024_ diff --git a/packages/css-tokenizer/package.json b/packages/css-tokenizer/package.json index 59bcc033f..552849dbd 100644 --- a/packages/css-tokenizer/package.json +++ b/packages/css-tokenizer/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/packages/generate-test-cases/package.json b/packages/generate-test-cases/package.json index 64b7b0fc8..e52b0032c 100644 --- a/packages/generate-test-cases/package.json +++ b/packages/generate-test-cases/package.json @@ -16,7 +16,7 @@ ], "private": true, "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "src/index.mjs", diff --git a/packages/media-query-list-parser/CHANGELOG.md b/packages/media-query-list-parser/CHANGELOG.md index f68069bc8..88145c2f5 100644 --- a/packages/media-query-list-parser/CHANGELOG.md +++ b/packages/media-query-list-parser/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to Media Query List Parser +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 2.1.9 _March 13, 2024_ diff --git a/packages/media-query-list-parser/package.json b/packages/media-query-list-parser/package.json index af19514f6..9414b251c 100644 --- a/packages/media-query-list-parser/package.json +++ b/packages/media-query-list-parser/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/packages/postcss-tape/CHANGELOG.md b/packages/postcss-tape/CHANGELOG.md index e7c707ac0..39d01d2b0 100644 --- a/packages/postcss-tape/CHANGELOG.md +++ b/packages/postcss-tape/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Tape +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 4.1.2 _January 1, 2024_ diff --git a/packages/postcss-tape/package.json b/packages/postcss-tape/package.json index 29be94706..a4b3c770f 100644 --- a/packages/postcss-tape/package.json +++ b/packages/postcss-tape/package.json @@ -29,7 +29,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/packages/selector-resolve-nested/CHANGELOG.md b/packages/selector-resolve-nested/CHANGELOG.md index 3120273a0..ab5a854a3 100644 --- a/packages/selector-resolve-nested/CHANGELOG.md +++ b/packages/selector-resolve-nested/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to Selector Resolve Nested +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ## 1.1.0 _February 1, 2024_ diff --git a/packages/selector-resolve-nested/package.json b/packages/selector-resolve-nested/package.json index ff1bbfdc5..930f54dc9 100644 --- a/packages/selector-resolve-nested/package.json +++ b/packages/selector-resolve-nested/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/packages/selector-specificity/CHANGELOG.md b/packages/selector-specificity/CHANGELOG.md index 60dd58534..332e793f4 100644 --- a/packages/selector-specificity/CHANGELOG.md +++ b/packages/selector-specificity/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to Selector Specificity +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 3.0.3 _March 31, 2024_ diff --git a/packages/selector-specificity/package.json b/packages/selector-specificity/package.json index d947953aa..acc51c2dc 100644 --- a/packages/selector-specificity/package.json +++ b/packages/selector-specificity/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/packages/utilities/CHANGELOG.md b/packages/utilities/CHANGELOG.md index ebf1f2a96..1f4aa5829 100644 --- a/packages/utilities/CHANGELOG.md +++ b/packages/utilities/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to Utilities +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.0.0 _February 19, 2024_ diff --git a/packages/utilities/package.json b/packages/utilities/package.json index 47e3293b2..cc2e2051a 100644 --- a/packages/utilities/package.json +++ b/packages/utilities/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugin-packs/postcss-bundler/CHANGELOG.md b/plugin-packs/postcss-bundler/CHANGELOG.md index 5165ac3a7..ea2942c41 100644 --- a/plugin-packs/postcss-bundler/CHANGELOG.md +++ b/plugin-packs/postcss-bundler/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Bundler +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.0.11 _March 13, 2024_ diff --git a/plugin-packs/postcss-bundler/package.json b/plugin-packs/postcss-bundler/package.json index c8f276043..95d59582c 100644 --- a/plugin-packs/postcss-bundler/package.json +++ b/plugin-packs/postcss-bundler/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugin-packs/postcss-preset-env/CHANGELOG.md b/plugin-packs/postcss-preset-env/CHANGELOG.md index bf9f081ea..e9d88891f 100644 --- a/plugin-packs/postcss-preset-env/CHANGELOG.md +++ b/plugin-packs/postcss-preset-env/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Preset Env +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 9.5.6 _April 18, 2024_ diff --git a/plugin-packs/postcss-preset-env/package.json b/plugin-packs/postcss-preset-env/package.json index c0253e212..793a59de5 100644 --- a/plugin-packs/postcss-preset-env/package.json +++ b/plugin-packs/postcss-preset-env/package.json @@ -29,7 +29,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins-stylelint/at-risk/CHANGELOG.md b/plugins-stylelint/at-risk/CHANGELOG.md index 2ec770cbe..b35adcb44 100644 --- a/plugins-stylelint/at-risk/CHANGELOG.md +++ b/plugins-stylelint/at-risk/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.0.0 _March 5, 2024_ diff --git a/plugins-stylelint/at-risk/package.json b/plugins-stylelint/at-risk/package.json index 9aaec00c8..9ca2f76c3 100644 --- a/plugins-stylelint/at-risk/package.json +++ b/plugins-stylelint/at-risk/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "index.mjs", diff --git a/plugins-stylelint/no-at-nest-rule/CHANGELOG.md b/plugins-stylelint/no-at-nest-rule/CHANGELOG.md index 16699ee50..26f75aa74 100644 --- a/plugins-stylelint/no-at-nest-rule/CHANGELOG.md +++ b/plugins-stylelint/no-at-nest-rule/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 2.0.0 _December 15, 2023_ diff --git a/plugins-stylelint/no-at-nest-rule/package.json b/plugins-stylelint/no-at-nest-rule/package.json index 0152a4142..886dcac67 100644 --- a/plugins-stylelint/no-at-nest-rule/package.json +++ b/plugins-stylelint/no-at-nest-rule/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "index.mjs", diff --git a/plugins-stylelint/no-invalid-at-import-rules-when-bundling/CHANGELOG.md b/plugins-stylelint/no-invalid-at-import-rules-when-bundling/CHANGELOG.md index ac25b0d44..1b4c14e64 100644 --- a/plugins-stylelint/no-invalid-at-import-rules-when-bundling/CHANGELOG.md +++ b/plugins-stylelint/no-invalid-at-import-rules-when-bundling/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 2.0.3 _March 13, 2024_ diff --git a/plugins-stylelint/no-invalid-at-import-rules-when-bundling/package.json b/plugins-stylelint/no-invalid-at-import-rules-when-bundling/package.json index ae97c7366..f6913892e 100644 --- a/plugins-stylelint/no-invalid-at-import-rules-when-bundling/package.json +++ b/plugins-stylelint/no-invalid-at-import-rules-when-bundling/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "index.mjs", diff --git a/plugins/css-blank-pseudo/CHANGELOG.md b/plugins/css-blank-pseudo/CHANGELOG.md index 9a278acb2..2abf216ee 100644 --- a/plugins/css-blank-pseudo/CHANGELOG.md +++ b/plugins/css-blank-pseudo/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to CSS Blank Pseudo +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 6.0.2 _April 18, 2024_ diff --git a/plugins/css-blank-pseudo/package.json b/plugins/css-blank-pseudo/package.json index e7482e324..e318d1045 100644 --- a/plugins/css-blank-pseudo/package.json +++ b/plugins/css-blank-pseudo/package.json @@ -29,7 +29,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/css-has-pseudo/CHANGELOG.md b/plugins/css-has-pseudo/CHANGELOG.md index c259c68e7..995e317ed 100644 --- a/plugins/css-has-pseudo/CHANGELOG.md +++ b/plugins/css-has-pseudo/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to CSS Has Pseudo +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 6.0.3 _March 31, 2024_ diff --git a/plugins/css-has-pseudo/package.json b/plugins/css-has-pseudo/package.json index a6feab2fe..734ff237f 100644 --- a/plugins/css-has-pseudo/package.json +++ b/plugins/css-has-pseudo/package.json @@ -29,7 +29,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/css-prefers-color-scheme/CHANGELOG.md b/plugins/css-prefers-color-scheme/CHANGELOG.md index ea001bf9e..3caed94e9 100644 --- a/plugins/css-prefers-color-scheme/CHANGELOG.md +++ b/plugins/css-prefers-color-scheme/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to Prefers Color Scheme +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 9.0.1 _December 15, 2023_ diff --git a/plugins/css-prefers-color-scheme/package.json b/plugins/css-prefers-color-scheme/package.json index 556195647..eebd9cddc 100644 --- a/plugins/css-prefers-color-scheme/package.json +++ b/plugins/css-prefers-color-scheme/package.json @@ -29,7 +29,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-attribute-case-insensitive/CHANGELOG.md b/plugins/postcss-attribute-case-insensitive/CHANGELOG.md index d666cba7e..c42baaf27 100644 --- a/plugins/postcss-attribute-case-insensitive/CHANGELOG.md +++ b/plugins/postcss-attribute-case-insensitive/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Attribute Case Insensitive +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 6.0.3 _February 19, 2024_ diff --git a/plugins/postcss-attribute-case-insensitive/package.json b/plugins/postcss-attribute-case-insensitive/package.json index 891751beb..2d51e3d63 100644 --- a/plugins/postcss-attribute-case-insensitive/package.json +++ b/plugins/postcss-attribute-case-insensitive/package.json @@ -28,7 +28,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-base-plugin/CHANGELOG.md b/plugins/postcss-base-plugin/CHANGELOG.md index 2475e1207..d7f9c4a81 100644 --- a/plugins/postcss-base-plugin/CHANGELOG.md +++ b/plugins/postcss-base-plugin/CHANGELOG.md @@ -1 +1,5 @@ # Changes to PostCSS Base Plugin + +### Unreleased (major) + +- Updated: Support for Node v18+ (major). diff --git a/plugins/postcss-base-plugin/package.json b/plugins/postcss-base-plugin/package.json index e788fe65d..c54922d99 100644 --- a/plugins/postcss-base-plugin/package.json +++ b/plugins/postcss-base-plugin/package.json @@ -26,7 +26,7 @@ ], "private": true, "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-cascade-layers/CHANGELOG.md b/plugins/postcss-cascade-layers/CHANGELOG.md index 90dded42e..bc76af983 100644 --- a/plugins/postcss-cascade-layers/CHANGELOG.md +++ b/plugins/postcss-cascade-layers/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Cascade Layers +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 4.0.4 _March 31, 2024_ diff --git a/plugins/postcss-cascade-layers/package.json b/plugins/postcss-cascade-layers/package.json index 1bc370057..1f06b6d64 100644 --- a/plugins/postcss-cascade-layers/package.json +++ b/plugins/postcss-cascade-layers/package.json @@ -33,7 +33,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-color-function/CHANGELOG.md b/plugins/postcss-color-function/CHANGELOG.md index fbdd09663..3c509ce2a 100644 --- a/plugins/postcss-color-function/CHANGELOG.md +++ b/plugins/postcss-color-function/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Color Function +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 3.0.13 _March 31, 2024_ diff --git a/plugins/postcss-color-function/package.json b/plugins/postcss-color-function/package.json index 57075f7b1..cb0647607 100644 --- a/plugins/postcss-color-function/package.json +++ b/plugins/postcss-color-function/package.json @@ -15,7 +15,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-color-functional-notation/CHANGELOG.md b/plugins/postcss-color-functional-notation/CHANGELOG.md index 0a95ba5ce..7017f9bf9 100644 --- a/plugins/postcss-color-functional-notation/CHANGELOG.md +++ b/plugins/postcss-color-functional-notation/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Color Functional Notation +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 6.0.8 _March 31, 2024_ diff --git a/plugins/postcss-color-functional-notation/package.json b/plugins/postcss-color-functional-notation/package.json index 38abccc2a..c01b337ef 100644 --- a/plugins/postcss-color-functional-notation/package.json +++ b/plugins/postcss-color-functional-notation/package.json @@ -15,7 +15,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-color-hex-alpha/CHANGELOG.md b/plugins/postcss-color-hex-alpha/CHANGELOG.md index 484993acb..b441abcca 100644 --- a/plugins/postcss-color-hex-alpha/CHANGELOG.md +++ b/plugins/postcss-color-hex-alpha/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Color Hex Alpha +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 9.0.4 _February 19, 2024_ diff --git a/plugins/postcss-color-hex-alpha/package.json b/plugins/postcss-color-hex-alpha/package.json index 2b9aa3f5f..8ad7f6f74 100644 --- a/plugins/postcss-color-hex-alpha/package.json +++ b/plugins/postcss-color-hex-alpha/package.json @@ -32,7 +32,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-color-mix-function/CHANGELOG.md b/plugins/postcss-color-mix-function/CHANGELOG.md index de27abe87..dc2c41e80 100644 --- a/plugins/postcss-color-mix-function/CHANGELOG.md +++ b/plugins/postcss-color-mix-function/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Color Mix Function +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 2.0.13 _March 31, 2024_ diff --git a/plugins/postcss-color-mix-function/package.json b/plugins/postcss-color-mix-function/package.json index 442b54e44..172da7d1e 100644 --- a/plugins/postcss-color-mix-function/package.json +++ b/plugins/postcss-color-mix-function/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-color-rebeccapurple/CHANGELOG.md b/plugins/postcss-color-rebeccapurple/CHANGELOG.md index 47041f10f..93007f61f 100644 --- a/plugins/postcss-color-rebeccapurple/CHANGELOG.md +++ b/plugins/postcss-color-rebeccapurple/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS RebeccaPurple +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 9.0.3 _February 19, 2024_ diff --git a/plugins/postcss-color-rebeccapurple/package.json b/plugins/postcss-color-rebeccapurple/package.json index 7ae5f263e..9acda859a 100644 --- a/plugins/postcss-color-rebeccapurple/package.json +++ b/plugins/postcss-color-rebeccapurple/package.json @@ -32,7 +32,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-conditional-values/CHANGELOG.md b/plugins/postcss-conditional-values/CHANGELOG.md index 0d6839e48..1239df68b 100644 --- a/plugins/postcss-conditional-values/CHANGELOG.md +++ b/plugins/postcss-conditional-values/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Conditional Values +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 3.0.1 _December 15, 2023_ diff --git a/plugins/postcss-conditional-values/package.json b/plugins/postcss-conditional-values/package.json index 1b2aab2a3..19015c2bd 100644 --- a/plugins/postcss-conditional-values/package.json +++ b/plugins/postcss-conditional-values/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-contrast-color-function/CHANGELOG.md b/plugins/postcss-contrast-color-function/CHANGELOG.md index d382d3007..050e01cfe 100644 --- a/plugins/postcss-contrast-color-function/CHANGELOG.md +++ b/plugins/postcss-contrast-color-function/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Contrast Color Function +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.0.0 _March 31, 2024_ diff --git a/plugins/postcss-contrast-color-function/package.json b/plugins/postcss-contrast-color-function/package.json index 5b22ecfaa..bc939b1fb 100644 --- a/plugins/postcss-contrast-color-function/package.json +++ b/plugins/postcss-contrast-color-function/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-custom-media/CHANGELOG.md b/plugins/postcss-custom-media/CHANGELOG.md index f3b9551ff..51b766904 100644 --- a/plugins/postcss-custom-media/CHANGELOG.md +++ b/plugins/postcss-custom-media/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Custom Media +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 10.0.4 _March 13, 2024_ diff --git a/plugins/postcss-custom-media/package.json b/plugins/postcss-custom-media/package.json index 13207e99c..3f584d85f 100644 --- a/plugins/postcss-custom-media/package.json +++ b/plugins/postcss-custom-media/package.json @@ -32,7 +32,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-custom-properties/CHANGELOG.md b/plugins/postcss-custom-properties/CHANGELOG.md index c5f3cecfe..db02b7374 100644 --- a/plugins/postcss-custom-properties/CHANGELOG.md +++ b/plugins/postcss-custom-properties/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Custom Properties +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 13.3.7 _April 11, 2024_ diff --git a/plugins/postcss-custom-properties/package.json b/plugins/postcss-custom-properties/package.json index db30d0b1e..192f85b67 100644 --- a/plugins/postcss-custom-properties/package.json +++ b/plugins/postcss-custom-properties/package.json @@ -18,7 +18,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-custom-selectors/CHANGELOG.md b/plugins/postcss-custom-selectors/CHANGELOG.md index 219a2fda9..0398776c5 100644 --- a/plugins/postcss-custom-selectors/CHANGELOG.md +++ b/plugins/postcss-custom-selectors/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Custom Selectors +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 7.1.8 _March 13, 2024_ diff --git a/plugins/postcss-custom-selectors/package.json b/plugins/postcss-custom-selectors/package.json index ff8ffdb53..4d33ec8b5 100644 --- a/plugins/postcss-custom-selectors/package.json +++ b/plugins/postcss-custom-selectors/package.json @@ -35,7 +35,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-debug-logger/CHANGELOG.md b/plugins/postcss-debug-logger/CHANGELOG.md index e0551b97e..99fe7bb70 100644 --- a/plugins/postcss-debug-logger/CHANGELOG.md +++ b/plugins/postcss-debug-logger/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Debug Logger +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 2.0.1 _December 15, 2023_ diff --git a/plugins/postcss-debug-logger/package.json b/plugins/postcss-debug-logger/package.json index 8512f8cc1..e7ae123cf 100644 --- a/plugins/postcss-debug-logger/package.json +++ b/plugins/postcss-debug-logger/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-design-tokens/CHANGELOG.md b/plugins/postcss-design-tokens/CHANGELOG.md index d12598fd9..4387b2339 100644 --- a/plugins/postcss-design-tokens/CHANGELOG.md +++ b/plugins/postcss-design-tokens/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Design Tokens +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 3.1.5 _March 13, 2024_ diff --git a/plugins/postcss-design-tokens/package.json b/plugins/postcss-design-tokens/package.json index 371e9c55a..e14997f42 100644 --- a/plugins/postcss-design-tokens/package.json +++ b/plugins/postcss-design-tokens/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-dir-pseudo-class/CHANGELOG.md b/plugins/postcss-dir-pseudo-class/CHANGELOG.md index 7b3da107f..385274d4b 100644 --- a/plugins/postcss-dir-pseudo-class/CHANGELOG.md +++ b/plugins/postcss-dir-pseudo-class/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Dir Pseudo Class +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 8.0.1 _December 15, 2023_ diff --git a/plugins/postcss-dir-pseudo-class/package.json b/plugins/postcss-dir-pseudo-class/package.json index 187f10418..8c1633bf7 100644 --- a/plugins/postcss-dir-pseudo-class/package.json +++ b/plugins/postcss-dir-pseudo-class/package.json @@ -29,7 +29,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-double-position-gradients/CHANGELOG.md b/plugins/postcss-double-position-gradients/CHANGELOG.md index 9d7bd152c..efb73e421 100644 --- a/plugins/postcss-double-position-gradients/CHANGELOG.md +++ b/plugins/postcss-double-position-gradients/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Double Position Gradients +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 5.0.6 _March 31, 2024_ diff --git a/plugins/postcss-double-position-gradients/package.json b/plugins/postcss-double-position-gradients/package.json index 9f5173156..473940f88 100644 --- a/plugins/postcss-double-position-gradients/package.json +++ b/plugins/postcss-double-position-gradients/package.json @@ -15,7 +15,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-env-function/CHANGELOG.md b/plugins/postcss-env-function/CHANGELOG.md index 2ff24d693..4f983b315 100644 --- a/plugins/postcss-env-function/CHANGELOG.md +++ b/plugins/postcss-env-function/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Environment Variables +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 6.0.0 _July 3, 2023_ diff --git a/plugins/postcss-env-function/package.json b/plugins/postcss-env-function/package.json index 42f3b75ec..efe3ebeed 100644 --- a/plugins/postcss-env-function/package.json +++ b/plugins/postcss-env-function/package.json @@ -15,7 +15,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "main": "dist/index.cjs", "module": "dist/index.mjs", diff --git a/plugins/postcss-exponential-functions/CHANGELOG.md b/plugins/postcss-exponential-functions/CHANGELOG.md index 83e7bc071..fc815e051 100644 --- a/plugins/postcss-exponential-functions/CHANGELOG.md +++ b/plugins/postcss-exponential-functions/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Exponential Functions +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.0.5 _March 13, 2024_ diff --git a/plugins/postcss-exponential-functions/package.json b/plugins/postcss-exponential-functions/package.json index b6e931627..c979f8cb4 100644 --- a/plugins/postcss-exponential-functions/package.json +++ b/plugins/postcss-exponential-functions/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-extract/CHANGELOG.md b/plugins/postcss-extract/CHANGELOG.md index 7ced6dbda..b0607ddd1 100644 --- a/plugins/postcss-extract/CHANGELOG.md +++ b/plugins/postcss-extract/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Extract +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 3.0.1 _December 15, 2023_ diff --git a/plugins/postcss-extract/package.json b/plugins/postcss-extract/package.json index 535484ea0..958c13916 100644 --- a/plugins/postcss-extract/package.json +++ b/plugins/postcss-extract/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-focus-visible/CHANGELOG.md b/plugins/postcss-focus-visible/CHANGELOG.md index 2835ac870..a2e44c30d 100644 --- a/plugins/postcss-focus-visible/CHANGELOG.md +++ b/plugins/postcss-focus-visible/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Focus Visible +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 9.0.1 _December 15, 2023_ diff --git a/plugins/postcss-focus-visible/package.json b/plugins/postcss-focus-visible/package.json index e48face46..0b1d37371 100644 --- a/plugins/postcss-focus-visible/package.json +++ b/plugins/postcss-focus-visible/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-focus-within/CHANGELOG.md b/plugins/postcss-focus-within/CHANGELOG.md index b37e488ab..d8c3af08d 100644 --- a/plugins/postcss-focus-within/CHANGELOG.md +++ b/plugins/postcss-focus-within/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Focus Within +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 8.0.1 _December 15, 2023_ diff --git a/plugins/postcss-focus-within/package.json b/plugins/postcss-focus-within/package.json index 9645df341..470eeb3c9 100644 --- a/plugins/postcss-focus-within/package.json +++ b/plugins/postcss-focus-within/package.json @@ -29,7 +29,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-font-format-keywords/CHANGELOG.md b/plugins/postcss-font-format-keywords/CHANGELOG.md index bc4f1c47c..cbe761275 100644 --- a/plugins/postcss-font-format-keywords/CHANGELOG.md +++ b/plugins/postcss-font-format-keywords/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Font Format +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 3.0.2 _February 19, 2024_ diff --git a/plugins/postcss-font-format-keywords/package.json b/plugins/postcss-font-format-keywords/package.json index 1213bdd5e..5b2843720 100644 --- a/plugins/postcss-font-format-keywords/package.json +++ b/plugins/postcss-font-format-keywords/package.json @@ -15,7 +15,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-gamut-mapping/CHANGELOG.md b/plugins/postcss-gamut-mapping/CHANGELOG.md index 66d49acd1..5db793060 100644 --- a/plugins/postcss-gamut-mapping/CHANGELOG.md +++ b/plugins/postcss-gamut-mapping/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS gamut-mapping +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.0.6 _March 31, 2024_ diff --git a/plugins/postcss-gamut-mapping/package.json b/plugins/postcss-gamut-mapping/package.json index a151d7d00..de212cbcc 100644 --- a/plugins/postcss-gamut-mapping/package.json +++ b/plugins/postcss-gamut-mapping/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-gap-properties/CHANGELOG.md b/plugins/postcss-gap-properties/CHANGELOG.md index e6bee4842..6ef37789b 100644 --- a/plugins/postcss-gap-properties/CHANGELOG.md +++ b/plugins/postcss-gap-properties/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Gap Properties +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 5.0.1 _December 15, 2023_ diff --git a/plugins/postcss-gap-properties/package.json b/plugins/postcss-gap-properties/package.json index a81c70ad2..9e6f53f66 100644 --- a/plugins/postcss-gap-properties/package.json +++ b/plugins/postcss-gap-properties/package.json @@ -29,7 +29,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-global-data/CHANGELOG.md b/plugins/postcss-global-data/CHANGELOG.md index 54637e4fe..ae3be4774 100644 --- a/plugins/postcss-global-data/CHANGELOG.md +++ b/plugins/postcss-global-data/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS global-data +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 2.1.1 _December 15, 2023_ diff --git a/plugins/postcss-global-data/package.json b/plugins/postcss-global-data/package.json index df436f16f..70bc1b5b7 100644 --- a/plugins/postcss-global-data/package.json +++ b/plugins/postcss-global-data/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-gradients-interpolation-method/CHANGELOG.md b/plugins/postcss-gradients-interpolation-method/CHANGELOG.md index 17de7f1cb..b11c0a75d 100644 --- a/plugins/postcss-gradients-interpolation-method/CHANGELOG.md +++ b/plugins/postcss-gradients-interpolation-method/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Gradients Interpolation Method +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 4.0.14 _March 31, 2024_ diff --git a/plugins/postcss-gradients-interpolation-method/package.json b/plugins/postcss-gradients-interpolation-method/package.json index 2ac66ec10..9b1be20ac 100644 --- a/plugins/postcss-gradients-interpolation-method/package.json +++ b/plugins/postcss-gradients-interpolation-method/package.json @@ -15,7 +15,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-hwb-function/CHANGELOG.md b/plugins/postcss-hwb-function/CHANGELOG.md index b4036d90c..7c100571a 100644 --- a/plugins/postcss-hwb-function/CHANGELOG.md +++ b/plugins/postcss-hwb-function/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS HWB Function +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 3.0.12 _March 31, 2024_ diff --git a/plugins/postcss-hwb-function/package.json b/plugins/postcss-hwb-function/package.json index 626d85bd3..09cde9eaf 100644 --- a/plugins/postcss-hwb-function/package.json +++ b/plugins/postcss-hwb-function/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-ic-unit/CHANGELOG.md b/plugins/postcss-ic-unit/CHANGELOG.md index 753f22ecb..88fa25e43 100644 --- a/plugins/postcss-ic-unit/CHANGELOG.md +++ b/plugins/postcss-ic-unit/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS IC Unit +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 3.0.6 _March 31, 2024_ diff --git a/plugins/postcss-ic-unit/package.json b/plugins/postcss-ic-unit/package.json index f8920ed79..f528168f2 100644 --- a/plugins/postcss-ic-unit/package.json +++ b/plugins/postcss-ic-unit/package.json @@ -15,7 +15,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-image-set-function/CHANGELOG.md b/plugins/postcss-image-set-function/CHANGELOG.md index 24d36c40d..3c61cf101 100644 --- a/plugins/postcss-image-set-function/CHANGELOG.md +++ b/plugins/postcss-image-set-function/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS image-set() Function +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 6.0.3 _February 19, 2024_ diff --git a/plugins/postcss-image-set-function/package.json b/plugins/postcss-image-set-function/package.json index 91202d8da..3ed759bfc 100644 --- a/plugins/postcss-image-set-function/package.json +++ b/plugins/postcss-image-set-function/package.json @@ -15,7 +15,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-initial/CHANGELOG.md b/plugins/postcss-initial/CHANGELOG.md index dd4e3eb98..41468c2b9 100644 --- a/plugins/postcss-initial/CHANGELOG.md +++ b/plugins/postcss-initial/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Initial +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.0.1 _December 15, 2023_ diff --git a/plugins/postcss-initial/package.json b/plugins/postcss-initial/package.json index 6f3b057da..d8e5db178 100644 --- a/plugins/postcss-initial/package.json +++ b/plugins/postcss-initial/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-is-pseudo-class/CHANGELOG.md b/plugins/postcss-is-pseudo-class/CHANGELOG.md index b8b76637a..1f891ea25 100644 --- a/plugins/postcss-is-pseudo-class/CHANGELOG.md +++ b/plugins/postcss-is-pseudo-class/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Is Pseudo Class +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 4.0.6 _March 31, 2024_ diff --git a/plugins/postcss-is-pseudo-class/package.json b/plugins/postcss-is-pseudo-class/package.json index a685be9e5..198bd3e33 100644 --- a/plugins/postcss-is-pseudo-class/package.json +++ b/plugins/postcss-is-pseudo-class/package.json @@ -15,7 +15,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-lab-function/CHANGELOG.md b/plugins/postcss-lab-function/CHANGELOG.md index 5dc130cc5..bc5c39c8f 100644 --- a/plugins/postcss-lab-function/CHANGELOG.md +++ b/plugins/postcss-lab-function/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Lab Function +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 6.0.13 _March 31, 2024_ diff --git a/plugins/postcss-lab-function/package.json b/plugins/postcss-lab-function/package.json index f8e717b14..db639d99f 100644 --- a/plugins/postcss-lab-function/package.json +++ b/plugins/postcss-lab-function/package.json @@ -15,7 +15,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-light-dark-function/CHANGELOG.md b/plugins/postcss-light-dark-function/CHANGELOG.md index 17f45724a..adfc4d08a 100644 --- a/plugins/postcss-light-dark-function/CHANGELOG.md +++ b/plugins/postcss-light-dark-function/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Light Dark Function +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.0.3 _April 1, 2024_ diff --git a/plugins/postcss-light-dark-function/package.json b/plugins/postcss-light-dark-function/package.json index ecfe704b6..b804710bb 100644 --- a/plugins/postcss-light-dark-function/package.json +++ b/plugins/postcss-light-dark-function/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-logical-float-and-clear/CHANGELOG.md b/plugins/postcss-logical-float-and-clear/CHANGELOG.md index 78e865522..e5bf44ffc 100644 --- a/plugins/postcss-logical-float-and-clear/CHANGELOG.md +++ b/plugins/postcss-logical-float-and-clear/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Logical Float And Clear +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 2.0.1 _December 15, 2023_ diff --git a/plugins/postcss-logical-float-and-clear/package.json b/plugins/postcss-logical-float-and-clear/package.json index 34065d92b..cf1ea4aeb 100644 --- a/plugins/postcss-logical-float-and-clear/package.json +++ b/plugins/postcss-logical-float-and-clear/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-logical-overflow/CHANGELOG.md b/plugins/postcss-logical-overflow/CHANGELOG.md index 12e74f716..7996f90cb 100644 --- a/plugins/postcss-logical-overflow/CHANGELOG.md +++ b/plugins/postcss-logical-overflow/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Logical Overflow +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.0.1 _December 15, 2023_ diff --git a/plugins/postcss-logical-overflow/package.json b/plugins/postcss-logical-overflow/package.json index 79bcc8c47..158362228 100644 --- a/plugins/postcss-logical-overflow/package.json +++ b/plugins/postcss-logical-overflow/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-logical-overscroll-behavior/CHANGELOG.md b/plugins/postcss-logical-overscroll-behavior/CHANGELOG.md index 649e59d84..5cdd30936 100644 --- a/plugins/postcss-logical-overscroll-behavior/CHANGELOG.md +++ b/plugins/postcss-logical-overscroll-behavior/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Logical Overscroll Behavior +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.0.1 _December 15, 2023_ diff --git a/plugins/postcss-logical-overscroll-behavior/package.json b/plugins/postcss-logical-overscroll-behavior/package.json index 2a3603d24..5ec610365 100644 --- a/plugins/postcss-logical-overscroll-behavior/package.json +++ b/plugins/postcss-logical-overscroll-behavior/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-logical-resize/CHANGELOG.md b/plugins/postcss-logical-resize/CHANGELOG.md index ba60b3dc3..7be4079f7 100644 --- a/plugins/postcss-logical-resize/CHANGELOG.md +++ b/plugins/postcss-logical-resize/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Logical Resize +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 2.0.1 _December 15, 2023_ diff --git a/plugins/postcss-logical-resize/package.json b/plugins/postcss-logical-resize/package.json index 89842a92e..cae234783 100644 --- a/plugins/postcss-logical-resize/package.json +++ b/plugins/postcss-logical-resize/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-logical-viewport-units/CHANGELOG.md b/plugins/postcss-logical-viewport-units/CHANGELOG.md index dcd0c9d53..c95e8162f 100644 --- a/plugins/postcss-logical-viewport-units/CHANGELOG.md +++ b/plugins/postcss-logical-viewport-units/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Logical Viewport Units +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 2.0.7 _March 13, 2024_ diff --git a/plugins/postcss-logical-viewport-units/package.json b/plugins/postcss-logical-viewport-units/package.json index 43e04858b..f5ad81c8a 100644 --- a/plugins/postcss-logical-viewport-units/package.json +++ b/plugins/postcss-logical-viewport-units/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-logical/CHANGELOG.md b/plugins/postcss-logical/CHANGELOG.md index c22eb25d6..4b39ec540 100644 --- a/plugins/postcss-logical/CHANGELOG.md +++ b/plugins/postcss-logical/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Logical Properties +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 7.0.1 _December 15, 2023_ diff --git a/plugins/postcss-logical/package.json b/plugins/postcss-logical/package.json index 54d6a1568..096323e79 100644 --- a/plugins/postcss-logical/package.json +++ b/plugins/postcss-logical/package.json @@ -29,7 +29,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-media-minmax/CHANGELOG.md b/plugins/postcss-media-minmax/CHANGELOG.md index 7c9fe0bcc..ebcdc9dd4 100644 --- a/plugins/postcss-media-minmax/CHANGELOG.md +++ b/plugins/postcss-media-minmax/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Media MinMax +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.1.4 _March 13, 2024_ diff --git a/plugins/postcss-media-minmax/package.json b/plugins/postcss-media-minmax/package.json index ec9cb9101..68c60d5e2 100644 --- a/plugins/postcss-media-minmax/package.json +++ b/plugins/postcss-media-minmax/package.json @@ -28,7 +28,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md b/plugins/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md index 45af3fb41..52b171f65 100644 --- a/plugins/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md +++ b/plugins/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Media Queries Aspect-Ratio Number Values +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 2.0.7 _March 13, 2024_ diff --git a/plugins/postcss-media-queries-aspect-ratio-number-values/package.json b/plugins/postcss-media-queries-aspect-ratio-number-values/package.json index a04fa8717..fa346e81e 100644 --- a/plugins/postcss-media-queries-aspect-ratio-number-values/package.json +++ b/plugins/postcss-media-queries-aspect-ratio-number-values/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-minify/CHANGELOG.md b/plugins/postcss-minify/CHANGELOG.md index 330d567b2..8126a9bb5 100644 --- a/plugins/postcss-minify/CHANGELOG.md +++ b/plugins/postcss-minify/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Minify +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.1.1 _March 13, 2024_ diff --git a/plugins/postcss-minify/package.json b/plugins/postcss-minify/package.json index 563b2bcd4..65672e643 100644 --- a/plugins/postcss-minify/package.json +++ b/plugins/postcss-minify/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-nested-calc/CHANGELOG.md b/plugins/postcss-nested-calc/CHANGELOG.md index c39811c65..34d6aade2 100644 --- a/plugins/postcss-nested-calc/CHANGELOG.md +++ b/plugins/postcss-nested-calc/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Nested Calc +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 3.0.2 _February 19, 2024_ diff --git a/plugins/postcss-nested-calc/package.json b/plugins/postcss-nested-calc/package.json index 7e0c7d6ca..8d453c5b3 100644 --- a/plugins/postcss-nested-calc/package.json +++ b/plugins/postcss-nested-calc/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-nesting/CHANGELOG.md b/plugins/postcss-nesting/CHANGELOG.md index 6fdb7843f..49b5afc8c 100644 --- a/plugins/postcss-nesting/CHANGELOG.md +++ b/plugins/postcss-nesting/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Nesting +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 12.1.1 _March 31, 2024_ diff --git a/plugins/postcss-nesting/package.json b/plugins/postcss-nesting/package.json index eb40f8524..279f4095a 100644 --- a/plugins/postcss-nesting/package.json +++ b/plugins/postcss-nesting/package.json @@ -29,7 +29,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-normalize-display-values/CHANGELOG.md b/plugins/postcss-normalize-display-values/CHANGELOG.md index eacf35442..62910f627 100644 --- a/plugins/postcss-normalize-display-values/CHANGELOG.md +++ b/plugins/postcss-normalize-display-values/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Normalize Display Values +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 3.0.2 _December 15, 2023_ diff --git a/plugins/postcss-normalize-display-values/package.json b/plugins/postcss-normalize-display-values/package.json index c1da776c2..63adbccd8 100644 --- a/plugins/postcss-normalize-display-values/package.json +++ b/plugins/postcss-normalize-display-values/package.json @@ -15,7 +15,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-oklab-function/CHANGELOG.md b/plugins/postcss-oklab-function/CHANGELOG.md index d0821491c..224e43cda 100644 --- a/plugins/postcss-oklab-function/CHANGELOG.md +++ b/plugins/postcss-oklab-function/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS OKLab Function +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 3.0.13 _March 31, 2024_ diff --git a/plugins/postcss-oklab-function/package.json b/plugins/postcss-oklab-function/package.json index 8f331938c..39f4e69ca 100644 --- a/plugins/postcss-oklab-function/package.json +++ b/plugins/postcss-oklab-function/package.json @@ -15,7 +15,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-overflow-shorthand/CHANGELOG.md b/plugins/postcss-overflow-shorthand/CHANGELOG.md index 3bbe230a3..ff47b70b9 100644 --- a/plugins/postcss-overflow-shorthand/CHANGELOG.md +++ b/plugins/postcss-overflow-shorthand/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Overflow Shorthand +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 5.0.1 _December 15, 2023_ diff --git a/plugins/postcss-overflow-shorthand/package.json b/plugins/postcss-overflow-shorthand/package.json index 8d807188b..fa19f380e 100644 --- a/plugins/postcss-overflow-shorthand/package.json +++ b/plugins/postcss-overflow-shorthand/package.json @@ -29,7 +29,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-place/CHANGELOG.md b/plugins/postcss-place/CHANGELOG.md index 7476e5105..fca6fcfbc 100644 --- a/plugins/postcss-place/CHANGELOG.md +++ b/plugins/postcss-place/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Place Properties +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 9.0.1 _December 15, 2023_ diff --git a/plugins/postcss-place/package.json b/plugins/postcss-place/package.json index 115cf00ec..88cd7e94a 100644 --- a/plugins/postcss-place/package.json +++ b/plugins/postcss-place/package.json @@ -29,7 +29,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-progressive-custom-properties/CHANGELOG.md b/plugins/postcss-progressive-custom-properties/CHANGELOG.md index 4a5a623a8..6707db450 100644 --- a/plugins/postcss-progressive-custom-properties/CHANGELOG.md +++ b/plugins/postcss-progressive-custom-properties/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Progressive Custom Properties +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 3.2.0 _March 31, 2024_ diff --git a/plugins/postcss-progressive-custom-properties/package.json b/plugins/postcss-progressive-custom-properties/package.json index 0e52f2ff0..88d638c1c 100644 --- a/plugins/postcss-progressive-custom-properties/package.json +++ b/plugins/postcss-progressive-custom-properties/package.json @@ -15,7 +15,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-pseudo-class-any-link/CHANGELOG.md b/plugins/postcss-pseudo-class-any-link/CHANGELOG.md index 8c3f65650..3bf4215f3 100644 --- a/plugins/postcss-pseudo-class-any-link/CHANGELOG.md +++ b/plugins/postcss-pseudo-class-any-link/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Pseudo Class Any Link +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 9.0.1 _December 15, 2023_ diff --git a/plugins/postcss-pseudo-class-any-link/package.json b/plugins/postcss-pseudo-class-any-link/package.json index 815f72513..1de7dc5dc 100644 --- a/plugins/postcss-pseudo-class-any-link/package.json +++ b/plugins/postcss-pseudo-class-any-link/package.json @@ -29,7 +29,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-rebase-url/CHANGELOG.md b/plugins/postcss-rebase-url/CHANGELOG.md index 285a87edc..5e337df76 100644 --- a/plugins/postcss-rebase-url/CHANGELOG.md +++ b/plugins/postcss-rebase-url/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Rebase URL +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.0.7 _March 13, 2024_ diff --git a/plugins/postcss-rebase-url/package.json b/plugins/postcss-rebase-url/package.json index 6cd99beb4..0dad45c3a 100644 --- a/plugins/postcss-rebase-url/package.json +++ b/plugins/postcss-rebase-url/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-relative-color-syntax/CHANGELOG.md b/plugins/postcss-relative-color-syntax/CHANGELOG.md index 7690aca8a..40b3473f9 100644 --- a/plugins/postcss-relative-color-syntax/CHANGELOG.md +++ b/plugins/postcss-relative-color-syntax/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Relative Color Syntax +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 2.0.13 _March 31, 2024_ diff --git a/plugins/postcss-relative-color-syntax/package.json b/plugins/postcss-relative-color-syntax/package.json index 0a4e88c5b..751f9fb40 100644 --- a/plugins/postcss-relative-color-syntax/package.json +++ b/plugins/postcss-relative-color-syntax/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-rewrite-url/CHANGELOG.md b/plugins/postcss-rewrite-url/CHANGELOG.md index 7ade4d143..d178bbac7 100644 --- a/plugins/postcss-rewrite-url/CHANGELOG.md +++ b/plugins/postcss-rewrite-url/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Rewrite URL +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.1.0 _March 19, 2024_ diff --git a/plugins/postcss-rewrite-url/package.json b/plugins/postcss-rewrite-url/package.json index c661dc72b..83c0e405c 100644 --- a/plugins/postcss-rewrite-url/package.json +++ b/plugins/postcss-rewrite-url/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-scope-pseudo-class/CHANGELOG.md b/plugins/postcss-scope-pseudo-class/CHANGELOG.md index 38c749613..1f469242f 100644 --- a/plugins/postcss-scope-pseudo-class/CHANGELOG.md +++ b/plugins/postcss-scope-pseudo-class/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Scope Pseudo Class +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 3.0.1 _December 15, 2023_ diff --git a/plugins/postcss-scope-pseudo-class/package.json b/plugins/postcss-scope-pseudo-class/package.json index 3ffd4bdf3..5180fd648 100644 --- a/plugins/postcss-scope-pseudo-class/package.json +++ b/plugins/postcss-scope-pseudo-class/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-selector-not/CHANGELOG.md b/plugins/postcss-selector-not/CHANGELOG.md index 130d34232..048007533 100644 --- a/plugins/postcss-selector-not/CHANGELOG.md +++ b/plugins/postcss-selector-not/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Selector Not +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 7.0.2 _February 19, 2024_ diff --git a/plugins/postcss-selector-not/package.json b/plugins/postcss-selector-not/package.json index f85402091..d8d311c41 100644 --- a/plugins/postcss-selector-not/package.json +++ b/plugins/postcss-selector-not/package.json @@ -28,7 +28,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-slow-plugins/CHANGELOG.md b/plugins/postcss-slow-plugins/CHANGELOG.md index a7b71ddd9..0535cce96 100644 --- a/plugins/postcss-slow-plugins/CHANGELOG.md +++ b/plugins/postcss-slow-plugins/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Slow Plugins +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 1.0.2 _December 15, 2023_ diff --git a/plugins/postcss-slow-plugins/package.json b/plugins/postcss-slow-plugins/package.json index 356db2ef9..839910e3e 100644 --- a/plugins/postcss-slow-plugins/package.json +++ b/plugins/postcss-slow-plugins/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-stepped-value-functions/CHANGELOG.md b/plugins/postcss-stepped-value-functions/CHANGELOG.md index 25e38845b..eec536b0a 100644 --- a/plugins/postcss-stepped-value-functions/CHANGELOG.md +++ b/plugins/postcss-stepped-value-functions/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Stepped Value Functions +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 3.0.6 _March 13, 2024_ diff --git a/plugins/postcss-stepped-value-functions/package.json b/plugins/postcss-stepped-value-functions/package.json index 41ab85682..cfefdbe5b 100644 --- a/plugins/postcss-stepped-value-functions/package.json +++ b/plugins/postcss-stepped-value-functions/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-text-decoration-shorthand/CHANGELOG.md b/plugins/postcss-text-decoration-shorthand/CHANGELOG.md index 0c154a5c8..a81a2a32e 100644 --- a/plugins/postcss-text-decoration-shorthand/CHANGELOG.md +++ b/plugins/postcss-text-decoration-shorthand/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Text Decoration Shorthand +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 3.0.5 _March 31, 2024_ diff --git a/plugins/postcss-text-decoration-shorthand/package.json b/plugins/postcss-text-decoration-shorthand/package.json index ee76d7dce..435263391 100644 --- a/plugins/postcss-text-decoration-shorthand/package.json +++ b/plugins/postcss-text-decoration-shorthand/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-todo-or-die/CHANGELOG.md b/plugins/postcss-todo-or-die/CHANGELOG.md index 5eaf1d050..7cc29c091 100644 --- a/plugins/postcss-todo-or-die/CHANGELOG.md +++ b/plugins/postcss-todo-or-die/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Todo or Die +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 2.0.6 _March 13, 2024_ diff --git a/plugins/postcss-todo-or-die/package.json b/plugins/postcss-todo-or-die/package.json index 73578496d..2deb79984 100644 --- a/plugins/postcss-todo-or-die/package.json +++ b/plugins/postcss-todo-or-die/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-trigonometric-functions/CHANGELOG.md b/plugins/postcss-trigonometric-functions/CHANGELOG.md index 6255bf674..b5101cd7e 100644 --- a/plugins/postcss-trigonometric-functions/CHANGELOG.md +++ b/plugins/postcss-trigonometric-functions/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Trigonometric Functions +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 3.0.6 _March 13, 2024_ diff --git a/plugins/postcss-trigonometric-functions/package.json b/plugins/postcss-trigonometric-functions/package.json index 8d0031bb9..343007628 100644 --- a/plugins/postcss-trigonometric-functions/package.json +++ b/plugins/postcss-trigonometric-functions/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", diff --git a/plugins/postcss-unset-value/CHANGELOG.md b/plugins/postcss-unset-value/CHANGELOG.md index 8f6d315b0..5816d46cd 100644 --- a/plugins/postcss-unset-value/CHANGELOG.md +++ b/plugins/postcss-unset-value/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to PostCSS Unset Value +### Unreleased (major) + +- Updated: Support for Node v18+ (major). + ### 3.0.1 _December 15, 2023_ diff --git a/plugins/postcss-unset-value/package.json b/plugins/postcss-unset-value/package.json index 7cfee9f13..6c8874f5a 100644 --- a/plugins/postcss-unset-value/package.json +++ b/plugins/postcss-unset-value/package.json @@ -25,7 +25,7 @@ } ], "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "type": "module", "main": "dist/index.cjs", From 086320bc29137a58d910bf603787b1357ce55e1e Mon Sep 17 00:00:00 2001 From: Romain Menke <11521496+romainmenke@users.noreply.github.com> Date: Sun, 5 May 2024 11:25:35 +0200 Subject: [PATCH 3/7] `postcss-nesting`: make edition `2024-02` the default (#1370) --- .../postcss-preset-env/test/_tape.mjs | 37 -- .../test/basic.autoprefixer.expect.css | 15 +- .../test/basic.autoprefixer.false.expect.css | 15 +- ...basic.autoprefixer.remove.false.expect.css | 15 +- .../test/basic.ch38.expect.css | 15 +- .../test/basic.ch88-ff78-saf10.expect.css | 609 ------------------ .../test/basic.ch88-ff78.expect.css | 603 ----------------- .../basic.ch88-ff78.no-is-pseudo.expect.css | 603 ----------------- .../postcss-preset-env/test/basic.expect.css | 15 +- .../test/basic.ff49.expect.css | 15 +- .../test/basic.ff66.expect.css | 15 +- ...ebrew.all-browsers-have-support.expect.css | 15 +- .../test/basic.hebrew.expect.css | 15 +- .../test/basic.ie10.expect.css | 23 +- ...esting.noIsPseudoSelector.false.expect.css | 512 --------------- .../test/basic.nesting.true.expect.css | 15 +- .../test/basic.op_mini.expect.css | 15 +- .../test/basic.preserve.false.expect.css | 35 +- .../test/basic.preserve.true.expect.css | 37 +- .../test/basic.safari15.expect.css | 15 +- .../test/basic.stage0-ff49.expect.css | 15 +- .../test/basic.stage0-ff66.expect.css | 15 +- .../test/basic.stage0.expect.css | 15 +- .../test/basic.supports-query.expect.css | 15 +- .../test/basic.vendors-1.expect.css | 15 +- .../test/basic.vendors-2.expect.css | 15 +- .../test/basic.vendors-3.expect.css | 15 +- .../test/layers-basic.expect.css | 33 +- .../layers-basic.preserve.true.expect.css | 35 +- .../plugin-order-nesting.after.expect.css | 4 +- ...in-order-nesting.after.preserve.expect.css | 8 +- .../plugin-order-nesting.before.expect.css | 4 +- ...n-order-nesting.before.preserve.expect.css | 8 +- plugins/postcss-nesting/CHANGELOG.md | 1 + plugins/postcss-nesting/README.md | 103 +-- plugins/postcss-nesting/dist/index.cjs | 2 +- plugins/postcss-nesting/dist/index.d.ts | 2 +- plugins/postcss-nesting/dist/index.mjs | 2 +- plugins/postcss-nesting/docs/README.md | 62 +- plugins/postcss-nesting/src/index.ts | 4 +- plugins/postcss-nesting/test/_tape-2021.mjs | 83 ++- .../postcss-nesting/test/_tape-2024-02.mjs | 54 -- .../test/wpt/nesting-basics.html | 8 +- .../src/static/js/playground.js | 5 - 44 files changed, 453 insertions(+), 2709 deletions(-) delete mode 100644 plugin-packs/postcss-preset-env/test/basic.ch88-ff78-saf10.expect.css delete mode 100644 plugin-packs/postcss-preset-env/test/basic.ch88-ff78.expect.css delete mode 100644 plugin-packs/postcss-preset-env/test/basic.ch88-ff78.no-is-pseudo.expect.css delete mode 100644 plugin-packs/postcss-preset-env/test/basic.nesting.noIsPseudoSelector.false.expect.css diff --git a/plugin-packs/postcss-preset-env/test/_tape.mjs b/plugin-packs/postcss-preset-env/test/_tape.mjs index 2b0d1c484..9834037f3 100644 --- a/plugin-packs/postcss-preset-env/test/_tape.mjs +++ b/plugin-packs/postcss-preset-env/test/_tape.mjs @@ -44,13 +44,6 @@ postcssTape(plugin)({ browsers: 'ie >= 10', }, }, - 'basic:ch88-ff78': { - message: 'uses :is pseudo for nesting with modern browsers { browsers: "chrome >= 88, firefox >= 78", stage: 0 }', - options: { - browsers: 'chrome >= 88, firefox >= 78', - stage: 0, - }, - }, 'basic:safari15': { message: 'supports { browsers: "safari >= 15" } usage', options: { @@ -64,25 +57,6 @@ postcssTape(plugin)({ browsers: 'op_mini all', }, }, - 'basic:ch88-ff78:no-is-pseudo': { - message: ':is pseudo for nesting can be disable with modern browsers { browsers: "chrome >= 88, firefox >= 78", stage: 0, features: { nesting-rules: { noIsPseudoSelector: true } } } usage', - options: { - browsers: 'chrome >= 88, firefox >= 78', - stage: 0, - features: { - 'nesting-rules': { - noIsPseudoSelector: true, - }, - }, - }, - }, - 'basic:ch88-ff78-saf10': { - message: 'does not use :is pseudo for nesting with an older browser { browsers: "chrome >= 88, firefox >= 78, safari >= 10", stage: 0 } usage', - options: { - browsers: 'chrome >= 88, firefox >= 78, safari >= 10', - stage: 0, - }, - }, 'basic:supports-query': { message: 'supports { browsers: "defaults and supports css-variables" } usage', options: { @@ -142,17 +116,6 @@ postcssTape(plugin)({ }, }, }, - 'basic:nesting:noIsPseudoSelector:false': { - message: 'supports { stage: false, features: { "nesting-rules": { "noIsPseudoSelector": false } } } usage', - options: { - stage: false, - features: { - 'nesting-rules': [true, { - noIsPseudoSelector: false, - }], - }, - }, - }, 'basic:nesting:false': { message: 'supports { stage: 0, features: { "nesting-rules": false } } usage', options: { diff --git a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css index 8cc68a0aa..235b2a4a2 100644 --- a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css @@ -43,25 +43,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } .test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @media (max-width: 30em) { .test-custom-media-queries { order: 10; diff --git a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css index dc9dd535b..215e8f541 100644 --- a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css @@ -43,25 +43,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } .test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @media (max-width: 30em) { .test-custom-media-queries { order: 10; diff --git a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.remove.false.expect.css b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.remove.false.expect.css index 8167e9f24..2d6f43954 100644 --- a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.remove.false.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.remove.false.expect.css @@ -44,25 +44,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } .test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @media (max-width: 30em) { .test-custom-media-queries { order: 10; diff --git a/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css b/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css index b37a2498c..43684c724 100644 --- a/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css @@ -36,25 +36,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } .test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @media (max-width: 30em) { .test-custom-media-queries { order: 10; diff --git a/plugin-packs/postcss-preset-env/test/basic.ch88-ff78-saf10.expect.css b/plugin-packs/postcss-preset-env/test/basic.ch88-ff78-saf10.expect.css deleted file mode 100644 index 4a30967ae..000000000 --- a/plugin-packs/postcss-preset-env/test/basic.ch88-ff78-saf10.expect.css +++ /dev/null @@ -1,609 +0,0 @@ -:root { - --order: 1; -} - -.test-custom-property-fallbacks { - --firebrick: rgb(179, 35, 35); -} - -.test-custom-properties { - order: var(--order); -} - -.test-image-set-function { - background-image: url(img/test.png); - background-image: -webkit-image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); - background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); - order: 2; -} - -@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { - -.test-image-set-function { - background-image: url(img/test-2x.png); -} -} - -.test-logical-properties-and-values { - margin-left: 1px; - margin-right: 2px; - order: 3; - padding-top: 4px; - padding-bottom: 4px; -} - -.test-logical-resize { - resize: horizontal; -} - -.test-logical-viewport-units { - width: calc(10vw + 5px); - width: calc(10vi + 5px); -} - -.test-nesting-rules { - order: 4; - - order: 6; -} - -.test-nesting-rules p { - order: 5; - } - -.test-nesting-rules, -#test-is-pseudo { - order: 7; - - order: 9; -} - -.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { - order: 8; - } - -@media (max-width: 30em) { - .test-custom-media-queries { - order: 10; - } -} - -@media (min-width: 480px) and (max-width: 767.98px) { - .test-media-query-ranges { - order: 11; - } -} - -@media (prefers-color-scheme: dark) { - body { - background-color: black; - color: white; - } -} - -h1.test-custom-selectors:not(.does-not-exist), h2.test-custom-selectors:not(.does-not-exist), h3.test-custom-selectors:not(.does-not-exist), h4.test-custom-selectors:not(.does-not-exist), h5.test-custom-selectors:not(.does-not-exist), h6.test-custom-selectors:not(.does-not-exist), .test-custom-selectors.heading-7 { - order:12; -} - -.test-case-insensitive-attributes[frame=hsides i] { - order: 13; -} - -.test-rebeccapurple-color { - color: rebeccapurple; - order: 14; -} - -.test-hexadecimal-alpha-notation { - background-color: #f3f3f3f3; - color: #0003; - order: 15; -} - -.test-color-functional-notation { - color: rgba(179, 34, 34, 0.5); - order: 16; -} - -.test-lab-function { - background-color: rgb(179, 35, 35); - color: rgba(179, 34, 35, 0.5); - order: 17; -} - -.test-system-ui-font-family { - font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif; - order: 18; -} - -.test-font-variant-property { - font-feature-settings: "smcp"; - font-variant-caps: small-caps; - order: 19; -} - -.test-all-property { - all: initial; - order: 20; -} - -.test-matches-pseudo-class:matches(:first-child, .special) { - order: 21; -} - -.test-not-pseudo-class:not(:first-child):not(.special) { - order: 22; -} - -.test-any-link-pseudo-class:any-link { - order: 23; -} - -[dir="rtl"] .test-dir-pseudo-class { - order: 24; -} - -.test-overflow-wrap-property { - order: 25; - overflow-wrap: break-word; -} - -.test-focus-visible-pseudo-class:focus-visible { - order: 26; -} - -.test-double-position-gradients { - background-image: conic-gradient(yellowgreen 40%, gold 0deg,gold 75%, #f06 0deg); - background-image: conic-gradient(yellowgreen 40%, gold 0deg 75%, #f06 0deg); -} - -.test-blank-pseudo-class:blank { - background-color: yellow; -} - -.test-has-pseudo-class:has(.inner-class) { - background-color: yellow; -} - -.a:focus, .a:hover, .b:focus, .b:hover { - order: 27; -} - -.a.c > .b + .d { - order: 28; -} - -.test-hwb-function { - background-color: rgba(0, 196, 255, 0.5); -} - -.test-opacity-percent { - opacity: 0.42; -} - -.clamp-same-unit { - width: max(10px, min(64px, 80px)); -} - -.complex-clamp { - width: max(calc(100% - 10px), min(min(10px, 100%), max(40px, 4em))); -} - -.clamp-different-units { - width: max(10%, min(2px, 4rem)); -} - -.mixed-clamp { - grid-template-columns: max(22rem, min(40%, 32rem)) minmax(0, 1fr); - margin: max(1rem, min(2%, 3rem)) 4vh; -} - -.calc-clamp { - margin: 0 40px 0 calc(-1 * max(32px, min(16vw, 64px))); -} - -.multiple-calc-clamp { - margin: calc(-1 * max(1px, min(2vw, 3px))) calc(-1 * max(4px, min(5vw, 6px))); -} - -.nested-clamp { - font-size: max(max(1rem, min(2vw, 3rem)), min(4vw, 5rem)); -} - -@font-face { - font-family: 'A'; - font-style: normal; - font-weight: 300; - font-display: swap; - src: url(a) format("woff2"); -} - -.block-flow { - display: block; - display: block flow; -} - -.block-flow-root { - display: flow-root; - display: block flow-root; -} - -.inline-flow { - display: inline; - display: inline flow; -} - -.inline-flow-root { - display: inline-block; - display: inline flow-root; -} - -.run-in-flow { - display: run-in; - display: run-in flow; -} - -.list-item-block-flow { - display: list-item; - display: list-item block flow; -} - -.inline-flow-list-item { - display: inline list-item; - display: inline flow list-item; -} - -.block-flex { - display: flex; - display: block flex; -} - -.inline-flex { - display: inline-flex; - display: inline flex; -} - -.block-grid { - display: grid; - display: block grid; -} - -.inline-grid { - display: inline-grid; - display: inline grid; -} - -.inline-ruby { - display: ruby; - display: inline ruby; -} - -.block-table { - display: table; - display: block table; -} - -.inline-table { - display: inline-table; - display: inline table; -} - -.table-cell-flow { - display: table-cell; - display: table-cell flow; -} - -.table-caption-flow { - display: table-caption; - display: table-caption flow; -} - -.ruby-base-flow { - display: ruby-base; - display: ruby-base flow; -} - -.ruby-text-flow { - display: ruby-text; - display: ruby-text flow; -} - -.logical-float { - float: left; -} - -.color-function { - prop-1: rgb(0, 129, 96); - prop-2: 'color(display-p3 0.02472 0.01150 0.00574 / 1)'; - prop-3: rgb(7, 3, 1); - prop-4: rgb(7, 3, 1); - prop-5: color(display-p3 1 1 1 1); -} - -.oklab { - color-1: rgb(73, 71, 69); - color-2: rgb(121, 34, 67); - color-3: rgba(121, 34, 67, 0.5); - color-4: rgb(121, 34, 67); - color-5: rgba(121, 34, 67, 0.5); - color-6: rgb(177, 102, 126); - color-7: oklab(60% 0.1 0 foo); - color-8: rgb(125, 35, 41); - color-9: rgb(198, 93, 7); - color-10: rgb(157, 147, 24); - color-11: rgb(104, 166, 57); - color-12: rgb(98, 172, 239); -} - -.oklch { - color-1: rgb(126, 37, 15); - color-2: rgb(126, 37, 15); - color-3: rgba(126, 37, 15, 0.5); - color-4: rgb(126, 37, 15); - color-5: rgba(126, 37, 15, 0.5); - color-6: rgb(197, 84, 124); - - color-7: rgb(0, 149, 131); - color-8: rgb(0, 149, 131); - color-9: rgb(0, 149, 131); - color-10: rgb(0, 149, 131); - color-11: rgb(0, 149, 131); - - color-12: rgb(188, 101, 59); - color-13: rgb(188, 101, 59); - color-14: rgb(188, 101, 59); - color-15: rgb(188, 101, 59); - color-16: rgb(188, 101, 59); - color-17: oklch(60% 0.1250 0.785398unknown); -} - -@media (color-gamut: p3) { -.oklch { - - color-7: color(display-p3 0.19244 0.58461 0.51559); - color-8: color(display-p3 0.19244 0.58461 0.51559); - color-9: color(display-p3 0.19244 0.58461 0.51559); - color-10: color(display-p3 0.19244 0.58461 0.51559); - color-11: color(display-p3 0.19244 0.58461 0.51559); -} -} - -.ic-unit { - --value-2ic: initial; - text-indent: 2em; - content: var(--value-2ic); - left: var(--non-existing, 2em); - width: calc(8em + 20px); - height: 10px; - margin: 0.5em 1em .2em; - padding: 2 ic; -} - -.unset { - clip: unset; -} - -.mod { - padding: 8px 3px 1px calc(3px + 50%); - transform: rotate(-50deg); - width: 2px; -} - -.rem { - padding: 8px 3px 1px calc(3px + 50%); - transform: rotate(-50deg); -} - -.round { - top: 3px; - right: 3px; - bottom: 3px; - left: 2px; - padding-left: 2px; -} - -.trigonometric { - left: 0.70711; - left: 0.70711; - left: 1; - left: 30deg; - left: 60deg; - left: 84.28941deg; - left: -45deg; - left: 90deg; - left: 135deg; - left: 0.99863; -} - -.trigonometric-ignore-not-a-function { - left: sin; - left: cos; - left: tan; - left: asin; - left: acos; - left: atan; - left: atan2; -} - -.trigonometric-ignore-no-arguments { - left: sin(); - left: cos(); - left: tan(); - left: asin(); - left: acos(); - left: atan(); - left: atan2(); -} - -[data-view-size=m] .view { - background: red; - } - -.nested-calc { - order: calc(1 * (8 / 3 + (5 * 10))); - order: calc(1 * calc(8 / 3 + calc(5 * 10))); -} - -.text-decoration-shorthand { - text-decoration: overline; - -webkit-text-decoration: overline wavy pink; - text-decoration: overline wavy pink; - text-decoration-thickness: 3px; - -webkit-text-decoration: 3px wavy pink overline; - text-decoration: 3px wavy pink overline; -} - -.stage__container { - left: var(--size, 1rem); -} - -:scope { - content: "plain :scope"; -} - -@scope (.foo) { - :scope { - content: ":scope in @scope"; - } -} - -:scope { - @scope (.foo) { - content: ":scope in @scope, but with nesting"; - } -} - -@media (min-aspect-ratio: 177/100) { - /* media query aspect ratio : */ -} - -.color-mix { - color-1: rgba(0, 0, 255, 0.65); - color-2: rgba(0, 0, 255, 0.65); - color-3: rgba(0, 0, 255, 0.65); - color-4: rgba(121, 0, 181, 0.65); - color-5: rgba(148, 0, 122, 0.65); - color-6: rgba(179, 0, 255, 0.65); -} - -@media (color-gamut: p3) { -.color-mix { - color-4: color(display-p3 0.44 0 0.70096 / 0.65); - color-5: color(display-p3 0.54692 0 0.47541 / 0.65); -} -} - -.gradients-interpolation-method { - --background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(245, 140, 170), rgb(238, 146, 202), rgb(227, 155, 230), rgb(210, 166, 253), rgb(188, 179, 255), rgb(164, 192, 255), rgb(137, 206, 255), rgb(111, 218, 255), rgb(93, 229, 255), rgb(94, 237, 237) 100%); - - background-image: radial-gradient(farthest-corner circle at 50% 115%, rgb(255, 71, 0) 0%, rgb(255, 103, 0), rgb(255, 137, 0), rgb(255, 169, 0), rgb(250, 199, 0), rgb(197, 225, 0), rgb(116, 246, 0), rgb(0, 255, 86), rgb(0, 255, 171), rgb(0, 255, 239), rgb(0, 255, 255) 100%); -} - -@media (color-gamut: rec2020) { -.gradients-interpolation-method { - - background-image: radial-gradient(farthest-corner circle at 50% 115%, color(display-p3 1.2198 0.38716 0.16814) 0%, color(display-p3 1.20289 0.47522 -0.3004), color(display-p3 1.15167 0.57912 -0.3946), color(display-p3 1.06645 0.68611 -0.4296), color(display-p3 0.94738 0.78766 -0.4263), color(display-p3 0.79233 0.87807 -0.3707), color(display-p3 0.59026 0.95319 -0.1467), color(display-p3 0.27082 1.00972 0.43521), color(display-p3 -0.3983 1.04501 0.69996), color(display-p3 -0.5392 1.05733 0.93686), color(display-p3 -0.5777 1.04644 1.15396) 100%); - - background-image: radial-gradient(farthest-corner circle at 50% 115% in oklch, oklch(80% .3 34) 0%, oklch(90% .3 200) 100%); -} -} - -@supports (color: color(display-p3 0 0 0%)) { -.gradients-interpolation-method { - --background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(245, 140, 170), rgb(238, 146, 202), rgb(227, 155, 230), rgb(210, 166, 253), rgb(189, 182, 255), rgb(173, 195, 255), rgb(159, 205, 255), rgb(140, 215, 255), rgb(100, 228, 255), rgb(94, 237, 237) 100%); -} - -@media (color-gamut: rec2020) { -.gradients-interpolation-method { - --background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(245, 140, 170), rgb(238, 146, 202), rgb(227, 155, 230), rgb(210, 166, 253), color(display-p3 0.73255 0.7035 1.03328), color(display-p3 0.66377 0.75145 1.06652), color(display-p3 0.59643 0.80011 1.0696), color(display-p3 0.54198 0.8462 1.04382), color(display-p3 0.51578 0.88643 0.99318), rgb(94, 237, 237) 100%); -} -} -} - -@supports (background: linear-gradient(in oklch, red 0%, red 0% 1%, red 2%)) and (color: hsl(0 0% 0% / 0)) { -.gradients-interpolation-method { - --background-image: linear-gradient(in oklch decreasing hue, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%); -} -} - -.test-css-color-5-interop { - color-1: rgb(196, 129, 72); - color-2: color(from rgb(196, 129, 72) a98-rgb r g b / none); - color-3: rgb(234, 133, 82); - color-4: color(from rgb(234, 133, 82) prophoto-rgb r g none); - color-5: rgb(179, 157, 51); - color-6: rgb(179, 35, 35); - color-7: rgb(163, 57, 39); - color-8: rgb(131, 27, 0); - color-9: rgb(126, 37, 0); -} - -@media (color-gamut: p3) { -.test-css-color-5-interop { - color-8: color(display-p3 0.4939 0.10676 0); - color-9: color(display-p3 0.47553 0.14324 0); -} -} - -.test-property-with-var { - --opacity: 1; - color: rgba(87, 107, 149, var(--opacity)); -} - -.exponential-functions { - width: 8px; -} - -.out-of-gamut { - --color: rgb(0, 247, 79); -} - -.issue-1244--a { - background-image: -ms-linear-gradient(180deg, red 0%, blue 100%); -} - -.issue-1244--b { - background-image: linear-gradient(180deg, red 0%, blue 100%); -} - -.issue-1244--c { - background-image: linear-gradient(180deg, red 0%, blue 100%); -} - -.dark { - --csstools-color-scheme--dark: initial; - color-scheme: dark; -} - -.light { - --csstools-color-scheme--dark: ; - color-scheme: light; -} - -.schemed-colors { - --csstools-light-dark-toggle--1: var(--csstools-color-scheme--dark) rgb(131, 27, 0); - color: var(--csstools-light-dark-toggle--1, magenta); - color: light-dark(rgb(131, 27, 0), magenta); -} - -@media (color-gamut: p3) { -.schemed-colors { - color: light-dark(color(display-p3 0.4939 0.10676 0), magenta); -} -} - -.schemed-prop { - --csstools-light-dark-toggle--0: var(--csstools-color-scheme--dark) cyan; - --theme-color: var(--csstools-light-dark-toggle--0, deepskyblue); -} - -@supports (color: light-dark(red, red)) { -.schemed-prop { - --theme-color: light-dark(cyan, deepskyblue); -} -} - -.schemed-prop * { - --csstools-light-dark-toggle--0: var(--csstools-color-scheme--dark) cyan; - --theme-color: var(--csstools-light-dark-toggle--0, deepskyblue); -} diff --git a/plugin-packs/postcss-preset-env/test/basic.ch88-ff78.expect.css b/plugin-packs/postcss-preset-env/test/basic.ch88-ff78.expect.css deleted file mode 100644 index 5defa44eb..000000000 --- a/plugin-packs/postcss-preset-env/test/basic.ch88-ff78.expect.css +++ /dev/null @@ -1,603 +0,0 @@ -:root { - --order: 1; -} - -.test-custom-property-fallbacks { - --firebrick: rgb(179, 35, 35); -} - -.test-custom-properties { - order: var(--order); -} - -.test-image-set-function { - background-image: url(img/test.png); - background-image: -webkit-image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); - background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); - order: 2; -} - -@media (min-resolution: 192dpi) { - -.test-image-set-function { - background-image: url(img/test-2x.png); -} -} - -.test-logical-properties-and-values { - margin-left: 1px; - margin-right: 2px; - order: 3; - padding-top: 4px; - padding-bottom: 4px; -} - -.test-logical-resize { - resize: horizontal; -} - -.test-logical-viewport-units { - width: calc(10vw + 5px); - width: calc(10vi + 5px); -} - -.test-nesting-rules { - order: 4; - - order: 6; -} - -.test-nesting-rules p { - order: 5; - } - -.test-nesting-rules, -#test-is-pseudo { - order: 7; - - order: 9; -} - -.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { - order: 8; - } - -@media (max-width: 30em) { - .test-custom-media-queries { - order: 10; - } -} - -@media (min-width: 480px) and (max-width: 767.98px) { - .test-media-query-ranges { - order: 11; - } -} - -@media (prefers-color-scheme: dark) { - body { - background-color: black; - color: white; - } -} - -h1.test-custom-selectors:not(.does-not-exist), h2.test-custom-selectors:not(.does-not-exist), h3.test-custom-selectors:not(.does-not-exist), h4.test-custom-selectors:not(.does-not-exist), h5.test-custom-selectors:not(.does-not-exist), h6.test-custom-selectors:not(.does-not-exist), .test-custom-selectors.heading-7 { - order:12; -} - -.test-case-insensitive-attributes[frame=hsides i] { - order: 13; -} - -.test-rebeccapurple-color { - color: rebeccapurple; - order: 14; -} - -.test-hexadecimal-alpha-notation { - background-color: #f3f3f3f3; - color: #0003; - order: 15; -} - -.test-color-functional-notation { - color: rgb(70% 13.5% 13.5% / 50%); - order: 16; -} - -.test-lab-function { - background-color: rgb(179, 35, 35); - color: rgba(179, 34, 35, 0.5); - order: 17; -} - -.test-system-ui-font-family { - font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif; - order: 18; -} - -.test-font-variant-property { - font-feature-settings: "smcp"; - font-variant-caps: small-caps; - order: 19; -} - -.test-all-property { - all: initial; - order: 20; -} - -.test-matches-pseudo-class:matches(:first-child, .special) { - order: 21; -} - -.test-not-pseudo-class:not(:first-child):not(.special) { - order: 22; -} - -.test-any-link-pseudo-class:any-link { - order: 23; -} - -[dir="rtl"] .test-dir-pseudo-class { - order: 24; -} - -.test-overflow-wrap-property { - order: 25; - overflow-wrap: break-word; -} - -.test-focus-visible-pseudo-class:focus-visible { - order: 26; -} - -.test-double-position-gradients { - background-image: conic-gradient(yellowgreen 40%, gold 0deg,gold 75%, #f06 0deg); - background-image: conic-gradient(yellowgreen 40%, gold 0deg 75%, #f06 0deg); -} - -.test-blank-pseudo-class:blank { - background-color: yellow; -} - -.test-has-pseudo-class:has(.inner-class) { - background-color: yellow; -} - -.a:focus, .a:hover, .b:focus, .b:hover { - order: 27; -} - -.a.c > .b + .d { - order: 28; -} - -.test-hwb-function { - background-color: rgba(0, 196, 255, 0.5); -} - -.test-opacity-percent { - opacity: 42%; -} - -.clamp-same-unit { - width: clamp(10px, 64px, 80px); -} - -.complex-clamp { - width: clamp(calc(100% - 10px), min(10px, 100%), max(40px, 4em)); -} - -.clamp-different-units { - width: clamp(10%, 2px, 4rem); -} - -.mixed-clamp { - grid-template-columns: clamp(22rem, 40%, 32rem) minmax(0, 1fr); - margin: clamp(1rem, 2%, 3rem) 4vh; -} - -.calc-clamp { - margin: 0 40px 0 calc(-1 * clamp(32px, 16vw, 64px)); -} - -.multiple-calc-clamp { - margin: calc(-1 * clamp(1px, 2vw, 3px)) calc(-1 * clamp(4px, 5vw, 6px)); -} - -.nested-clamp { - font-size: clamp(clamp(1rem, 2vw, 3rem), 4vw, 5rem); -} - -@font-face { - font-family: 'A'; - font-style: normal; - font-weight: 300; - font-display: swap; - src: url(a) format("woff2"); -} - -.block-flow { - display: block; - display: block flow; -} - -.block-flow-root { - display: flow-root; - display: block flow-root; -} - -.inline-flow { - display: inline; - display: inline flow; -} - -.inline-flow-root { - display: inline-block; - display: inline flow-root; -} - -.run-in-flow { - display: run-in; - display: run-in flow; -} - -.list-item-block-flow { - display: list-item; - display: list-item block flow; -} - -.inline-flow-list-item { - display: inline list-item; - display: inline flow list-item; -} - -.block-flex { - display: flex; - display: block flex; -} - -.inline-flex { - display: inline-flex; - display: inline flex; -} - -.block-grid { - display: grid; - display: block grid; -} - -.inline-grid { - display: inline-grid; - display: inline grid; -} - -.inline-ruby { - display: ruby; - display: inline ruby; -} - -.block-table { - display: table; - display: block table; -} - -.inline-table { - display: inline-table; - display: inline table; -} - -.table-cell-flow { - display: table-cell; - display: table-cell flow; -} - -.table-caption-flow { - display: table-caption; - display: table-caption flow; -} - -.ruby-base-flow { - display: ruby-base; - display: ruby-base flow; -} - -.ruby-text-flow { - display: ruby-text; - display: ruby-text flow; -} - -.logical-float { - float: left; -} - -.color-function { - prop-1: rgb(0, 129, 96); - prop-2: 'color(display-p3 0.02472 0.01150 0.00574 / 1)'; - prop-3: rgb(7, 3, 1); - prop-4: rgb(7, 3, 1); - prop-5: color(display-p3 1 1 1 1); -} - -.oklab { - color-1: rgb(73, 71, 69); - color-2: rgb(121, 34, 67); - color-3: rgba(121, 34, 67, 0.5); - color-4: rgb(121, 34, 67); - color-5: rgba(121, 34, 67, 0.5); - color-6: rgb(177, 102, 126); - color-7: oklab(60% 0.1 0 foo); - color-8: rgb(125, 35, 41); - color-9: rgb(198, 93, 7); - color-10: rgb(157, 147, 24); - color-11: rgb(104, 166, 57); - color-12: rgb(98, 172, 239); -} - -.oklch { - color-1: rgb(126, 37, 15); - color-2: rgb(126, 37, 15); - color-3: rgba(126, 37, 15, 0.5); - color-4: rgb(126, 37, 15); - color-5: rgba(126, 37, 15, 0.5); - color-6: rgb(197, 84, 124); - - color-7: rgb(0, 149, 131); - color-8: rgb(0, 149, 131); - color-9: rgb(0, 149, 131); - color-10: rgb(0, 149, 131); - color-11: rgb(0, 149, 131); - - color-12: rgb(188, 101, 59); - color-13: rgb(188, 101, 59); - color-14: rgb(188, 101, 59); - color-15: rgb(188, 101, 59); - color-16: rgb(188, 101, 59); - color-17: oklch(60% 0.1250 0.785398unknown); -} - -@media (color-gamut: p3) { -.oklch { - - color-7: color(display-p3 0.19244 0.58461 0.51559); - color-8: color(display-p3 0.19244 0.58461 0.51559); - color-9: color(display-p3 0.19244 0.58461 0.51559); - color-10: color(display-p3 0.19244 0.58461 0.51559); - color-11: color(display-p3 0.19244 0.58461 0.51559); -} -} - -.ic-unit { - --value-2ic: initial; - text-indent: 2em; - content: var(--value-2ic); - left: var(--non-existing, 2em); - width: calc(8em + 20px); - height: 10px; - margin: 0.5em 1em .2em; - padding: 2 ic; -} - -.unset { - clip: unset; -} - -.mod { - padding: 8px 3px 1px calc(3px + 50%); - transform: rotate(-50deg); - width: 2px; -} - -.rem { - padding: 8px 3px 1px calc(3px + 50%); - transform: rotate(-50deg); -} - -.round { - top: 3px; - right: 3px; - bottom: 3px; - left: 2px; - padding-left: 2px; -} - -.trigonometric { - left: 0.70711; - left: 0.70711; - left: 1; - left: 30deg; - left: 60deg; - left: 84.28941deg; - left: -45deg; - left: 90deg; - left: 135deg; - left: 0.99863; -} - -.trigonometric-ignore-not-a-function { - left: sin; - left: cos; - left: tan; - left: asin; - left: acos; - left: atan; - left: atan2; -} - -.trigonometric-ignore-no-arguments { - left: sin(); - left: cos(); - left: tan(); - left: asin(); - left: acos(); - left: atan(); - left: atan2(); -} - -[data-view-size=m] .view { - background: red; - } - -.nested-calc { - order: calc(1 * calc(8 / 3 + calc(5 * 10))); -} - -.text-decoration-shorthand { - text-decoration: 3px wavy pink overline; -} - -.stage__container { - left: var(--size, 1rem); -} - -:scope { - content: "plain :scope"; -} - -@scope (.foo) { - :scope { - content: ":scope in @scope"; - } -} - -:scope { - @scope (.foo) { - content: ":scope in @scope, but with nesting"; - } -} - -@media (min-aspect-ratio: 177/100) { - /* media query aspect ratio : */ -} - -.color-mix { - color-1: rgba(0, 0, 255, 0.65); - color-2: rgba(0, 0, 255, 0.65); - color-3: rgba(0, 0, 255, 0.65); - color-4: rgba(121, 0, 181, 0.65); - color-5: rgba(148, 0, 122, 0.65); - color-6: rgba(179, 0, 255, 0.65); -} - -@media (color-gamut: p3) { -.color-mix { - color-4: color(display-p3 0.44 0 0.70096 / 0.65); - color-5: color(display-p3 0.54692 0 0.47541 / 0.65); -} -} - -.gradients-interpolation-method { - --background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(245, 140, 170), rgb(238, 146, 202), rgb(227, 155, 230), rgb(210, 166, 253), rgb(188, 179, 255), rgb(164, 192, 255), rgb(137, 206, 255), rgb(111, 218, 255), rgb(93, 229, 255), rgb(94, 237, 237) 100%); - - background-image: radial-gradient(farthest-corner circle at 50% 115%, rgb(255, 71, 0) 0%, rgb(255, 103, 0), rgb(255, 137, 0), rgb(255, 169, 0), rgb(250, 199, 0), rgb(197, 225, 0), rgb(116, 246, 0), rgb(0, 255, 86), rgb(0, 255, 171), rgb(0, 255, 239), rgb(0, 255, 255) 100%); -} - -@media (color-gamut: rec2020) { -.gradients-interpolation-method { - - background-image: radial-gradient(farthest-corner circle at 50% 115%, color(display-p3 1.2198 0.38716 0.16814) 0%, color(display-p3 1.20289 0.47522 -0.3004), color(display-p3 1.15167 0.57912 -0.3946), color(display-p3 1.06645 0.68611 -0.4296), color(display-p3 0.94738 0.78766 -0.4263), color(display-p3 0.79233 0.87807 -0.3707), color(display-p3 0.59026 0.95319 -0.1467), color(display-p3 0.27082 1.00972 0.43521), color(display-p3 -0.3983 1.04501 0.69996), color(display-p3 -0.5392 1.05733 0.93686), color(display-p3 -0.5777 1.04644 1.15396) 100%); - - background-image: radial-gradient(farthest-corner circle at 50% 115% in oklch, oklch(80% .3 34) 0%, oklch(90% .3 200) 100%); -} -} - -@supports (color: color(display-p3 0 0 0%)) { -.gradients-interpolation-method { - --background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(245, 140, 170), rgb(238, 146, 202), rgb(227, 155, 230), rgb(210, 166, 253), rgb(189, 182, 255), rgb(173, 195, 255), rgb(159, 205, 255), rgb(140, 215, 255), rgb(100, 228, 255), rgb(94, 237, 237) 100%); -} - -@media (color-gamut: rec2020) { -.gradients-interpolation-method { - --background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(245, 140, 170), rgb(238, 146, 202), rgb(227, 155, 230), rgb(210, 166, 253), color(display-p3 0.73255 0.7035 1.03328), color(display-p3 0.66377 0.75145 1.06652), color(display-p3 0.59643 0.80011 1.0696), color(display-p3 0.54198 0.8462 1.04382), color(display-p3 0.51578 0.88643 0.99318), rgb(94, 237, 237) 100%); -} -} -} - -@supports (background: linear-gradient(in oklch, red 0%, red 0% 1%, red 2%)) and (color: hsl(0 0% 0% / 0)) { -.gradients-interpolation-method { - --background-image: linear-gradient(in oklch decreasing hue, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%); -} -} - -.test-css-color-5-interop { - color-1: rgb(196, 129, 72); - color-2: color(from rgb(196, 129, 72) a98-rgb r g b / none); - color-3: rgb(234, 133, 82); - color-4: color(from rgb(234, 133, 82) prophoto-rgb r g none); - color-5: rgb(179, 157, 51); - color-6: rgb(179, 35, 35); - color-7: rgb(163, 57, 39); - color-8: rgb(131, 27, 0); - color-9: rgb(126, 37, 0); -} - -@media (color-gamut: p3) { -.test-css-color-5-interop { - color-8: color(display-p3 0.4939 0.10676 0); - color-9: color(display-p3 0.47553 0.14324 0); -} -} - -.test-property-with-var { - --opacity: 1; - color: rgba(87 107 149 / var(--opacity)); -} - -.exponential-functions { - width: 8px; -} - -.out-of-gamut { - --color: rgb(0, 247, 79); -} - -.issue-1244--a { - background-image: -ms-linear-gradient(180deg, red 0%, blue 100%); -} - -.issue-1244--b { - background-image: linear-gradient(180deg, red 0%, blue 100%); -} - -.issue-1244--c { - background-image: linear-gradient(180deg, red 0%, blue 100%); -} - -.dark { - --csstools-color-scheme--dark: initial; - color-scheme: dark; -} - -.light { - --csstools-color-scheme--dark: ; - color-scheme: light; -} - -.schemed-colors { - --csstools-light-dark-toggle--1: var(--csstools-color-scheme--dark) rgb(131, 27, 0); - color: var(--csstools-light-dark-toggle--1, magenta); - color: light-dark(rgb(131, 27, 0), magenta); -} - -@media (color-gamut: p3) { -.schemed-colors { - color: light-dark(color(display-p3 0.4939 0.10676 0), magenta); -} -} - -.schemed-prop { - --csstools-light-dark-toggle--0: var(--csstools-color-scheme--dark) cyan; - --theme-color: var(--csstools-light-dark-toggle--0, deepskyblue); -} - -@supports (color: light-dark(red, red)) { -.schemed-prop { - --theme-color: light-dark(cyan, deepskyblue); -} -} - -.schemed-prop * { - --csstools-light-dark-toggle--0: var(--csstools-color-scheme--dark) cyan; - --theme-color: var(--csstools-light-dark-toggle--0, deepskyblue); -} diff --git a/plugin-packs/postcss-preset-env/test/basic.ch88-ff78.no-is-pseudo.expect.css b/plugin-packs/postcss-preset-env/test/basic.ch88-ff78.no-is-pseudo.expect.css deleted file mode 100644 index 6a79d9cd8..000000000 --- a/plugin-packs/postcss-preset-env/test/basic.ch88-ff78.no-is-pseudo.expect.css +++ /dev/null @@ -1,603 +0,0 @@ -:root { - --order: 1; -} - -.test-custom-property-fallbacks { - --firebrick: rgb(179, 35, 35); -} - -.test-custom-properties { - order: var(--order); -} - -.test-image-set-function { - background-image: url(img/test.png); - background-image: -webkit-image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); - background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); - order: 2; -} - -@media (min-resolution: 192dpi) { - -.test-image-set-function { - background-image: url(img/test-2x.png); -} -} - -.test-logical-properties-and-values { - margin-left: 1px; - margin-right: 2px; - order: 3; - padding-top: 4px; - padding-bottom: 4px; -} - -.test-logical-resize { - resize: horizontal; -} - -.test-logical-viewport-units { - width: calc(10vw + 5px); - width: calc(10vi + 5px); -} - -.test-nesting-rules { - order: 4; - - order: 6; -} - -.test-nesting-rules p { - order: 5; - } - -.test-nesting-rules, -#test-is-pseudo { - order: 7; - - order: 9; -} - -.test-nesting-rules + p, #test-is-pseudo + p { - order: 8; - } - -@media (max-width: 30em) { - .test-custom-media-queries { - order: 10; - } -} - -@media (min-width: 480px) and (max-width: 767.98px) { - .test-media-query-ranges { - order: 11; - } -} - -@media (prefers-color-scheme: dark) { - body { - background-color: black; - color: white; - } -} - -h1.test-custom-selectors:not(.does-not-exist), h2.test-custom-selectors:not(.does-not-exist), h3.test-custom-selectors:not(.does-not-exist), h4.test-custom-selectors:not(.does-not-exist), h5.test-custom-selectors:not(.does-not-exist), h6.test-custom-selectors:not(.does-not-exist), .test-custom-selectors.heading-7 { - order:12; -} - -.test-case-insensitive-attributes[frame=hsides i] { - order: 13; -} - -.test-rebeccapurple-color { - color: rebeccapurple; - order: 14; -} - -.test-hexadecimal-alpha-notation { - background-color: #f3f3f3f3; - color: #0003; - order: 15; -} - -.test-color-functional-notation { - color: rgb(70% 13.5% 13.5% / 50%); - order: 16; -} - -.test-lab-function { - background-color: rgb(179, 35, 35); - color: rgba(179, 34, 35, 0.5); - order: 17; -} - -.test-system-ui-font-family { - font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif; - order: 18; -} - -.test-font-variant-property { - font-feature-settings: "smcp"; - font-variant-caps: small-caps; - order: 19; -} - -.test-all-property { - all: initial; - order: 20; -} - -.test-matches-pseudo-class:matches(:first-child, .special) { - order: 21; -} - -.test-not-pseudo-class:not(:first-child):not(.special) { - order: 22; -} - -.test-any-link-pseudo-class:any-link { - order: 23; -} - -[dir="rtl"] .test-dir-pseudo-class { - order: 24; -} - -.test-overflow-wrap-property { - order: 25; - overflow-wrap: break-word; -} - -.test-focus-visible-pseudo-class:focus-visible { - order: 26; -} - -.test-double-position-gradients { - background-image: conic-gradient(yellowgreen 40%, gold 0deg,gold 75%, #f06 0deg); - background-image: conic-gradient(yellowgreen 40%, gold 0deg 75%, #f06 0deg); -} - -.test-blank-pseudo-class:blank { - background-color: yellow; -} - -.test-has-pseudo-class:has(.inner-class) { - background-color: yellow; -} - -.a:focus, .a:hover, .b:focus, .b:hover { - order: 27; -} - -.a.c > .b + .d { - order: 28; -} - -.test-hwb-function { - background-color: rgba(0, 196, 255, 0.5); -} - -.test-opacity-percent { - opacity: 42%; -} - -.clamp-same-unit { - width: clamp(10px, 64px, 80px); -} - -.complex-clamp { - width: clamp(calc(100% - 10px), min(10px, 100%), max(40px, 4em)); -} - -.clamp-different-units { - width: clamp(10%, 2px, 4rem); -} - -.mixed-clamp { - grid-template-columns: clamp(22rem, 40%, 32rem) minmax(0, 1fr); - margin: clamp(1rem, 2%, 3rem) 4vh; -} - -.calc-clamp { - margin: 0 40px 0 calc(-1 * clamp(32px, 16vw, 64px)); -} - -.multiple-calc-clamp { - margin: calc(-1 * clamp(1px, 2vw, 3px)) calc(-1 * clamp(4px, 5vw, 6px)); -} - -.nested-clamp { - font-size: clamp(clamp(1rem, 2vw, 3rem), 4vw, 5rem); -} - -@font-face { - font-family: 'A'; - font-style: normal; - font-weight: 300; - font-display: swap; - src: url(a) format("woff2"); -} - -.block-flow { - display: block; - display: block flow; -} - -.block-flow-root { - display: flow-root; - display: block flow-root; -} - -.inline-flow { - display: inline; - display: inline flow; -} - -.inline-flow-root { - display: inline-block; - display: inline flow-root; -} - -.run-in-flow { - display: run-in; - display: run-in flow; -} - -.list-item-block-flow { - display: list-item; - display: list-item block flow; -} - -.inline-flow-list-item { - display: inline list-item; - display: inline flow list-item; -} - -.block-flex { - display: flex; - display: block flex; -} - -.inline-flex { - display: inline-flex; - display: inline flex; -} - -.block-grid { - display: grid; - display: block grid; -} - -.inline-grid { - display: inline-grid; - display: inline grid; -} - -.inline-ruby { - display: ruby; - display: inline ruby; -} - -.block-table { - display: table; - display: block table; -} - -.inline-table { - display: inline-table; - display: inline table; -} - -.table-cell-flow { - display: table-cell; - display: table-cell flow; -} - -.table-caption-flow { - display: table-caption; - display: table-caption flow; -} - -.ruby-base-flow { - display: ruby-base; - display: ruby-base flow; -} - -.ruby-text-flow { - display: ruby-text; - display: ruby-text flow; -} - -.logical-float { - float: left; -} - -.color-function { - prop-1: rgb(0, 129, 96); - prop-2: 'color(display-p3 0.02472 0.01150 0.00574 / 1)'; - prop-3: rgb(7, 3, 1); - prop-4: rgb(7, 3, 1); - prop-5: color(display-p3 1 1 1 1); -} - -.oklab { - color-1: rgb(73, 71, 69); - color-2: rgb(121, 34, 67); - color-3: rgba(121, 34, 67, 0.5); - color-4: rgb(121, 34, 67); - color-5: rgba(121, 34, 67, 0.5); - color-6: rgb(177, 102, 126); - color-7: oklab(60% 0.1 0 foo); - color-8: rgb(125, 35, 41); - color-9: rgb(198, 93, 7); - color-10: rgb(157, 147, 24); - color-11: rgb(104, 166, 57); - color-12: rgb(98, 172, 239); -} - -.oklch { - color-1: rgb(126, 37, 15); - color-2: rgb(126, 37, 15); - color-3: rgba(126, 37, 15, 0.5); - color-4: rgb(126, 37, 15); - color-5: rgba(126, 37, 15, 0.5); - color-6: rgb(197, 84, 124); - - color-7: rgb(0, 149, 131); - color-8: rgb(0, 149, 131); - color-9: rgb(0, 149, 131); - color-10: rgb(0, 149, 131); - color-11: rgb(0, 149, 131); - - color-12: rgb(188, 101, 59); - color-13: rgb(188, 101, 59); - color-14: rgb(188, 101, 59); - color-15: rgb(188, 101, 59); - color-16: rgb(188, 101, 59); - color-17: oklch(60% 0.1250 0.785398unknown); -} - -@media (color-gamut: p3) { -.oklch { - - color-7: color(display-p3 0.19244 0.58461 0.51559); - color-8: color(display-p3 0.19244 0.58461 0.51559); - color-9: color(display-p3 0.19244 0.58461 0.51559); - color-10: color(display-p3 0.19244 0.58461 0.51559); - color-11: color(display-p3 0.19244 0.58461 0.51559); -} -} - -.ic-unit { - --value-2ic: initial; - text-indent: 2em; - content: var(--value-2ic); - left: var(--non-existing, 2em); - width: calc(8em + 20px); - height: 10px; - margin: 0.5em 1em .2em; - padding: 2 ic; -} - -.unset { - clip: unset; -} - -.mod { - padding: 8px 3px 1px calc(3px + 50%); - transform: rotate(-50deg); - width: 2px; -} - -.rem { - padding: 8px 3px 1px calc(3px + 50%); - transform: rotate(-50deg); -} - -.round { - top: 3px; - right: 3px; - bottom: 3px; - left: 2px; - padding-left: 2px; -} - -.trigonometric { - left: 0.70711; - left: 0.70711; - left: 1; - left: 30deg; - left: 60deg; - left: 84.28941deg; - left: -45deg; - left: 90deg; - left: 135deg; - left: 0.99863; -} - -.trigonometric-ignore-not-a-function { - left: sin; - left: cos; - left: tan; - left: asin; - left: acos; - left: atan; - left: atan2; -} - -.trigonometric-ignore-no-arguments { - left: sin(); - left: cos(); - left: tan(); - left: asin(); - left: acos(); - left: atan(); - left: atan2(); -} - -[data-view-size=m] .view { - background: red; - } - -.nested-calc { - order: calc(1 * calc(8 / 3 + calc(5 * 10))); -} - -.text-decoration-shorthand { - text-decoration: 3px wavy pink overline; -} - -.stage__container { - left: var(--size, 1rem); -} - -:scope { - content: "plain :scope"; -} - -@scope (.foo) { - :scope { - content: ":scope in @scope"; - } -} - -:scope { - @scope (.foo) { - content: ":scope in @scope, but with nesting"; - } -} - -@media (min-aspect-ratio: 177/100) { - /* media query aspect ratio : */ -} - -.color-mix { - color-1: rgba(0, 0, 255, 0.65); - color-2: rgba(0, 0, 255, 0.65); - color-3: rgba(0, 0, 255, 0.65); - color-4: rgba(121, 0, 181, 0.65); - color-5: rgba(148, 0, 122, 0.65); - color-6: rgba(179, 0, 255, 0.65); -} - -@media (color-gamut: p3) { -.color-mix { - color-4: color(display-p3 0.44 0 0.70096 / 0.65); - color-5: color(display-p3 0.54692 0 0.47541 / 0.65); -} -} - -.gradients-interpolation-method { - --background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(245, 140, 170), rgb(238, 146, 202), rgb(227, 155, 230), rgb(210, 166, 253), rgb(188, 179, 255), rgb(164, 192, 255), rgb(137, 206, 255), rgb(111, 218, 255), rgb(93, 229, 255), rgb(94, 237, 237) 100%); - - background-image: radial-gradient(farthest-corner circle at 50% 115%, rgb(255, 71, 0) 0%, rgb(255, 103, 0), rgb(255, 137, 0), rgb(255, 169, 0), rgb(250, 199, 0), rgb(197, 225, 0), rgb(116, 246, 0), rgb(0, 255, 86), rgb(0, 255, 171), rgb(0, 255, 239), rgb(0, 255, 255) 100%); -} - -@media (color-gamut: rec2020) { -.gradients-interpolation-method { - - background-image: radial-gradient(farthest-corner circle at 50% 115%, color(display-p3 1.2198 0.38716 0.16814) 0%, color(display-p3 1.20289 0.47522 -0.3004), color(display-p3 1.15167 0.57912 -0.3946), color(display-p3 1.06645 0.68611 -0.4296), color(display-p3 0.94738 0.78766 -0.4263), color(display-p3 0.79233 0.87807 -0.3707), color(display-p3 0.59026 0.95319 -0.1467), color(display-p3 0.27082 1.00972 0.43521), color(display-p3 -0.3983 1.04501 0.69996), color(display-p3 -0.5392 1.05733 0.93686), color(display-p3 -0.5777 1.04644 1.15396) 100%); - - background-image: radial-gradient(farthest-corner circle at 50% 115% in oklch, oklch(80% .3 34) 0%, oklch(90% .3 200) 100%); -} -} - -@supports (color: color(display-p3 0 0 0%)) { -.gradients-interpolation-method { - --background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(245, 140, 170), rgb(238, 146, 202), rgb(227, 155, 230), rgb(210, 166, 253), rgb(189, 182, 255), rgb(173, 195, 255), rgb(159, 205, 255), rgb(140, 215, 255), rgb(100, 228, 255), rgb(94, 237, 237) 100%); -} - -@media (color-gamut: rec2020) { -.gradients-interpolation-method { - --background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(245, 140, 170), rgb(238, 146, 202), rgb(227, 155, 230), rgb(210, 166, 253), color(display-p3 0.73255 0.7035 1.03328), color(display-p3 0.66377 0.75145 1.06652), color(display-p3 0.59643 0.80011 1.0696), color(display-p3 0.54198 0.8462 1.04382), color(display-p3 0.51578 0.88643 0.99318), rgb(94, 237, 237) 100%); -} -} -} - -@supports (background: linear-gradient(in oklch, red 0%, red 0% 1%, red 2%)) and (color: hsl(0 0% 0% / 0)) { -.gradients-interpolation-method { - --background-image: linear-gradient(in oklch decreasing hue, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%); -} -} - -.test-css-color-5-interop { - color-1: rgb(196, 129, 72); - color-2: color(from rgb(196, 129, 72) a98-rgb r g b / none); - color-3: rgb(234, 133, 82); - color-4: color(from rgb(234, 133, 82) prophoto-rgb r g none); - color-5: rgb(179, 157, 51); - color-6: rgb(179, 35, 35); - color-7: rgb(163, 57, 39); - color-8: rgb(131, 27, 0); - color-9: rgb(126, 37, 0); -} - -@media (color-gamut: p3) { -.test-css-color-5-interop { - color-8: color(display-p3 0.4939 0.10676 0); - color-9: color(display-p3 0.47553 0.14324 0); -} -} - -.test-property-with-var { - --opacity: 1; - color: rgba(87 107 149 / var(--opacity)); -} - -.exponential-functions { - width: 8px; -} - -.out-of-gamut { - --color: rgb(0, 247, 79); -} - -.issue-1244--a { - background-image: -ms-linear-gradient(180deg, red 0%, blue 100%); -} - -.issue-1244--b { - background-image: linear-gradient(180deg, red 0%, blue 100%); -} - -.issue-1244--c { - background-image: linear-gradient(180deg, red 0%, blue 100%); -} - -.dark { - --csstools-color-scheme--dark: initial; - color-scheme: dark; -} - -.light { - --csstools-color-scheme--dark: ; - color-scheme: light; -} - -.schemed-colors { - --csstools-light-dark-toggle--1: var(--csstools-color-scheme--dark) rgb(131, 27, 0); - color: var(--csstools-light-dark-toggle--1, magenta); - color: light-dark(rgb(131, 27, 0), magenta); -} - -@media (color-gamut: p3) { -.schemed-colors { - color: light-dark(color(display-p3 0.4939 0.10676 0), magenta); -} -} - -.schemed-prop { - --csstools-light-dark-toggle--0: var(--csstools-color-scheme--dark) cyan; - --theme-color: var(--csstools-light-dark-toggle--0, deepskyblue); -} - -@supports (color: light-dark(red, red)) { -.schemed-prop { - --theme-color: light-dark(cyan, deepskyblue); -} -} - -.schemed-prop * { - --csstools-light-dark-toggle--0: var(--csstools-color-scheme--dark) cyan; - --theme-color: var(--csstools-light-dark-toggle--0, deepskyblue); -} diff --git a/plugin-packs/postcss-preset-env/test/basic.expect.css b/plugin-packs/postcss-preset-env/test/basic.expect.css index a1c62bf3e..00883a7fd 100644 --- a/plugin-packs/postcss-preset-env/test/basic.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.expect.css @@ -44,25 +44,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } .test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @media (max-width: 30em) { .test-custom-media-queries { order: 10; diff --git a/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css b/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css index 4720f1b79..0c09ff9ea 100644 --- a/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css @@ -42,25 +42,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } .test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @media (max-width: 30em) { .test-custom-media-queries { order: 10; diff --git a/plugin-packs/postcss-preset-env/test/basic.ff66.expect.css b/plugin-packs/postcss-preset-env/test/basic.ff66.expect.css index ea9761526..6f8d06cf8 100644 --- a/plugin-packs/postcss-preset-env/test/basic.ff66.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.ff66.expect.css @@ -41,25 +41,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } .test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @media (max-width: 30em) { .test-custom-media-queries { order: 10; diff --git a/plugin-packs/postcss-preset-env/test/basic.hebrew.all-browsers-have-support.expect.css b/plugin-packs/postcss-preset-env/test/basic.hebrew.all-browsers-have-support.expect.css index ed264d8ec..7ea6bc473 100644 --- a/plugin-packs/postcss-preset-env/test/basic.hebrew.all-browsers-have-support.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.hebrew.all-browsers-have-support.expect.css @@ -32,25 +32,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } :is(.test-nesting-rules,#test-is-pseudo) + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @media (max-width: 30em) { .test-custom-media-queries { order: 10; diff --git a/plugin-packs/postcss-preset-env/test/basic.hebrew.expect.css b/plugin-packs/postcss-preset-env/test/basic.hebrew.expect.css index 596601f5a..81b8bd559 100644 --- a/plugin-packs/postcss-preset-env/test/basic.hebrew.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.hebrew.expect.css @@ -44,25 +44,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } .test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @media (max-width: 30em) { .test-custom-media-queries { order: 10; diff --git a/plugin-packs/postcss-preset-env/test/basic.ie10.expect.css b/plugin-packs/postcss-preset-env/test/basic.ie10.expect.css index b310c6baf..1ddfff84f 100644 --- a/plugin-packs/postcss-preset-env/test/basic.ie10.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.ie10.expect.css @@ -48,10 +48,6 @@ .test-nesting-rules { -ms-flex-order: 4; order: 4; - - -ms-flex-order: 6; - - order: 6; } .test-nesting-rules p { @@ -59,14 +55,17 @@ order: 5; } +.test-nesting-rules { + + -ms-flex-order: 6; + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { -ms-flex-order: 7; order: 7; - - -ms-flex-order: 9; - - order: 9; } .test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { @@ -74,6 +73,14 @@ order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + -ms-flex-order: 9; + + order: 9; +} + @media (max-width: 30em) { .test-custom-media-queries { -ms-flex-order: 10; diff --git a/plugin-packs/postcss-preset-env/test/basic.nesting.noIsPseudoSelector.false.expect.css b/plugin-packs/postcss-preset-env/test/basic.nesting.noIsPseudoSelector.false.expect.css deleted file mode 100644 index 818a9a613..000000000 --- a/plugin-packs/postcss-preset-env/test/basic.nesting.noIsPseudoSelector.false.expect.css +++ /dev/null @@ -1,512 +0,0 @@ -:root { - --order: 1; -} - -.test-custom-property-fallbacks { - --firebrick: lab(40% 56.6 39); -} - -.test-custom-properties { - order: var(--order); -} - -.test-image-set-function { - background-image: -webkit-image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); - background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); - order: 2; -} - -.test-logical-properties-and-values { - margin-inline-start: 1px; - margin-inline-end: 2px; - order: 3; - padding-block: 4px; -} - -.test-logical-resize { - resize: inline; -} - -.test-logical-viewport-units { - width: calc(10vi + 5px); -} - -.test-nesting-rules { - order: 4; - - order: 6; -} - -.test-nesting-rules p { - order: 5; - } - -.test-nesting-rules, -#test-is-pseudo { - order: 7; - - order: 9; -} - -:is(.test-nesting-rules,#test-is-pseudo) + p { - order: 8; - } - -@custom-media --narrow-window (max-width: 30em); - -@media (--narrow-window) { - .test-custom-media-queries { - order: 10; - } -} - -@media (480px <= width < 768px) { - .test-media-query-ranges { - order: 11; - } -} - -@custom-media --dark-mode (prefers-color-scheme: dark); - -@media (--dark-mode) { - body { - background-color: black; - color: white; - } -} - -@custom-selector :--heading h1, h2, h3, h4, h5, h6, .heading-7; - -.test-custom-selectors:--heading { - order:12; -} - -.test-case-insensitive-attributes[frame=hsides i] { - order: 13; -} - -.test-rebeccapurple-color { - color: rebeccapurple; - order: 14; -} - -.test-hexadecimal-alpha-notation { - background-color: #f3f3f3f3; - color: #0003; - order: 15; -} - -.test-color-functional-notation { - color: rgb(70% 13.5% 13.5% / 50%); - order: 16; -} - -.test-lab-function { - background-color: lab(40% 56.6 39); - color: lch(40% 68.8 34.5 / 50%); - order: 17; -} - -.test-system-ui-font-family { - font-family: system-ui; - order: 18; -} - -.test-font-variant-property { - font-variant-caps: small-caps; - order: 19; -} - -.test-all-property { - all: initial; - order: 20; -} - -.test-matches-pseudo-class:matches(:first-child, .special) { - order: 21; -} - -.test-not-pseudo-class:not(:first-child, .special) { - order: 22; -} - -.test-any-link-pseudo-class:-moz-any-link { - order: 23; -} - -.test-any-link-pseudo-class:any-link { - order: 23; -} - -.test-dir-pseudo-class:dir(rtl) { - order: 24; -} - -.test-overflow-wrap-property { - order: 25; - overflow-wrap: break-word; -} - -.test-focus-visible-pseudo-class:focus-visible { - order: 26; -} - -.test-double-position-gradients { - background-image: conic-gradient(yellowgreen 40%, gold 0deg 75%, #f06 0deg); -} - -.test-blank-pseudo-class:blank { - background-color: yellow; -} - -.test-has-pseudo-class:has(.inner-class) { - background-color: yellow; -} - -:is(.a, .b):is(:focus, :hover) { - order: 27; -} - -:is(.a > .b) + :is(.c > .d) { - order: 28; -} - -.test-hwb-function { - background-color: hwb(194 0% 0% / .5); -} - -.test-opacity-percent { - opacity: 42%; -} - -.clamp-same-unit { - width: clamp(10px, 64px, 80px); -} - -.complex-clamp { - width: clamp(calc(100% - 10px), min(10px, 100%), max(40px, 4em)); -} - -.clamp-different-units { - width: clamp(10%, 2px, 4rem); -} - -.mixed-clamp { - grid-template-columns: clamp(22rem, 40%, 32rem) minmax(0, 1fr); - margin: clamp(1rem, 2%, 3rem) 4vh; -} - -.calc-clamp { - margin: 0 40px 0 calc(-1 * clamp(32px, 16vw, 64px)); -} - -.multiple-calc-clamp { - margin: calc(-1 * clamp(1px, 2vw, 3px)) calc(-1 * clamp(4px, 5vw, 6px)); -} - -.nested-clamp { - font-size: clamp(clamp(1rem, 2vw, 3rem), 4vw, 5rem); -} - -@font-face { - font-family: 'A'; - font-style: normal; - font-weight: 300; - font-display: swap; - src: url(a) format(woff2); -} - -.block-flow { - display: block flow; -} - -.block-flow-root { - display: block flow-root; -} - -.inline-flow { - display: inline flow; -} - -.inline-flow-root { - display: inline flow-root; -} - -.run-in-flow { - display: run-in flow; -} - -.list-item-block-flow { - display: list-item block flow; -} - -.inline-flow-list-item { - display: inline flow list-item; -} - -.block-flex { - display: block flex; -} - -.inline-flex { - display: inline flex; -} - -.block-grid { - display: block grid; -} - -.inline-grid { - display: inline grid; -} - -.inline-ruby { - display: inline ruby; -} - -.block-table { - display: block table; -} - -.inline-table { - display: inline table; -} - -.table-cell-flow { - display: table-cell flow; -} - -.table-caption-flow { - display: table-caption flow; -} - -.ruby-base-flow { - display: ruby-base flow; -} - -.ruby-text-flow { - display: ruby-text flow; -} - -.logical-float { - float: inline-start; -} - -.color-function { - prop-1: color(display-p3 0.00000 0.51872 0.36985); - prop-2: 'color(display-p3 0.02472 0.01150 0.00574 / 1)'; - prop-3: color(display-p3 0.02472 0.01150 0.00574 / 1); - prop-4: color(display-p3 0.02472 0.01150 0.00574 / calc(33 / 22)); - prop-5: color(display-p3 1 1 1 1); -} - -.oklab { - color-1: oklab(40% 0.001236 0.0039); - color-2: oklab(40% 0.1236 0.0039 / 1); - color-3: oklab(40% 0.1236 0.0039 / .5); - color-4: oklab(40% 0.1236 0.0039 / 100%); - color-5: oklab(40% 0.1236 0.0039 / 50%); - color-6: oklab(60% 0.1 0); - color-7: oklab(60% 0.1 0 foo); - color-8: oklab(40.101% 0.1147 0.0453); - color-9: oklab(59.686% 0.1009 0.1192); - color-10: oklab(65.125% -0.0320 0.1274); - color-11: oklab(66.016% -0.1084 0.1114); - color-12: oklab(72.322% -0.0465 -0.1150); -} - -.oklch { - color-1: oklch(40% 0.1268735435 34.568626); - color-2: oklch(40% 0.1268735435 34.568626 / 1); - color-3: oklch(40% 0.1268735435 34.568626 / .5); - color-4: oklch(40% 0.1268735435 34.568626 / 100%); - color-5: oklch(40% 0.1268735435 34.568626 / 50%); - color-6: oklch(60% 0.150 0); - - color-7: oklch(60% 0.1250 180); - color-8: oklch(60% 0.1250 180deg); - color-9: oklch(60% 0.1250 0.5turn); - color-10: oklch(60% 0.1250 200grad); - color-11: oklch(60% 0.1250 3.14159rad); - - color-12: oklch(60% 0.1250 45); - color-13: oklch(60% 0.1250 45deg); - color-14: oklch(60% 0.1250 0.125turn); - color-15: oklch(60% 0.1250 50grad); - color-16: oklch(60% 0.1250 0.785398rad); - color-17: oklch(60% 0.1250 0.785398unknown); -} - -.ic-unit { - --value-2ic: initial; - text-indent: 2ic; - content: var(--value-2ic); - left: var(--non-existing, 2ic); - width: calc(8ic + 20px); - height: 10px; - margin: 0.5ic 1ic .2ic; - padding: 2 ic; -} - -.unset { - clip: unset; -} - -.mod { - padding: 8px mod(18px, 5px) 1px calc(mod(15px, 6px) + 50%); - transform: rotate(mod(-140deg, -90deg)); - width: mod(mod(-18px, 5px), 5px); -} - -.rem { - padding: 8px rem(18px, 5px) 1px calc(rem(15px, 6px) + 50%); - transform: rotate(rem(-140deg, -90deg)); -} - -.round { - top: round(2.5px, 1px); - right: round(nearest, 2.5px, 1px); - bottom: round(up, 2.5px, 1px); - left: round(down, 2.5px, 1px); - padding-left: round(to-zero, 2.5px, 1px); -} - -.trigonometric { - left: sin(45deg); - left: cos(45deg); - left: tan(45deg); - left: asin(0.5); - left: acos(0.5); - left: atan(10); - left: atan2(-1, 1); - left: asin(sin(pi / 2)); - left: atan2(infinity, -infinity); - left: sin((1deg * 3) + .25turn); -} - -.trigonometric-ignore-not-a-function { - left: sin; - left: cos; - left: tan; - left: asin; - left: acos; - left: atan; - left: atan2; -} - -.trigonometric-ignore-no-arguments { - left: sin(); - left: cos(); - left: tan(); - left: asin(); - left: acos(); - left: atan(); - left: atan2(); -} - -@custom-selector :--view-m [data-view-size=m]; - -:--view-m .view { - background: red; - } - -.nested-calc { - order: calc(1 * calc(8 / 3 + calc(5 * 10))); -} - -.text-decoration-shorthand { - -webkit-text-decoration: 3px wavy pink overline; - text-decoration: 3px wavy pink overline; -} - -.stage__container { - inset-inline-start: var(--size, 1rem); -} - -:scope { - content: "plain :scope"; -} - -@scope (.foo) { - :scope { - content: ":scope in @scope"; - } -} - -:scope { - @scope (.foo) { - content: ":scope in @scope, but with nesting"; - } -} - -@media (min-aspect-ratio: 1.77) { - /* media query aspect ratio : */ -} - -.color-mix { - color-1: color-mix(in srgb, rgb(255 0 0 / 0), blue 65%); - color-2: color-mix(in lab, rgb(255 0 0 / 0), blue 65%); - color-3: color-mix(in xyz, rgb(255 0 0 / 0), blue 65%); - color-4: color-mix(in oklch, rgb(255 0 0 / 0), blue 65%); - color-5: color-mix(in lch, rgb(255 0 0 / 0), blue 65%); - color-6: color-mix(in hsl, rgb(255 0 0 / 0), blue 65%); -} - -.gradients-interpolation-method { - --background-image: linear-gradient(in oklch decreasing hue, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%); - - background-image: radial-gradient(farthest-corner circle at 50% 115% in oklch, oklch(80% .3 34) 0%, oklch(90% .3 200) 100%); -} - -.test-css-color-5-interop { - color-1: color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb r g b / alpha); - color-2: color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb r g b / none); - color-3: color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb r g b); - color-4: color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb r g none); - color-5: hwb(from hwb(50deg 20% 30%) h w b); - color-6: lab(from lab(40% 56.6 39) l a b); - color-7: lch(from lch(40% 56.6 39) l c h); - color-8: oklab(from oklab(40% 0.566 0.39) l a b); - color-9: oklch(from oklch(40% 0.566 39deg) l c h); -} - -.test-property-with-var { - --opacity: 1; - color: rgba(87 107 149 / var(--opacity)); -} - -.exponential-functions { - width: calc(1px * pow(2, 3)); -} - -.out-of-gamut { - --color: color(display-p3 0 1 0); -} - -.issue-1244--a { - background-image: -ms-linear-gradient(180deg, red 0%, blue 100%); -} - -.issue-1244--b { - background-image: linear-gradient(180deg, red 0%, blue 100%); -} - -.issue-1244--c { - background-image: linear-gradient(180deg, red 0%, blue 100%); -} - -.dark { - color-scheme: dark; -} - -.light { - color-scheme: light; -} - -.schemed-colors { - color: light-dark(lch(from oklab(40% 0.566 0.39) l c h), magenta); -} - -.schemed-prop { - --theme-color: light-dark(cyan, deepskyblue); -} diff --git a/plugin-packs/postcss-preset-env/test/basic.nesting.true.expect.css b/plugin-packs/postcss-preset-env/test/basic.nesting.true.expect.css index 818a9a613..e34f703da 100644 --- a/plugin-packs/postcss-preset-env/test/basic.nesting.true.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.nesting.true.expect.css @@ -33,25 +33,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } :is(.test-nesting-rules,#test-is-pseudo) + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @custom-media --narrow-window (max-width: 30em); @media (--narrow-window) { diff --git a/plugin-packs/postcss-preset-env/test/basic.op_mini.expect.css b/plugin-packs/postcss-preset-env/test/basic.op_mini.expect.css index 6df125ef7..f26253055 100644 --- a/plugin-packs/postcss-preset-env/test/basic.op_mini.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.op_mini.expect.css @@ -43,25 +43,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } .test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @media (max-width: 30em) { .test-custom-media-queries { order: 10; diff --git a/plugin-packs/postcss-preset-env/test/basic.preserve.false.expect.css b/plugin-packs/postcss-preset-env/test/basic.preserve.false.expect.css index 61ebe6bb7..2be1d92fd 100644 --- a/plugin-packs/postcss-preset-env/test/basic.preserve.false.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.preserve.false.expect.css @@ -54,6 +54,16 @@ -webkit-order: 4; -moz-box-ordinal-group: 5; order: 4; +} + +.test-nesting-rules p { + -webkit-box-ordinal-group: 6; + -webkit-order: 5; + -moz-box-ordinal-group: 6; + order: 5; + } + +.test-nesting-rules { -webkit-box-ordinal-group: 7; @@ -64,19 +74,23 @@ order: 6; } -.test-nesting-rules p { - -webkit-box-ordinal-group: 6; - -webkit-order: 5; - -moz-box-ordinal-group: 6; - order: 5; - } - .test-nesting-rules, #test-is-pseudo { -webkit-box-ordinal-group: 8; -webkit-order: 7; -moz-box-ordinal-group: 8; order: 7; +} + +.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { + -webkit-box-ordinal-group: 9; + -webkit-order: 8; + -moz-box-ordinal-group: 9; + order: 8; + } + +.test-nesting-rules, +#test-is-pseudo { -webkit-box-ordinal-group: 10; @@ -87,13 +101,6 @@ order: 9; } -.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { - -webkit-box-ordinal-group: 9; - -webkit-order: 8; - -moz-box-ordinal-group: 9; - order: 8; - } - @media (max-width: 30em) { .test-custom-media-queries { -webkit-box-ordinal-group: 11; diff --git a/plugin-packs/postcss-preset-env/test/basic.preserve.true.expect.css b/plugin-packs/postcss-preset-env/test/basic.preserve.true.expect.css index 464a43cb2..1b6013b03 100644 --- a/plugin-packs/postcss-preset-env/test/basic.preserve.true.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.preserve.true.expect.css @@ -69,6 +69,16 @@ -webkit-order: 4; -moz-box-ordinal-group: 5; order: 4; +} + +.test-nesting-rules p { + -webkit-box-ordinal-group: 6; + -webkit-order: 5; + -moz-box-ordinal-group: 6; + order: 5; + } + +.test-nesting-rules { -webkit-box-ordinal-group: 7; @@ -79,27 +89,12 @@ order: 6; } -.test-nesting-rules p { - -webkit-box-ordinal-group: 6; - -webkit-order: 5; - -moz-box-ordinal-group: 6; - order: 5; - } - .test-nesting-rules, #test-is-pseudo { -webkit-box-ordinal-group: 8; -webkit-order: 7; -moz-box-ordinal-group: 8; order: 7; - - -webkit-box-ordinal-group: 10; - - -webkit-order: 9; - - -moz-box-ordinal-group: 10; - - order: 9; } .test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { @@ -116,6 +111,18 @@ order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + -webkit-box-ordinal-group: 10; + + -webkit-order: 9; + + -moz-box-ordinal-group: 10; + + order: 9; +} + @custom-media --narrow-window (max-width: 30em); @media (max-width: 30em) { diff --git a/plugin-packs/postcss-preset-env/test/basic.safari15.expect.css b/plugin-packs/postcss-preset-env/test/basic.safari15.expect.css index a2e54066a..1509690b8 100644 --- a/plugin-packs/postcss-preset-env/test/basic.safari15.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.safari15.expect.css @@ -33,25 +33,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } :is(.test-nesting-rules,#test-is-pseudo) + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @media (max-width: 30em) { .test-custom-media-queries { order: 10; diff --git a/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css b/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css index 99a0b97e4..4659719e6 100644 --- a/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css @@ -42,25 +42,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } .test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @media (max-width: 30em) { .test-custom-media-queries { order: 10; diff --git a/plugin-packs/postcss-preset-env/test/basic.stage0-ff66.expect.css b/plugin-packs/postcss-preset-env/test/basic.stage0-ff66.expect.css index 0744bedd2..fcae0be42 100644 --- a/plugin-packs/postcss-preset-env/test/basic.stage0-ff66.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.stage0-ff66.expect.css @@ -41,25 +41,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } .test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @media (max-width: 30em) { .test-custom-media-queries { order: 10; diff --git a/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css b/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css index 184c8a052..a148b7f4a 100644 --- a/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css @@ -44,25 +44,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } .test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @media (max-width: 30em) { .test-custom-media-queries { order: 10; diff --git a/plugin-packs/postcss-preset-env/test/basic.supports-query.expect.css b/plugin-packs/postcss-preset-env/test/basic.supports-query.expect.css index 527f16276..1af8722cf 100644 --- a/plugin-packs/postcss-preset-env/test/basic.supports-query.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.supports-query.expect.css @@ -33,25 +33,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } :is(.test-nesting-rules,#test-is-pseudo) + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @media (max-width: 30em) { .test-custom-media-queries { order: 10; diff --git a/plugin-packs/postcss-preset-env/test/basic.vendors-1.expect.css b/plugin-packs/postcss-preset-env/test/basic.vendors-1.expect.css index 74d8b199a..7ba61e2b6 100644 --- a/plugin-packs/postcss-preset-env/test/basic.vendors-1.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.vendors-1.expect.css @@ -44,25 +44,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } .test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @custom-media --narrow-window (max-width: 30em); @media (--narrow-window) { diff --git a/plugin-packs/postcss-preset-env/test/basic.vendors-2.expect.css b/plugin-packs/postcss-preset-env/test/basic.vendors-2.expect.css index 74d8b199a..7ba61e2b6 100644 --- a/plugin-packs/postcss-preset-env/test/basic.vendors-2.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.vendors-2.expect.css @@ -44,25 +44,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } .test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @custom-media --narrow-window (max-width: 30em); @media (--narrow-window) { diff --git a/plugin-packs/postcss-preset-env/test/basic.vendors-3.expect.css b/plugin-packs/postcss-preset-env/test/basic.vendors-3.expect.css index cdf497178..139c3badf 100644 --- a/plugin-packs/postcss-preset-env/test/basic.vendors-3.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.vendors-3.expect.css @@ -44,25 +44,32 @@ .test-nesting-rules { order: 4; - - order: 6; } .test-nesting-rules p { order: 5; } +.test-nesting-rules { + + order: 6; +} + .test-nesting-rules, #test-is-pseudo { order: 7; - - order: 9; } .test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p { order: 8; } +.test-nesting-rules, +#test-is-pseudo { + + order: 9; +} + @custom-media --narrow-window (max-width: 30em); @media (--narrow-window) { diff --git a/plugin-packs/postcss-preset-env/test/layers-basic.expect.css b/plugin-packs/postcss-preset-env/test/layers-basic.expect.css index 3376f9052..7c6a19843 100644 --- a/plugin-packs/postcss-preset-env/test/layers-basic.expect.css +++ b/plugin-packs/postcss-preset-env/test/layers-basic.expect.css @@ -65,12 +65,6 @@ -webkit-order: 4; -moz-box-ordinal-group: 5; order: 4; - - is-layer: C; - -webkit-box-ordinal-group: 7; - -webkit-order: 6; - -moz-box-ordinal-group: 7; - order: 6; } .test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) p { @@ -81,12 +75,32 @@ order: 5; } +.test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) { + + is-layer: C; + -webkit-box-ordinal-group: 7; + -webkit-order: 6; + -moz-box-ordinal-group: 7; + order: 6; + } + .test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#), #test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) { -webkit-box-ordinal-group: 8; -webkit-order: 7; -moz-box-ordinal-group: 8; order: 7; +} + +.test-nesting-rules:not(#does-not-exist):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p,#test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p { + -webkit-box-ordinal-group: 9; + -webkit-order: 8; + -moz-box-ordinal-group: 9; + order: 8; + } + +.test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#), +#test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) { -webkit-box-ordinal-group: 10; @@ -97,13 +111,6 @@ order: 9; } -.test-nesting-rules:not(#does-not-exist):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p,#test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p { - -webkit-box-ordinal-group: 9; - -webkit-order: 8; - -moz-box-ordinal-group: 9; - order: 8; - } - @media (max-width: 500px) { .test-custom-media-queries:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) { -webkit-box-ordinal-group: 11; diff --git a/plugin-packs/postcss-preset-env/test/layers-basic.preserve.true.expect.css b/plugin-packs/postcss-preset-env/test/layers-basic.preserve.true.expect.css index 08692a54b..7b6d929f9 100644 --- a/plugin-packs/postcss-preset-env/test/layers-basic.preserve.true.expect.css +++ b/plugin-packs/postcss-preset-env/test/layers-basic.preserve.true.expect.css @@ -74,12 +74,6 @@ -webkit-order: 4; -moz-box-ordinal-group: 5; order: 4; - - is-layer: C; - -webkit-box-ordinal-group: 7; - -webkit-order: 6; - -moz-box-ordinal-group: 7; - order: 6; } .test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) p { @@ -90,20 +84,21 @@ order: 5; } +.test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) { + + is-layer: C; + -webkit-box-ordinal-group: 7; + -webkit-order: 6; + -moz-box-ordinal-group: 7; + order: 6; + } + .test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#), #test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) { -webkit-box-ordinal-group: 8; -webkit-order: 7; -moz-box-ordinal-group: 8; order: 7; - - -webkit-box-ordinal-group: 10; - - -webkit-order: 9; - - -moz-box-ordinal-group: 10; - - order: 9; } .test-nesting-rules:not(#does-not-exist):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p,#test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p { @@ -120,6 +115,18 @@ order: 8; } +.test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#), +#test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) { + + -webkit-box-ordinal-group: 10; + + -webkit-order: 9; + + -moz-box-ordinal-group: 10; + + order: 9; +} + @custom-media --narrow-window (max-width: 500px); @media (max-width: 500px) { diff --git a/plugins/css-has-pseudo/test/plugin-order-nesting.after.expect.css b/plugins/css-has-pseudo/test/plugin-order-nesting.after.expect.css index ee5b192d5..4226a2ca3 100644 --- a/plugins/css-has-pseudo/test/plugin-order-nesting.after.expect.css +++ b/plugins/css-has-pseudo/test/plugin-order-nesting.after.expect.css @@ -3,10 +3,10 @@ order: 1; } -.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-1q-w-2x-31-2v-15-1m-2u-33-2r-39-37]:not(does-not-exist):not(does-not-exist) { +.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-w-1q-w-2x-31-2v-15-1m-2u-33-2r-39-37]:not(does-not-exist):not(does-not-exist) { order: 2; } -.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-1q-w-2x-31-2v-15-w-1m-2w-2p-37-14-1q-w-1a-37-33-31-2t-15]:not(does-not-exist):not(does-not-exist) { +.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-w-1q-w-2x-31-2v-15-w-1m-2w-2p-37-14-w-1q-w-1a-37-33-31-2t-15]:not(does-not-exist):not(does-not-exist) { order: 3; } diff --git a/plugins/css-has-pseudo/test/plugin-order-nesting.after.preserve.expect.css b/plugins/css-has-pseudo/test/plugin-order-nesting.after.preserve.expect.css index d1e585c5e..c3d9e159d 100644 --- a/plugins/css-has-pseudo/test/plugin-order-nesting.after.preserve.expect.css +++ b/plugins/css-has-pseudo/test/plugin-order-nesting.after.preserve.expect.css @@ -7,18 +7,18 @@ a:has(.b) { order: 1; } -.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-1q-w-2x-31-2v-15-1m-2u-33-2r-39-37]:not(does-not-exist):not(does-not-exist) { +.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-w-1q-w-2x-31-2v-15-1m-2u-33-2r-39-37]:not(does-not-exist):not(does-not-exist) { order: 2; } -a:has(> img):focus { +a:has( > img):focus { order: 2; } -.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-1q-w-2x-31-2v-15-w-1m-2w-2p-37-14-1q-w-1a-37-33-31-2t-15]:not(does-not-exist):not(does-not-exist) { +.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-w-1q-w-2x-31-2v-15-w-1m-2w-2p-37-14-w-1q-w-1a-37-33-31-2t-15]:not(does-not-exist):not(does-not-exist) { order: 3; } -a:has(> img) :has(> .some) { +a:has( > img) :has( > .some) { order: 3; } diff --git a/plugins/css-has-pseudo/test/plugin-order-nesting.before.expect.css b/plugins/css-has-pseudo/test/plugin-order-nesting.before.expect.css index ee5b192d5..4226a2ca3 100644 --- a/plugins/css-has-pseudo/test/plugin-order-nesting.before.expect.css +++ b/plugins/css-has-pseudo/test/plugin-order-nesting.before.expect.css @@ -3,10 +3,10 @@ order: 1; } -.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-1q-w-2x-31-2v-15-1m-2u-33-2r-39-37]:not(does-not-exist):not(does-not-exist) { +.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-w-1q-w-2x-31-2v-15-1m-2u-33-2r-39-37]:not(does-not-exist):not(does-not-exist) { order: 2; } -.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-1q-w-2x-31-2v-15-w-1m-2w-2p-37-14-1q-w-1a-37-33-31-2t-15]:not(does-not-exist):not(does-not-exist) { +.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-w-1q-w-2x-31-2v-15-w-1m-2w-2p-37-14-w-1q-w-1a-37-33-31-2t-15]:not(does-not-exist):not(does-not-exist) { order: 3; } diff --git a/plugins/css-has-pseudo/test/plugin-order-nesting.before.preserve.expect.css b/plugins/css-has-pseudo/test/plugin-order-nesting.before.preserve.expect.css index d1e585c5e..c3d9e159d 100644 --- a/plugins/css-has-pseudo/test/plugin-order-nesting.before.preserve.expect.css +++ b/plugins/css-has-pseudo/test/plugin-order-nesting.before.preserve.expect.css @@ -7,18 +7,18 @@ a:has(.b) { order: 1; } -.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-1q-w-2x-31-2v-15-1m-2u-33-2r-39-37]:not(does-not-exist):not(does-not-exist) { +.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-w-1q-w-2x-31-2v-15-1m-2u-33-2r-39-37]:not(does-not-exist):not(does-not-exist) { order: 2; } -a:has(> img):focus { +a:has( > img):focus { order: 2; } -.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-1q-w-2x-31-2v-15-w-1m-2w-2p-37-14-1q-w-1a-37-33-31-2t-15]:not(does-not-exist):not(does-not-exist) { +.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-w-1q-w-2x-31-2v-15-w-1m-2w-2p-37-14-w-1q-w-1a-37-33-31-2t-15]:not(does-not-exist):not(does-not-exist) { order: 3; } -a:has(> img) :has(> .some) { +a:has( > img) :has( > .some) { order: 3; } diff --git a/plugins/postcss-nesting/CHANGELOG.md b/plugins/postcss-nesting/CHANGELOG.md index 650d5b625..11f04b15a 100644 --- a/plugins/postcss-nesting/CHANGELOG.md +++ b/plugins/postcss-nesting/CHANGELOG.md @@ -2,6 +2,7 @@ ### Unreleased (major) +- Make edition `2024-02` the default. - Updated: Support for Node v18+ (major). ### 12.1.2 diff --git a/plugins/postcss-nesting/README.md b/plugins/postcss-nesting/README.md index e867f5546..e605f27de 100644 --- a/plugins/postcss-nesting/README.md +++ b/plugins/postcss-nesting/README.md @@ -34,13 +34,11 @@ you might want to use [PostCSS Nested] instead. .foo { color: red; - - color: pink; } .foo:hover { color: green; } -.foo > .bar { +.foo > .bar { color: blue; } @media (prefers-color-scheme: dark) { @@ -48,6 +46,10 @@ you might want to use [PostCSS Nested] instead. color: cyan; } } +.foo { + + color: pink; +} ``` ## Usage @@ -80,35 +82,23 @@ instructions for: - [Gulp](INSTALL.md#gulp) - [Grunt](INSTALL.md#grunt) -## ⚠️ `@nest` has been removed from the specification. - -Previous iterations of the [CSS Nesting specification] required using `@nest` for certain selectors. - -`@nest` was removed from the specification completely. -Future versions of this plugin will error if you use `@nest`. +## Options -We advice everyone to migrate their codebase **now** to nested CSS without `@nest`. -We published a [Stylelint Plugin](https://github.com/csstools/postcss-plugins/tree/main/plugins-stylelint/no-at-nest-rule#csstoolsstylelint-no-at-nest-rule) to help you migrate. +### edition -example warning: -> `@nest` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version. -> Change `@nest foo & {}` to `foo & {}` to migrate to the latest standard. +The CSS nesting feature has gone through several iterations and what is currently implemented in browsers is not the same as what was originally proposed. This plugin dates back to the original proposal and you might have written your CSS expecting this older behavior. -You can silence this warning with a new `silenceAtNestWarning` plugin option. +You can pick the older behavior by setting the `edition` option. +The `edition` values correspond with rough dates when of a particular version of the specification: +- `2024-02` (default) +- `2021` -```js -postcssNesting({ - silenceAtNestWarning: true -}) -``` - -## Options +> [!TIP] +> If you wrote nested rules with `@nest` you definitely want to set the `edition` to `2021`. +> If you are unsure than you should try to omit the `edition` option and use the default. -### edition +Eventually we will remove support for the older edition, and this plugin option, so it is strongly advised to update your CSS to the latest edition. -The default behavior is to transpile CSS following an older version of the CSS nesting specification. - -If you want to already use the latest version you can set the `edition` option to `2024-02`. ```js postcssNesting({ @@ -116,13 +106,18 @@ postcssNesting({ }) ``` -#### `2021` (default) +#### `2024-02` (default) + +- usage of `:is()` pseudo-class is no longer optional +- at rules are not combined with the `and` keyword +- `@nest` is removed from the specification +- declarations and nested rules/at-rules are no longer re-ordered + +#### `2021` This version is a continuation of what existed before CSS nesting was implemented in browsers. It made a few non-invasive changes to keep up with implementations but it is falling behind. -In a future version of this plugin this will no longer be the default. - ```pcss .foo { color: red; @@ -162,55 +157,7 @@ In a future version of this plugin this will no longer be the default. } ``` -#### `2024-02` - -- usage of `:is()` pseudo-class is no longer optional -- at rules are not combined with the `and` keyword -- `@nest` is removed from the specification -- declarations and nested rules/at-rules are no longer re-ordered - -```pcss -.foo { - color: red; - - &:hover { - color: green; - } - - > .bar { - color: blue; - } - - @media (prefers-color-scheme: dark) { - color: cyan; - } - - color: pink; -} - -/* becomes */ - -.foo { - color: red; -} -.foo:hover { - color: green; - } -.foo > .bar { - color: blue; - } -@media (prefers-color-scheme: dark) { - .foo { - color: cyan; -} - } -.foo { - - color: pink; -} -``` - -### noIsPseudoSelector +### noIsPseudoSelector (edition: `2021`) #### Specificity diff --git a/plugins/postcss-nesting/dist/index.cjs b/plugins/postcss-nesting/dist/index.cjs index 65e7f45ed..88967964f 100644 --- a/plugins/postcss-nesting/dist/index.cjs +++ b/plugins/postcss-nesting/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("postcss-selector-parser"),t=require("@csstools/selector-specificity"),n=require("@csstools/selector-resolve-nested");const r=e.pseudo({value:":is"});function sortCompoundSelectorsInsideComplexSelector(t){if(!t||!t.nodes)return;const n=[];let o=[];for(let s=0;s"tag"===e.type))){const n=r.clone({}),o=t.nodes[s];o.replaceWith(n),n.append(e.selector({nodes:[o],value:void 0}))}o.push(t.nodes[s])}else n.push(o),n.push([t.nodes[s]]),o=[];n.push(o);const s=[];for(let e=0;e"selector"===e.type&&"selector"===t.type&&e.nodes.length&&t.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t.nodes[0]):"selector"===e.type&&e.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t):"selector"===t.type&&t.nodes.length?selectorTypeOrder(e)-selectorTypeOrder(t.nodes[0]):selectorTypeOrder(e)-selectorTypeOrder(t)));for(let e=0;e=0;e--)s[e].remove(),t.prepend(s[e])}function selectorTypeOrder(t){return e.isPseudoElement(t)?o.pseudoElement:o[t.type]}const o={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function ampersandToScope$1(t,n){let r,o=t.parent;for(;o;){if("rule"===o.type)return;o=o.parent}try{r=e().astSync(t.selector)}catch(e){return void t.warn(n,`Failed to parse selector : "${t.selector}" with message: "${e instanceof Error?e.message:e}"`)}r&&(r.walkNesting((t=>{const n=t.parent;t.replaceWith(e.pseudo({value:":scope"})),n&&sortCompoundSelectorsInsideComplexSelector(n)})),t.selector=r.toString())}function cleanupParent(e){if(!e.nodes.length)return void e.remove();const t=e.nodes.filter((e=>"comment"===e.type));t.length===e.nodes.length&&e.replaceWith(...t)}function groupDeclarations(e){const t=[],n=[];e.each((e=>{if(isDeclarationLike(e,n.length>0))t.push(e);else{if("comment"===e.type){let r=e.next();for(;r&&"comment"===r.type;)r=r.next();if(isDeclarationLike(r,n.length>0))return void t.push(e)}n.push(e)}})),e.removeAll(),t.forEach((t=>{e.append(t)})),n.forEach((t=>{e.append(t)}))}function isDeclarationLike(e,t){return!!e&&("decl"===e.type||"atrule"===e.type&&"mixin"===e.name.toLowerCase()&&!t)}function comma(e){const t=[];let n="",r=!1,o=0,s=!1,i=!1;for(const l of e)i?i=!1:"\\"===l?i=!0:s?l===s&&(s=!1):'"'===l||"'"===l?s=l:"("===l?o+=1:")"===l?o>0&&(o-=1):0===o&&","===l&&(r=!0),r?(""!==n&&t.push(n.trim()),n="",r=!1):n+=l;return t.push(n.trim()),t}function shiftNodesBeforeParent(e,t){const n=t.index(e);if(n){const e=t.cloneBefore().removeAll().append(t.nodes.slice(0,n));e.raws.semicolon=!0,cleanupParent(e)}t.before(e),t.raws.semicolon=!0}var s=["container","document","media","supports","layer","starting-style"];function transformAtruleWithinAtrule(e,t){var n,r;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.params=(n=t.params,r=e.params,comma(n).map((e=>comma(r).map((t=>`${e} and ${t}`)).join(", "))).join(", ")),cleanupParent(t)}function isAtruleWithinAtrule(e,t){return s.includes(e.name)&&e.name===t.name}function atruleWithinRule$1(e,t,n,r,o){if(groupDeclarations(t),shiftNodesBeforeParent(e,t),e.nodes){const s=t.clone().removeAll().append(e.nodes);e.append(s),cleanupParent(t),r(s,n,o)}else cleanupParent(t)}function isAtruleWithinRule$1(e){return s.includes(e.name)}function combinationsWithSizeN(e,t){if(t<2)throw new Error("n must be greater than 1");if(e.length<2)throw new Error("s must be greater than 1");if(Math.pow(e.length,t)>1e4)throw new Error("Too many combinations when trying to resolve a nested selector with lists, reduce the complexity of your selectors");const n=[];for(let e=0;e=0;s--){let t=n[s];if(t>=e.length){if(t=0,n[s]=0,0===s)return r;n[s-1]+=1}o[s]=e[t]}r.push(o),n[n.length-1]++}}function nodesAreEquallySpecific(n){const r=n.map((t=>e().astSync(t))).map((e=>t.selectorSpecificity(e))),o=r[0];for(let e=1;ee().astSync(t))):[e().astSync(`:is(${t.join(",")})`)];const s=[];for(let t=0;t{"nesting"===e.type&&(n=!0)}));const r=t.nodes[0];let o=!1;r.each((e=>"combinator"===e.type&&(o=!0,!1))),n?o&&r.insertBefore(r.at(0),e.nesting({})):(r.insertBefore(r.at(0),e.combinator({value:" "})),r.insertBefore(r.at(0),e.nesting({}))),l=t.toString()}let c=[],a=0;if(e().astSync(l).walkNesting((()=>{a++})),a>1&&o.length>1)c=combinationsWithSizeN(o,a),i=c.length;else{i=o.length;for(let e=0;e{if("nesting"!==o.type)return;let s=c[t][n];n++,"root"===s.type&&1===s.nodes.length&&(s=s.nodes[0]);const i=e().astSync(`:is(${s.toString()})`),l=isSimpleSelector(s.nodes[0]),a=isCompoundSelector(s.nodes[0]),u=isSimpleSelector(o),p=isCompoundSelector(o);if(l&&u)return void o.replaceWith(s.clone());if((l||a)&&(u||p)){const e=o.parent;return l&&"selector"===s.type?o.replaceWith(s.clone().nodes[0]):o.replaceWith(...s.clone().nodes),void(e&&e.nodes.length>1&&sortCompoundSelectorsInsideComplexSelector(e))}if(l){const e=o.parent;return o.replaceWith(s.clone().nodes[0]),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(a){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsNotInsideCompoundSelector(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}const d=o.parent;r.noIsPseudoSelector?o.replaceWith(...s.clone().nodes):o.replaceWith(...i.clone({}).nodes),d&&sortCompoundSelectorsInsideComplexSelector(d)})),s.push(o.toString())}}return s}function isSimpleSelector(e){return"combinator"!==e.type&&!(e.parent&&e.parent.nodes.length>1)}function isCompoundSelector(e,t=null){if(isSimpleSelector(e))return!1;if(!e.parent)return!1;if(!!e.parent.nodes.find((e=>"combinator"===e.type)))return!1;return!(!!e.parent.nodes.find((e=>"nesting"===e.type))&&t&&!isCompoundSelector(t))}function nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(e){if(!e.parent)return!1;if(0!==e.parent.nodes.indexOf(e))return!1;for(let t=1;t"!==e.parent.nodes[t].value)return!1;return!0}function nestingIsNotInsideCompoundSelector(e){if(isSimpleSelector(e))return!0;if(!e.parent)return!1;for(let t=0;te.split("&").length>=2&&-1===e.indexOf("|")))}function transformRuleWithinRule$1(e,t,n,r){let o=[];try{o=mergeSelectors$1(t.selectors,e.selectors,r)}catch(r){return void e.warn(n,`Failed to parse selectors : "${t.selector}" / "${e.selector}" with message: "${r instanceof Error?r.message:r}"`)}if(!o.length)return;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.selectors=o;"rule"===e.type&&"rule"===t.type&&e.selector===t.selector&&e.append(...t.nodes),cleanupParent(t)}function isValidRuleWithinRule$1(e){return e.selectors.every((e=>-1===e.indexOf("|")))}function isAtRule(e){return e&&"atrule"===e.type}function isNestRule(e){return e&&isAtRule(e)&&"nest"===e.name}function isRule(e){return e&&"rule"===e.type}function walk$1(e,t,n){e.each((r=>{const o=r.parent;isNestRule(r)&&!n.silenceAtNestWarning&&e.warn(t,`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.\nChange \`@nest ${r.params} {}\` to \`${r.params} {}\` to migrate to the latest standard.`),isRule(r)&&isRule(o)&&isValidRuleWithinRule$1(r)?transformRuleWithinRule$1(r,o,t,n):isNestRule(r)&&isRule(o)&&isValidNestRuleWithinRule(r)?transformNestRuleWithinRule(r,o,t,walk$1,n):isAtRule(r)&&isRule(o)&&isAtruleWithinRule$1(r)?atruleWithinRule$1(r,o,t,walk$1,n):isAtRule(r)&&isAtRule(o)&&isAtruleWithinAtrule(r,o)&&transformAtruleWithinAtrule(r,o),"nodes"in r&&r.nodes.length&&walk$1(r,t,n)}))}const creator$2=e=>{const t=Object.assign({noIsPseudoSelector:!1,silenceAtNestWarning:!1},e);return{postcssPlugin:"postcss-nesting",Rule(e,{result:n}){walk$1(e,n,t),e.selector.includes("&")&&ersandToScope$1(e,n)}}};function ampersandToScope(t,n){let r,o=t.parent;for(;o;){if("rule"===o.type)return;o=o.parent}try{r=e().astSync(t.selector)}catch(e){return void t.warn(n,`Failed to parse selector : "${t.selector}" with message: "${e instanceof Error?e.message:e}"`)}r&&(r.walkNesting((t=>{t.replaceWith(e.pseudo({value:":scope"}))})),t.selector=r.toString())}function atruleWithinRule(e,t,n,r){if(shiftNodesBeforeParent(e,t),e.nodes){const o=t.clone().removeAll().append(e.nodes);e.append(o),cleanupParent(t),r(o,n)}else cleanupParent(t)}function isAtruleWithinRule(e){return s.includes(e.name)}creator$2.postcss=!0;const i=e();function mergeSelectors(e,t,r,o){let s;try{s=n.resolveNestedSelector(i.astSync(t),i.astSync(r))}catch(n){return e.warn(o,`Failed to parse selectors : "${r}" / "${t}" with message: "${n instanceof Error?n.message:n}"`),!1}return!!s&&s.toString()}function transformRuleWithinRule(e,t,n){const r=mergeSelectors(e,e.selector,t.selector,n);if(!r)return;shiftNodesBeforeParent(e,t),e.selector=r;"rule"===e.type&&"rule"===t.type&&e.selector===t.selector&&e.append(...t.nodes),cleanupParent(t)}function isValidRuleWithinRule(e){return e.selectors.every((e=>-1===e.indexOf("|")))}function walk(e,t){e.each((e=>{const n=e.parent;isRule(e)&&isRule(n)&&isValidRuleWithinRule(e)?transformRuleWithinRule(e,n,t):isAtRule(e)&&isRule(n)&&isAtruleWithinRule(e)&&atruleWithinRule(e,n,t,walk),"nodes"in e&&e.nodes.length&&walk(e,t)}))}const creator$1=()=>({postcssPlugin:"postcss-nesting",Rule(e,{result:t}){walk(e,t),e.selector.includes("&")&&ersandToScope(e,t)},AtRule:{nest(e){throw e.error(`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.\nChange \`@nest ${e.params} {}\` to \`${e.params} {}\` to migrate to the latest standard.`)}}});creator$1.postcss=!0;const creator=e=>{const t=Object.assign({edition:"2021"},e);switch(t.edition){case"2021":return creator$2(e);case"2024-02":return creator$1();default:throw new Error(`Invalid edition: ${t.edition}`)}};creator.postcss=!0,module.exports=creator; +"use strict";var e=require("postcss-selector-parser"),t=require("@csstools/selector-specificity"),n=require("@csstools/selector-resolve-nested");const r=e.pseudo({value:":is"});function sortCompoundSelectorsInsideComplexSelector(t){if(!t||!t.nodes)return;const n=[];let o=[];for(let s=0;s"tag"===e.type))){const n=r.clone({}),o=t.nodes[s];o.replaceWith(n),n.append(e.selector({nodes:[o],value:void 0}))}o.push(t.nodes[s])}else n.push(o),n.push([t.nodes[s]]),o=[];n.push(o);const s=[];for(let e=0;e"selector"===e.type&&"selector"===t.type&&e.nodes.length&&t.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t.nodes[0]):"selector"===e.type&&e.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t):"selector"===t.type&&t.nodes.length?selectorTypeOrder(e)-selectorTypeOrder(t.nodes[0]):selectorTypeOrder(e)-selectorTypeOrder(t)));for(let e=0;e=0;e--)s[e].remove(),t.prepend(s[e])}function selectorTypeOrder(t){return e.isPseudoElement(t)?o.pseudoElement:o[t.type]}const o={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function ampersandToScope$1(t,n){let r,o=t.parent;for(;o;){if("rule"===o.type)return;o=o.parent}try{r=e().astSync(t.selector)}catch(e){return void t.warn(n,`Failed to parse selector : "${t.selector}" with message: "${e instanceof Error?e.message:e}"`)}r&&(r.walkNesting((t=>{const n=t.parent;t.replaceWith(e.pseudo({value:":scope"})),n&&sortCompoundSelectorsInsideComplexSelector(n)})),t.selector=r.toString())}function cleanupParent(e){if(!e.nodes.length)return void e.remove();const t=e.nodes.filter((e=>"comment"===e.type));t.length===e.nodes.length&&e.replaceWith(...t)}function groupDeclarations(e){const t=[],n=[];e.each((e=>{if(isDeclarationLike(e,n.length>0))t.push(e);else{if("comment"===e.type){let r=e.next();for(;r&&"comment"===r.type;)r=r.next();if(isDeclarationLike(r,n.length>0))return void t.push(e)}n.push(e)}})),e.removeAll(),t.forEach((t=>{e.append(t)})),n.forEach((t=>{e.append(t)}))}function isDeclarationLike(e,t){return!!e&&("decl"===e.type||"atrule"===e.type&&"mixin"===e.name.toLowerCase()&&!t)}function comma(e){const t=[];let n="",r=!1,o=0,s=!1,i=!1;for(const l of e)i?i=!1:"\\"===l?i=!0:s?l===s&&(s=!1):'"'===l||"'"===l?s=l:"("===l?o+=1:")"===l?o>0&&(o-=1):0===o&&","===l&&(r=!0),r?(""!==n&&t.push(n.trim()),n="",r=!1):n+=l;return t.push(n.trim()),t}function shiftNodesBeforeParent(e,t){const n=t.index(e);if(n){const e=t.cloneBefore().removeAll().append(t.nodes.slice(0,n));e.raws.semicolon=!0,cleanupParent(e)}t.before(e),t.raws.semicolon=!0}var s=["container","document","media","supports","layer","starting-style"];function transformAtruleWithinAtrule(e,t){var n,r;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.params=(n=t.params,r=e.params,comma(n).map((e=>comma(r).map((t=>`${e} and ${t}`)).join(", "))).join(", ")),cleanupParent(t)}function isAtruleWithinAtrule(e,t){return s.includes(e.name)&&e.name===t.name}function atruleWithinRule$1(e,t,n,r,o){if(groupDeclarations(t),shiftNodesBeforeParent(e,t),e.nodes){const s=t.clone().removeAll().append(e.nodes);e.append(s),cleanupParent(t),r(s,n,o)}else cleanupParent(t)}function isAtruleWithinRule$1(e){return s.includes(e.name)}function combinationsWithSizeN(e,t){if(t<2)throw new Error("n must be greater than 1");if(e.length<2)throw new Error("s must be greater than 1");if(Math.pow(e.length,t)>1e4)throw new Error("Too many combinations when trying to resolve a nested selector with lists, reduce the complexity of your selectors");const n=[];for(let e=0;e=0;s--){let t=n[s];if(t>=e.length){if(t=0,n[s]=0,0===s)return r;n[s-1]+=1}o[s]=e[t]}r.push(o),n[n.length-1]++}}function nodesAreEquallySpecific(n){const r=n.map((t=>e().astSync(t))).map((e=>t.selectorSpecificity(e))),o=r[0];for(let e=1;ee().astSync(t))):[e().astSync(`:is(${t.join(",")})`)];const s=[];for(let t=0;t{"nesting"===e.type&&(n=!0)}));const r=t.nodes[0];let o=!1;r.each((e=>"combinator"===e.type&&(o=!0,!1))),n?o&&r.insertBefore(r.at(0),e.nesting({})):(r.insertBefore(r.at(0),e.combinator({value:" "})),r.insertBefore(r.at(0),e.nesting({}))),l=t.toString()}let c=[],a=0;if(e().astSync(l).walkNesting((()=>{a++})),a>1&&o.length>1)c=combinationsWithSizeN(o,a),i=c.length;else{i=o.length;for(let e=0;e{if("nesting"!==o.type)return;let s=c[t][n];n++,"root"===s.type&&1===s.nodes.length&&(s=s.nodes[0]);const i=e().astSync(`:is(${s.toString()})`),l=isSimpleSelector(s.nodes[0]),a=isCompoundSelector(s.nodes[0]),u=isSimpleSelector(o),p=isCompoundSelector(o);if(l&&u)return void o.replaceWith(s.clone());if((l||a)&&(u||p)){const e=o.parent;return l&&"selector"===s.type?o.replaceWith(s.clone().nodes[0]):o.replaceWith(...s.clone().nodes),void(e&&e.nodes.length>1&&sortCompoundSelectorsInsideComplexSelector(e))}if(l){const e=o.parent;return o.replaceWith(s.clone().nodes[0]),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(a){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsNotInsideCompoundSelector(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}const d=o.parent;r.noIsPseudoSelector?o.replaceWith(...s.clone().nodes):o.replaceWith(...i.clone({}).nodes),d&&sortCompoundSelectorsInsideComplexSelector(d)})),s.push(o.toString())}}return s}function isSimpleSelector(e){return"combinator"!==e.type&&!(e.parent&&e.parent.nodes.length>1)}function isCompoundSelector(e,t=null){if(isSimpleSelector(e))return!1;if(!e.parent)return!1;if(!!e.parent.nodes.find((e=>"combinator"===e.type)))return!1;return!(!!e.parent.nodes.find((e=>"nesting"===e.type))&&t&&!isCompoundSelector(t))}function nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(e){if(!e.parent)return!1;if(0!==e.parent.nodes.indexOf(e))return!1;for(let t=1;t"!==e.parent.nodes[t].value)return!1;return!0}function nestingIsNotInsideCompoundSelector(e){if(isSimpleSelector(e))return!0;if(!e.parent)return!1;for(let t=0;te.split("&").length>=2&&-1===e.indexOf("|")))}function transformRuleWithinRule$1(e,t,n,r){let o=[];try{o=mergeSelectors$1(t.selectors,e.selectors,r)}catch(r){return void e.warn(n,`Failed to parse selectors : "${t.selector}" / "${e.selector}" with message: "${r instanceof Error?r.message:r}"`)}if(!o.length)return;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.selectors=o;"rule"===e.type&&"rule"===t.type&&e.selector===t.selector&&e.append(...t.nodes),cleanupParent(t)}function isValidRuleWithinRule$1(e){return e.selectors.every((e=>-1===e.indexOf("|")))}function isAtRule(e){return e&&"atrule"===e.type}function isNestRule(e){return e&&isAtRule(e)&&"nest"===e.name}function isRule(e){return e&&"rule"===e.type}function walk$1(e,t,n){e.each((r=>{const o=r.parent;isNestRule(r)&&!n.silenceAtNestWarning&&e.warn(t,`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.\nChange \`@nest ${r.params} {}\` to \`${r.params} {}\` to migrate to the latest standard.`),isRule(r)&&isRule(o)&&isValidRuleWithinRule$1(r)?transformRuleWithinRule$1(r,o,t,n):isNestRule(r)&&isRule(o)&&isValidNestRuleWithinRule(r)?transformNestRuleWithinRule(r,o,t,walk$1,n):isAtRule(r)&&isRule(o)&&isAtruleWithinRule$1(r)?atruleWithinRule$1(r,o,t,walk$1,n):isAtRule(r)&&isAtRule(o)&&isAtruleWithinAtrule(r,o)&&transformAtruleWithinAtrule(r,o),"nodes"in r&&r.nodes.length&&walk$1(r,t,n)}))}const creator$2=e=>{const t=Object.assign({noIsPseudoSelector:!1,silenceAtNestWarning:!1},e);return{postcssPlugin:"postcss-nesting",Rule(e,{result:n}){walk$1(e,n,t),e.selector.includes("&")&&ersandToScope$1(e,n)}}};function ampersandToScope(t,n){let r,o=t.parent;for(;o;){if("rule"===o.type)return;o=o.parent}try{r=e().astSync(t.selector)}catch(e){return void t.warn(n,`Failed to parse selector : "${t.selector}" with message: "${e instanceof Error?e.message:e}"`)}r&&(r.walkNesting((t=>{t.replaceWith(e.pseudo({value:":scope"}))})),t.selector=r.toString())}function atruleWithinRule(e,t,n,r){if(shiftNodesBeforeParent(e,t),e.nodes){const o=t.clone().removeAll().append(e.nodes);e.append(o),cleanupParent(t),r(o,n)}else cleanupParent(t)}function isAtruleWithinRule(e){return s.includes(e.name)}creator$2.postcss=!0;const i=e();function mergeSelectors(e,t,r,o){let s;try{s=n.resolveNestedSelector(i.astSync(t),i.astSync(r))}catch(n){return e.warn(o,`Failed to parse selectors : "${r}" / "${t}" with message: "${n instanceof Error?n.message:n}"`),!1}return!!s&&s.toString()}function transformRuleWithinRule(e,t,n){const r=mergeSelectors(e,e.selector,t.selector,n);if(!r)return;shiftNodesBeforeParent(e,t),e.selector=r;"rule"===e.type&&"rule"===t.type&&e.selector===t.selector&&e.append(...t.nodes),cleanupParent(t)}function isValidRuleWithinRule(e){return e.selectors.every((e=>-1===e.indexOf("|")))}function walk(e,t){e.each((e=>{const n=e.parent;isRule(e)&&isRule(n)&&isValidRuleWithinRule(e)?transformRuleWithinRule(e,n,t):isAtRule(e)&&isRule(n)&&isAtruleWithinRule(e)&&atruleWithinRule(e,n,t,walk),"nodes"in e&&e.nodes.length&&walk(e,t)}))}const creator$1=()=>({postcssPlugin:"postcss-nesting",Rule(e,{result:t}){walk(e,t),e.selector.includes("&")&&ersandToScope(e,t)},AtRule:{nest(e){throw e.error(`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.\nChange \`@nest ${e.params} {}\` to \`${e.params} {}\` to migrate to the latest standard.`)}}});creator$1.postcss=!0;const creator=e=>{const t=Object.assign({edition:"2024-02"},e);switch(t.edition){case"2021":return creator$2(e);case"2024-02":return creator$1();default:throw new Error(`Invalid edition: ${t.edition}`)}};creator.postcss=!0,module.exports=creator; diff --git a/plugins/postcss-nesting/dist/index.d.ts b/plugins/postcss-nesting/dist/index.d.ts index 0ce7888d8..356c13de6 100644 --- a/plugins/postcss-nesting/dist/index.d.ts +++ b/plugins/postcss-nesting/dist/index.d.ts @@ -5,7 +5,7 @@ export default creator; /** postcss-nesting plugin options */ export declare type pluginOptions = { - /** The implementation edition for CSS Nesting, default to '2021' */ + /** The implementation edition for CSS Nesting, default to '2024-02' */ edition?: '2021' | '2024-02'; } & pluginOptions2021 & pluginOptions2024_02; diff --git a/plugins/postcss-nesting/dist/index.mjs b/plugins/postcss-nesting/dist/index.mjs index 20214719d..aa9883992 100644 --- a/plugins/postcss-nesting/dist/index.mjs +++ b/plugins/postcss-nesting/dist/index.mjs @@ -1 +1 @@ -import e from"postcss-selector-parser";import{selectorSpecificity as t}from"@csstools/selector-specificity";import{resolveNestedSelector as n}from"@csstools/selector-resolve-nested";const r=e.pseudo({value:":is"});function sortCompoundSelectorsInsideComplexSelector(t){if(!t||!t.nodes)return;const n=[];let o=[];for(let s=0;s"tag"===e.type))){const n=r.clone({}),o=t.nodes[s];o.replaceWith(n),n.append(e.selector({nodes:[o],value:void 0}))}o.push(t.nodes[s])}else n.push(o),n.push([t.nodes[s]]),o=[];n.push(o);const s=[];for(let e=0;e"selector"===e.type&&"selector"===t.type&&e.nodes.length&&t.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t.nodes[0]):"selector"===e.type&&e.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t):"selector"===t.type&&t.nodes.length?selectorTypeOrder(e)-selectorTypeOrder(t.nodes[0]):selectorTypeOrder(e)-selectorTypeOrder(t)));for(let e=0;e=0;e--)s[e].remove(),t.prepend(s[e])}function selectorTypeOrder(t){return e.isPseudoElement(t)?o.pseudoElement:o[t.type]}const o={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function ampersandToScope$1(t,n){let r,o=t.parent;for(;o;){if("rule"===o.type)return;o=o.parent}try{r=e().astSync(t.selector)}catch(e){return void t.warn(n,`Failed to parse selector : "${t.selector}" with message: "${e instanceof Error?e.message:e}"`)}r&&(r.walkNesting((t=>{const n=t.parent;t.replaceWith(e.pseudo({value:":scope"})),n&&sortCompoundSelectorsInsideComplexSelector(n)})),t.selector=r.toString())}function cleanupParent(e){if(!e.nodes.length)return void e.remove();const t=e.nodes.filter((e=>"comment"===e.type));t.length===e.nodes.length&&e.replaceWith(...t)}function groupDeclarations(e){const t=[],n=[];e.each((e=>{if(isDeclarationLike(e,n.length>0))t.push(e);else{if("comment"===e.type){let r=e.next();for(;r&&"comment"===r.type;)r=r.next();if(isDeclarationLike(r,n.length>0))return void t.push(e)}n.push(e)}})),e.removeAll(),t.forEach((t=>{e.append(t)})),n.forEach((t=>{e.append(t)}))}function isDeclarationLike(e,t){return!!e&&("decl"===e.type||"atrule"===e.type&&"mixin"===e.name.toLowerCase()&&!t)}function comma(e){const t=[];let n="",r=!1,o=0,s=!1,i=!1;for(const l of e)i?i=!1:"\\"===l?i=!0:s?l===s&&(s=!1):'"'===l||"'"===l?s=l:"("===l?o+=1:")"===l?o>0&&(o-=1):0===o&&","===l&&(r=!0),r?(""!==n&&t.push(n.trim()),n="",r=!1):n+=l;return t.push(n.trim()),t}function shiftNodesBeforeParent(e,t){const n=t.index(e);if(n){const e=t.cloneBefore().removeAll().append(t.nodes.slice(0,n));e.raws.semicolon=!0,cleanupParent(e)}t.before(e),t.raws.semicolon=!0}var s=["container","document","media","supports","layer","starting-style"];function transformAtruleWithinAtrule(e,t){var n,r;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.params=(n=t.params,r=e.params,comma(n).map((e=>comma(r).map((t=>`${e} and ${t}`)).join(", "))).join(", ")),cleanupParent(t)}function isAtruleWithinAtrule(e,t){return s.includes(e.name)&&e.name===t.name}function atruleWithinRule$1(e,t,n,r,o){if(groupDeclarations(t),shiftNodesBeforeParent(e,t),e.nodes){const s=t.clone().removeAll().append(e.nodes);e.append(s),cleanupParent(t),r(s,n,o)}else cleanupParent(t)}function isAtruleWithinRule$1(e){return s.includes(e.name)}function combinationsWithSizeN(e,t){if(t<2)throw new Error("n must be greater than 1");if(e.length<2)throw new Error("s must be greater than 1");if(Math.pow(e.length,t)>1e4)throw new Error("Too many combinations when trying to resolve a nested selector with lists, reduce the complexity of your selectors");const n=[];for(let e=0;e=0;s--){let t=n[s];if(t>=e.length){if(t=0,n[s]=0,0===s)return r;n[s-1]+=1}o[s]=e[t]}r.push(o),n[n.length-1]++}}function nodesAreEquallySpecific(n){const r=n.map((t=>e().astSync(t))).map((e=>t(e))),o=r[0];for(let e=1;ee().astSync(t))):[e().astSync(`:is(${t.join(",")})`)];const s=[];for(let t=0;t{"nesting"===e.type&&(n=!0)}));const r=t.nodes[0];let o=!1;r.each((e=>"combinator"===e.type&&(o=!0,!1))),n?o&&r.insertBefore(r.at(0),e.nesting({})):(r.insertBefore(r.at(0),e.combinator({value:" "})),r.insertBefore(r.at(0),e.nesting({}))),l=t.toString()}let a=[],c=0;if(e().astSync(l).walkNesting((()=>{c++})),c>1&&o.length>1)a=combinationsWithSizeN(o,c),i=a.length;else{i=o.length;for(let e=0;e{if("nesting"!==o.type)return;let s=a[t][n];n++,"root"===s.type&&1===s.nodes.length&&(s=s.nodes[0]);const i=e().astSync(`:is(${s.toString()})`),l=isSimpleSelector(s.nodes[0]),c=isCompoundSelector(s.nodes[0]),u=isSimpleSelector(o),p=isCompoundSelector(o);if(l&&u)return void o.replaceWith(s.clone());if((l||c)&&(u||p)){const e=o.parent;return l&&"selector"===s.type?o.replaceWith(s.clone().nodes[0]):o.replaceWith(...s.clone().nodes),void(e&&e.nodes.length>1&&sortCompoundSelectorsInsideComplexSelector(e))}if(l){const e=o.parent;return o.replaceWith(s.clone().nodes[0]),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(c){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsNotInsideCompoundSelector(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}const d=o.parent;r.noIsPseudoSelector?o.replaceWith(...s.clone().nodes):o.replaceWith(...i.clone({}).nodes),d&&sortCompoundSelectorsInsideComplexSelector(d)})),s.push(o.toString())}}return s}function isSimpleSelector(e){return"combinator"!==e.type&&!(e.parent&&e.parent.nodes.length>1)}function isCompoundSelector(e,t=null){if(isSimpleSelector(e))return!1;if(!e.parent)return!1;if(!!e.parent.nodes.find((e=>"combinator"===e.type)))return!1;return!(!!e.parent.nodes.find((e=>"nesting"===e.type))&&t&&!isCompoundSelector(t))}function nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(e){if(!e.parent)return!1;if(0!==e.parent.nodes.indexOf(e))return!1;for(let t=1;t"!==e.parent.nodes[t].value)return!1;return!0}function nestingIsNotInsideCompoundSelector(e){if(isSimpleSelector(e))return!0;if(!e.parent)return!1;for(let t=0;te.split("&").length>=2&&-1===e.indexOf("|")))}function transformRuleWithinRule$1(e,t,n,r){let o=[];try{o=mergeSelectors$1(t.selectors,e.selectors,r)}catch(r){return void e.warn(n,`Failed to parse selectors : "${t.selector}" / "${e.selector}" with message: "${r instanceof Error?r.message:r}"`)}if(!o.length)return;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.selectors=o;"rule"===e.type&&"rule"===t.type&&e.selector===t.selector&&e.append(...t.nodes),cleanupParent(t)}function isValidRuleWithinRule$1(e){return e.selectors.every((e=>-1===e.indexOf("|")))}function isAtRule(e){return e&&"atrule"===e.type}function isNestRule(e){return e&&isAtRule(e)&&"nest"===e.name}function isRule(e){return e&&"rule"===e.type}function walk$1(e,t,n){e.each((r=>{const o=r.parent;isNestRule(r)&&!n.silenceAtNestWarning&&e.warn(t,`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.\nChange \`@nest ${r.params} {}\` to \`${r.params} {}\` to migrate to the latest standard.`),isRule(r)&&isRule(o)&&isValidRuleWithinRule$1(r)?transformRuleWithinRule$1(r,o,t,n):isNestRule(r)&&isRule(o)&&isValidNestRuleWithinRule(r)?transformNestRuleWithinRule(r,o,t,walk$1,n):isAtRule(r)&&isRule(o)&&isAtruleWithinRule$1(r)?atruleWithinRule$1(r,o,t,walk$1,n):isAtRule(r)&&isAtRule(o)&&isAtruleWithinAtrule(r,o)&&transformAtruleWithinAtrule(r,o),"nodes"in r&&r.nodes.length&&walk$1(r,t,n)}))}const creator$2=e=>{const t=Object.assign({noIsPseudoSelector:!1,silenceAtNestWarning:!1},e);return{postcssPlugin:"postcss-nesting",Rule(e,{result:n}){walk$1(e,n,t),e.selector.includes("&")&&ersandToScope$1(e,n)}}};function ampersandToScope(t,n){let r,o=t.parent;for(;o;){if("rule"===o.type)return;o=o.parent}try{r=e().astSync(t.selector)}catch(e){return void t.warn(n,`Failed to parse selector : "${t.selector}" with message: "${e instanceof Error?e.message:e}"`)}r&&(r.walkNesting((t=>{t.replaceWith(e.pseudo({value:":scope"}))})),t.selector=r.toString())}function atruleWithinRule(e,t,n,r){if(shiftNodesBeforeParent(e,t),e.nodes){const o=t.clone().removeAll().append(e.nodes);e.append(o),cleanupParent(t),r(o,n)}else cleanupParent(t)}function isAtruleWithinRule(e){return s.includes(e.name)}creator$2.postcss=!0;const i=e();function mergeSelectors(e,t,r,o){let s;try{s=n(i.astSync(t),i.astSync(r))}catch(n){return e.warn(o,`Failed to parse selectors : "${r}" / "${t}" with message: "${n instanceof Error?n.message:n}"`),!1}return!!s&&s.toString()}function transformRuleWithinRule(e,t,n){const r=mergeSelectors(e,e.selector,t.selector,n);if(!r)return;shiftNodesBeforeParent(e,t),e.selector=r;"rule"===e.type&&"rule"===t.type&&e.selector===t.selector&&e.append(...t.nodes),cleanupParent(t)}function isValidRuleWithinRule(e){return e.selectors.every((e=>-1===e.indexOf("|")))}function walk(e,t){e.each((e=>{const n=e.parent;isRule(e)&&isRule(n)&&isValidRuleWithinRule(e)?transformRuleWithinRule(e,n,t):isAtRule(e)&&isRule(n)&&isAtruleWithinRule(e)&&atruleWithinRule(e,n,t,walk),"nodes"in e&&e.nodes.length&&walk(e,t)}))}const creator$1=()=>({postcssPlugin:"postcss-nesting",Rule(e,{result:t}){walk(e,t),e.selector.includes("&")&&ersandToScope(e,t)},AtRule:{nest(e){throw e.error(`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.\nChange \`@nest ${e.params} {}\` to \`${e.params} {}\` to migrate to the latest standard.`)}}});creator$1.postcss=!0;const creator=e=>{const t=Object.assign({edition:"2021"},e);switch(t.edition){case"2021":return creator$2(e);case"2024-02":return creator$1();default:throw new Error(`Invalid edition: ${t.edition}`)}};creator.postcss=!0;export{creator as default}; +import e from"postcss-selector-parser";import{selectorSpecificity as t}from"@csstools/selector-specificity";import{resolveNestedSelector as n}from"@csstools/selector-resolve-nested";const r=e.pseudo({value:":is"});function sortCompoundSelectorsInsideComplexSelector(t){if(!t||!t.nodes)return;const n=[];let o=[];for(let s=0;s"tag"===e.type))){const n=r.clone({}),o=t.nodes[s];o.replaceWith(n),n.append(e.selector({nodes:[o],value:void 0}))}o.push(t.nodes[s])}else n.push(o),n.push([t.nodes[s]]),o=[];n.push(o);const s=[];for(let e=0;e"selector"===e.type&&"selector"===t.type&&e.nodes.length&&t.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t.nodes[0]):"selector"===e.type&&e.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t):"selector"===t.type&&t.nodes.length?selectorTypeOrder(e)-selectorTypeOrder(t.nodes[0]):selectorTypeOrder(e)-selectorTypeOrder(t)));for(let e=0;e=0;e--)s[e].remove(),t.prepend(s[e])}function selectorTypeOrder(t){return e.isPseudoElement(t)?o.pseudoElement:o[t.type]}const o={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function ampersandToScope$1(t,n){let r,o=t.parent;for(;o;){if("rule"===o.type)return;o=o.parent}try{r=e().astSync(t.selector)}catch(e){return void t.warn(n,`Failed to parse selector : "${t.selector}" with message: "${e instanceof Error?e.message:e}"`)}r&&(r.walkNesting((t=>{const n=t.parent;t.replaceWith(e.pseudo({value:":scope"})),n&&sortCompoundSelectorsInsideComplexSelector(n)})),t.selector=r.toString())}function cleanupParent(e){if(!e.nodes.length)return void e.remove();const t=e.nodes.filter((e=>"comment"===e.type));t.length===e.nodes.length&&e.replaceWith(...t)}function groupDeclarations(e){const t=[],n=[];e.each((e=>{if(isDeclarationLike(e,n.length>0))t.push(e);else{if("comment"===e.type){let r=e.next();for(;r&&"comment"===r.type;)r=r.next();if(isDeclarationLike(r,n.length>0))return void t.push(e)}n.push(e)}})),e.removeAll(),t.forEach((t=>{e.append(t)})),n.forEach((t=>{e.append(t)}))}function isDeclarationLike(e,t){return!!e&&("decl"===e.type||"atrule"===e.type&&"mixin"===e.name.toLowerCase()&&!t)}function comma(e){const t=[];let n="",r=!1,o=0,s=!1,i=!1;for(const l of e)i?i=!1:"\\"===l?i=!0:s?l===s&&(s=!1):'"'===l||"'"===l?s=l:"("===l?o+=1:")"===l?o>0&&(o-=1):0===o&&","===l&&(r=!0),r?(""!==n&&t.push(n.trim()),n="",r=!1):n+=l;return t.push(n.trim()),t}function shiftNodesBeforeParent(e,t){const n=t.index(e);if(n){const e=t.cloneBefore().removeAll().append(t.nodes.slice(0,n));e.raws.semicolon=!0,cleanupParent(e)}t.before(e),t.raws.semicolon=!0}var s=["container","document","media","supports","layer","starting-style"];function transformAtruleWithinAtrule(e,t){var n,r;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.params=(n=t.params,r=e.params,comma(n).map((e=>comma(r).map((t=>`${e} and ${t}`)).join(", "))).join(", ")),cleanupParent(t)}function isAtruleWithinAtrule(e,t){return s.includes(e.name)&&e.name===t.name}function atruleWithinRule$1(e,t,n,r,o){if(groupDeclarations(t),shiftNodesBeforeParent(e,t),e.nodes){const s=t.clone().removeAll().append(e.nodes);e.append(s),cleanupParent(t),r(s,n,o)}else cleanupParent(t)}function isAtruleWithinRule$1(e){return s.includes(e.name)}function combinationsWithSizeN(e,t){if(t<2)throw new Error("n must be greater than 1");if(e.length<2)throw new Error("s must be greater than 1");if(Math.pow(e.length,t)>1e4)throw new Error("Too many combinations when trying to resolve a nested selector with lists, reduce the complexity of your selectors");const n=[];for(let e=0;e=0;s--){let t=n[s];if(t>=e.length){if(t=0,n[s]=0,0===s)return r;n[s-1]+=1}o[s]=e[t]}r.push(o),n[n.length-1]++}}function nodesAreEquallySpecific(n){const r=n.map((t=>e().astSync(t))).map((e=>t(e))),o=r[0];for(let e=1;ee().astSync(t))):[e().astSync(`:is(${t.join(",")})`)];const s=[];for(let t=0;t{"nesting"===e.type&&(n=!0)}));const r=t.nodes[0];let o=!1;r.each((e=>"combinator"===e.type&&(o=!0,!1))),n?o&&r.insertBefore(r.at(0),e.nesting({})):(r.insertBefore(r.at(0),e.combinator({value:" "})),r.insertBefore(r.at(0),e.nesting({}))),l=t.toString()}let a=[],c=0;if(e().astSync(l).walkNesting((()=>{c++})),c>1&&o.length>1)a=combinationsWithSizeN(o,c),i=a.length;else{i=o.length;for(let e=0;e{if("nesting"!==o.type)return;let s=a[t][n];n++,"root"===s.type&&1===s.nodes.length&&(s=s.nodes[0]);const i=e().astSync(`:is(${s.toString()})`),l=isSimpleSelector(s.nodes[0]),c=isCompoundSelector(s.nodes[0]),u=isSimpleSelector(o),p=isCompoundSelector(o);if(l&&u)return void o.replaceWith(s.clone());if((l||c)&&(u||p)){const e=o.parent;return l&&"selector"===s.type?o.replaceWith(s.clone().nodes[0]):o.replaceWith(...s.clone().nodes),void(e&&e.nodes.length>1&&sortCompoundSelectorsInsideComplexSelector(e))}if(l){const e=o.parent;return o.replaceWith(s.clone().nodes[0]),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(c){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsNotInsideCompoundSelector(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}const d=o.parent;r.noIsPseudoSelector?o.replaceWith(...s.clone().nodes):o.replaceWith(...i.clone({}).nodes),d&&sortCompoundSelectorsInsideComplexSelector(d)})),s.push(o.toString())}}return s}function isSimpleSelector(e){return"combinator"!==e.type&&!(e.parent&&e.parent.nodes.length>1)}function isCompoundSelector(e,t=null){if(isSimpleSelector(e))return!1;if(!e.parent)return!1;if(!!e.parent.nodes.find((e=>"combinator"===e.type)))return!1;return!(!!e.parent.nodes.find((e=>"nesting"===e.type))&&t&&!isCompoundSelector(t))}function nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(e){if(!e.parent)return!1;if(0!==e.parent.nodes.indexOf(e))return!1;for(let t=1;t"!==e.parent.nodes[t].value)return!1;return!0}function nestingIsNotInsideCompoundSelector(e){if(isSimpleSelector(e))return!0;if(!e.parent)return!1;for(let t=0;te.split("&").length>=2&&-1===e.indexOf("|")))}function transformRuleWithinRule$1(e,t,n,r){let o=[];try{o=mergeSelectors$1(t.selectors,e.selectors,r)}catch(r){return void e.warn(n,`Failed to parse selectors : "${t.selector}" / "${e.selector}" with message: "${r instanceof Error?r.message:r}"`)}if(!o.length)return;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.selectors=o;"rule"===e.type&&"rule"===t.type&&e.selector===t.selector&&e.append(...t.nodes),cleanupParent(t)}function isValidRuleWithinRule$1(e){return e.selectors.every((e=>-1===e.indexOf("|")))}function isAtRule(e){return e&&"atrule"===e.type}function isNestRule(e){return e&&isAtRule(e)&&"nest"===e.name}function isRule(e){return e&&"rule"===e.type}function walk$1(e,t,n){e.each((r=>{const o=r.parent;isNestRule(r)&&!n.silenceAtNestWarning&&e.warn(t,`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.\nChange \`@nest ${r.params} {}\` to \`${r.params} {}\` to migrate to the latest standard.`),isRule(r)&&isRule(o)&&isValidRuleWithinRule$1(r)?transformRuleWithinRule$1(r,o,t,n):isNestRule(r)&&isRule(o)&&isValidNestRuleWithinRule(r)?transformNestRuleWithinRule(r,o,t,walk$1,n):isAtRule(r)&&isRule(o)&&isAtruleWithinRule$1(r)?atruleWithinRule$1(r,o,t,walk$1,n):isAtRule(r)&&isAtRule(o)&&isAtruleWithinAtrule(r,o)&&transformAtruleWithinAtrule(r,o),"nodes"in r&&r.nodes.length&&walk$1(r,t,n)}))}const creator$2=e=>{const t=Object.assign({noIsPseudoSelector:!1,silenceAtNestWarning:!1},e);return{postcssPlugin:"postcss-nesting",Rule(e,{result:n}){walk$1(e,n,t),e.selector.includes("&")&&ersandToScope$1(e,n)}}};function ampersandToScope(t,n){let r,o=t.parent;for(;o;){if("rule"===o.type)return;o=o.parent}try{r=e().astSync(t.selector)}catch(e){return void t.warn(n,`Failed to parse selector : "${t.selector}" with message: "${e instanceof Error?e.message:e}"`)}r&&(r.walkNesting((t=>{t.replaceWith(e.pseudo({value:":scope"}))})),t.selector=r.toString())}function atruleWithinRule(e,t,n,r){if(shiftNodesBeforeParent(e,t),e.nodes){const o=t.clone().removeAll().append(e.nodes);e.append(o),cleanupParent(t),r(o,n)}else cleanupParent(t)}function isAtruleWithinRule(e){return s.includes(e.name)}creator$2.postcss=!0;const i=e();function mergeSelectors(e,t,r,o){let s;try{s=n(i.astSync(t),i.astSync(r))}catch(n){return e.warn(o,`Failed to parse selectors : "${r}" / "${t}" with message: "${n instanceof Error?n.message:n}"`),!1}return!!s&&s.toString()}function transformRuleWithinRule(e,t,n){const r=mergeSelectors(e,e.selector,t.selector,n);if(!r)return;shiftNodesBeforeParent(e,t),e.selector=r;"rule"===e.type&&"rule"===t.type&&e.selector===t.selector&&e.append(...t.nodes),cleanupParent(t)}function isValidRuleWithinRule(e){return e.selectors.every((e=>-1===e.indexOf("|")))}function walk(e,t){e.each((e=>{const n=e.parent;isRule(e)&&isRule(n)&&isValidRuleWithinRule(e)?transformRuleWithinRule(e,n,t):isAtRule(e)&&isRule(n)&&isAtruleWithinRule(e)&&atruleWithinRule(e,n,t,walk),"nodes"in e&&e.nodes.length&&walk(e,t)}))}const creator$1=()=>({postcssPlugin:"postcss-nesting",Rule(e,{result:t}){walk(e,t),e.selector.includes("&")&&ersandToScope(e,t)},AtRule:{nest(e){throw e.error(`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.\nChange \`@nest ${e.params} {}\` to \`${e.params} {}\` to migrate to the latest standard.`)}}});creator$1.postcss=!0;const creator=e=>{const t=Object.assign({edition:"2024-02"},e);switch(t.edition){case"2021":return creator$2(e);case"2024-02":return creator$1();default:throw new Error(`Invalid edition: ${t.edition}`)}};creator.postcss=!0;export{creator as default}; diff --git a/plugins/postcss-nesting/docs/README.md b/plugins/postcss-nesting/docs/README.md index af3aca4e9..b8f571c59 100644 --- a/plugins/postcss-nesting/docs/README.md +++ b/plugins/postcss-nesting/docs/README.md @@ -27,42 +27,30 @@ you might want to use [PostCSS Nested] instead. /* becomes */ - + ``` -## ⚠️ `@nest` has been removed from the specification. +## Options -Previous iterations of the [CSS Nesting specification] required using `@nest` for certain selectors. +### edition -`@nest` was removed from the specification completely. -Future versions of this plugin will error if you use `@nest`. +The CSS nesting feature has gone through several iterations and what is currently implemented in browsers is not the same as what was originally proposed. This plugin dates back to the original proposal and you might have written your CSS expecting this older behavior. -We advice everyone to migrate their codebase **now** to nested CSS without `@nest`. -We published a [Stylelint Plugin](https://github.com/csstools/postcss-plugins/tree/main/plugins-stylelint/no-at-nest-rule#csstoolsstylelint-no-at-nest-rule) to help you migrate. +You can pick the older behavior by setting the `edition` option. +The `edition` values correspond with rough dates when of a particular version of the specification: +- `2024-02` (default) +- `2021` -example warning: -> `@nest` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version. -> Change `@nest foo & {}` to `foo & {}` to migrate to the latest standard. +> [!TIP] +> If you wrote nested rules with `@nest` you definitely want to set the `edition` to `2021`. +> If you are unsure than you should try to omit the `edition` option and use the default. -You can silence this warning with a new `silenceAtNestWarning` plugin option. +Eventually we will remove support for the older edition, and this plugin option, so it is strongly advised to update your CSS to the latest edition. -```js -({ - silenceAtNestWarning: true -}) -``` - -## Options - -### edition - -The default behavior is to transpile CSS following an older version of the CSS nesting specification. - -If you want to already use the latest version you can set the `edition` option to `2024-02`. ```js ({ @@ -70,37 +58,27 @@ If you want to already use the latest version you can set the `edition` option t }) ``` -#### `2021` (default) - -This version is a continuation of what existed before CSS nesting was implemented in browsers. -It made a few non-invasive changes to keep up with implementations but it is falling behind. - -In a future version of this plugin this will no longer be the default. - -```pcss - - -/* becomes */ - - -``` - -#### `2024-02` +#### `2024-02` (default) - usage of `:is()` pseudo-class is no longer optional - at rules are not combined with the `and` keyword - `@nest` is removed from the specification - declarations and nested rules/at-rules are no longer re-ordered +#### `2021` + +This version is a continuation of what existed before CSS nesting was implemented in browsers. +It made a few non-invasive changes to keep up with implementations but it is falling behind. + ```pcss /* becomes */ - + ``` -### noIsPseudoSelector +### noIsPseudoSelector (edition: `2021`) #### Specificity diff --git a/plugins/postcss-nesting/src/index.ts b/plugins/postcss-nesting/src/index.ts index e17244980..8ee076a49 100644 --- a/plugins/postcss-nesting/src/index.ts +++ b/plugins/postcss-nesting/src/index.ts @@ -10,7 +10,7 @@ export type { pluginOptions as pluginOptions2024_02 } from './editions/2024-02'; /** postcss-nesting plugin options */ export type pluginOptions = { - /** The implementation edition for CSS Nesting, default to '2021' */ + /** The implementation edition for CSS Nesting, default to '2024-02' */ edition?: '2021' | '2024-02', } & pluginOptions2021 & pluginOptions2024_02; @@ -18,7 +18,7 @@ const creator: PluginCreator = (opts?: pluginOptions) => { const options = Object.assign( // Default options { - edition: '2021', + edition: '2024-02', }, // Provided options opts, diff --git a/plugins/postcss-nesting/test/_tape-2021.mjs b/plugins/postcss-nesting/test/_tape-2021.mjs index 29578bd1f..31aa7752e 100644 --- a/plugins/postcss-nesting/test/_tape-2021.mjs +++ b/plugins/postcss-nesting/test/_tape-2021.mjs @@ -49,42 +49,61 @@ mixinPluginNestedRules.postcss = true; postcssTape(plugin)({ 'basic': { message: 'supports basic usage', + options: { + edition: '2021', + }, }, 'basic:no-is-pseudo-selector': { message: 'supports basic usage { noIsPseudoSelector: true }', options: { + edition: '2021', noIsPseudoSelector: true, }, }, 'ampersand-everywhere': { message: 'supports & at the root', + options: { + edition: '2021', + }, }, 'complex': { message: 'supports complex entries', + options: { + edition: '2021', + }, }, 'complex:no-is-pseudo-selector': { message: 'supports complex entries { noIsPseudoSelector: true }', options: { + edition: '2021', noIsPseudoSelector: true, }, }, 'direct': { message: 'supports direct usage', + options: { + edition: '2021', + }, }, 'direct:no-is-pseudo-selector': { message: 'supports direct usage { noIsPseudoSelector: true }', options: { + edition: '2021', noIsPseudoSelector: true, }, }, 'at-nest': { message: 'supports at-nest usage', warnings: 64, + options: { + edition: '2021', + }, }, 'at-nest:silent': { message: 'supports at-nest usage { silenceAtNestWarning: true }', warnings: 4, options: { + edition: '2021', silenceAtNestWarning: true, }, }, @@ -92,121 +111,175 @@ postcssTape(plugin)({ message: 'supports at-nest usage { noIsPseudoSelector: true }', warnings: 64, options: { + edition: '2021', noIsPseudoSelector: true, }, }, 'container': { message: 'supports nested @container', + options: { + edition: '2021', + }, }, 'container:no-is-pseudo-selector': { message: 'supports nested @container { noIsPseudoSelector: true }', options: { + edition: '2021', noIsPseudoSelector: true, }, }, 'decl-order': { message: 'resolves to the correct order', + options: { + edition: '2021', + }, }, 'document': { message: 'supports nested @document', + options: { + edition: '2021', + }, }, 'document:no-is-pseudo-selector': { message: 'supports nested @document { noIsPseudoSelector: true }', options: { + edition: '2021', noIsPseudoSelector: true, }, }, 'invalid-selector': { message: 'warns on invalid selectors', warnings: 4, + options: { + edition: '2021', + }, }, 'media': { message: 'supports nested @media', + options: { + edition: '2021', + }, }, 'media:no-is-pseudo-selector': { message: 'supports nested @media { noIsPseudoSelector: true }', options: { + edition: '2021', noIsPseudoSelector: true, }, }, 'multiple-replacements': { message: 'supports multiple replacements', + options: { + edition: '2021', + }, }, 'pseudo-element': { message: 'supports pseudo elements', + options: { + edition: '2021', + }, }, 'supports': { message: 'supports nested @supports', + options: { + edition: '2021', + }, }, 'supports:no-is-pseudo-selector': { message: 'supports nested @supports { noIsPseudoSelector: true }', options: { + edition: '2021', noIsPseudoSelector: true, }, }, 'layer': { message: 'supports nested @layer', + options: { + edition: '2021', + }, }, 'empty': { message: 'removes empty rules', + options: { + edition: '2021', + }, }, 'empty:no-is-pseudo-selector': { message: 'removes empty rules { noIsPseudoSelector: true }', options: { + edition: '2021', noIsPseudoSelector: true, }, }, 'ignore': { message: 'ignores invalid entries', + options: { + edition: '2021', + }, }, 'ignore:no-is-pseudo-selector': { message: 'ignores invalid entries { noIsPseudoSelector: true }', options: { + edition: '2021', noIsPseudoSelector: true, }, }, 'mixin-declaration': { message: 'supports other visitors (mixin declaration)', - plugins: [mixinPluginDeclaration(), plugin()], + plugins: [mixinPluginDeclaration(), plugin({ edition: '2021' })], }, 'mixin-declaration:no-is-pseudo-selector': { message: 'supports other visitors (mixin declaration) { noIsPseudoSelector: true }', - plugins: [mixinPluginDeclaration(), plugin({ noIsPseudoSelector: true })], + plugins: [mixinPluginDeclaration(), plugin({ noIsPseudoSelector: true, edition: '2021' })], }, 'mixin-rule': { message: 'supports other visitors (mixin rule)', - plugins: [mixinPluginRule(), plugin()], + plugins: [mixinPluginRule(), plugin({ edition: '2021' })], }, 'mixin-rule:no-is-pseudo-selector': { message: 'supports other visitors (mixin rule) { noIsPseudoSelector: true }', - plugins: [mixinPluginRule(), plugin({ noIsPseudoSelector: true })], + plugins: [mixinPluginRule(), plugin({ noIsPseudoSelector: true, edition: '2021' })], }, 'mixin-nested-rules': { message: 'supports mixin with nested rules', - plugins: [mixinPluginNestedRules(), plugin()], + plugins: [mixinPluginNestedRules(), plugin({ edition: '2021' })], }, 'spec-examples': { message: 'supports all spec examples', + options: { + edition: '2021', + }, }, 'spec-examples:no-is-pseudo-selector': { message: 'supports all spec examples { noIsPseudoSelector: true }', options: { + edition: '2021', noIsPseudoSelector: true, }, }, 'relative-selectors': { message: 'supports relative selectors', + options: { + edition: '2021', + }, }, 'requires-is-pseudo': { message: 'examples of selector nesting that require :is to be correct', + options: { + edition: '2021', + }, }, 'requires-is-pseudo:no-is-pseudo-selector': { message: 'examples of selector nesting that require :is to be correct { noIsPseudoSelector: true }', options: { + edition: '2021', noIsPseudoSelector: true, }, }, 'examples/example': { message: 'basic examples', + options: { + edition: '2021', + }, }, }); diff --git a/plugins/postcss-nesting/test/_tape-2024-02.mjs b/plugins/postcss-nesting/test/_tape-2024-02.mjs index 445fe12c3..d3f5d6a1c 100644 --- a/plugins/postcss-nesting/test/_tape-2024-02.mjs +++ b/plugins/postcss-nesting/test/_tape-2024-02.mjs @@ -49,88 +49,46 @@ mixinPluginNestedRules.postcss = true; postcssTape(plugin)({ 'basic:edition-2024-02': { message: 'supports basic usage', - options: { - edition: '2024-02', - }, }, 'ampersand-everywhere:edition-2024-02': { message: 'supports & at the root', - options: { - edition: '2024-02', - }, }, 'complex:edition-2024-02': { message: 'supports complex entries', - options: { - edition: '2024-02', - }, }, 'direct:edition-2024-02': { message: 'supports direct usage', - options: { - edition: '2024-02', - }, }, 'container:edition-2024-02': { message: 'supports nested @container', - options: { - edition: '2024-02', - }, }, 'decl-order:edition-2024-02': { message: 'resolves to the correct order', - options: { - edition: '2024-02', - }, }, 'invalid-selector:edition-2024-02': { message: 'warns on invalid selectors', - options: { - edition: '2024-02', - }, warnings: 4, }, 'media:edition-2024-02': { message: 'supports nested @media', - options: { - edition: '2024-02', - }, }, 'multiple-replacements:edition-2024-02': { message: 'supports multiple replacements', - options: { - edition: '2024-02', - }, }, 'pseudo-element:edition-2024-02': { message: 'supports pseudo elements', - options: { - edition: '2024-02', - }, }, 'supports:edition-2024-02': { message: 'supports nested @supports', - options: { - edition: '2024-02', - }, }, 'layer:edition-2024-02': { message: 'supports nested @layer', - options: { - edition: '2024-02', - }, }, 'empty:edition-2024-02': { message: 'removes empty rules', - options: { - edition: '2024-02', - }, }, 'ignore:edition-2024-02': { message: 'ignores invalid entries', - options: { - edition: '2024-02', - }, }, 'mixin-declaration:edition-2024-02': { message: 'supports other visitors (mixin declaration)', @@ -146,26 +104,14 @@ postcssTape(plugin)({ }, 'spec-examples:edition-2024-02': { message: 'supports all spec examples', - options: { - edition: '2024-02', - }, }, 'relative-selectors:edition-2024-02': { message: 'supports relative selectors', - options: { - edition: '2024-02', - }, }, 'requires-is-pseudo:edition-2024-02': { message: 'examples of selector nesting that require :is to be correct', - options: { - edition: '2024-02', - }, }, 'examples/example:edition-2024-02': { message: 'basic examples', - options: { - edition: '2024-02', - }, }, }); diff --git a/plugins/postcss-nesting/test/wpt/nesting-basics.html b/plugins/postcss-nesting/test/wpt/nesting-basics.html index 7aab56078..e7b3dc418 100644 --- a/plugins/postcss-nesting/test/wpt/nesting-basics.html +++ b/plugins/postcss-nesting/test/wpt/nesting-basics.html @@ -130,18 +130,18 @@ .test-10 { & { - background-color: green; + background-color: red; } - background-color: red; + background-color: green; } .test-11 { & { - background-color: red; + background-color: green !important; } - background-color: green !important; + background-color: red; } `, }, diff --git a/sites/postcss-preset-env/src/static/js/playground.js b/sites/postcss-preset-env/src/static/js/playground.js index 699409b0f..e97fef488 100644 --- a/sites/postcss-preset-env/src/static/js/playground.js +++ b/sites/postcss-preset-env/src/static/js/playground.js @@ -41,11 +41,6 @@ const currentConfig = stateAtLoad.config ?? { inlineDirection: 'left-to-right', blockDirection: 'top-to-bottom', }, - features: { - 'nesting-rules': ['auto', { - edition: '2024-02', - }], - }, }; function processCss(source, config, isDefaultState = false) { From 35fe3d2a3b4e82eaa9c458a7f585032664865b43 Mon Sep 17 00:00:00 2001 From: Romain Menke Date: Sun, 5 May 2024 13:27:18 +0200 Subject: [PATCH 4/7] add compilation cache --- .github/workflows/lint.yml | 9 +++++++++ .github/workflows/test.yml | 14 +++++--------- .gitignore | 1 + .nvmrc | 2 +- package.json | 2 +- .../dist/index.cjs | 1 - .../dist/index.d.ts | 19 ------------------- .../dist/index.mjs | 1 - 8 files changed, 17 insertions(+), 32 deletions(-) delete mode 100644 plugins/postcss-relative-color-syntax/dist/index.cjs delete mode 100644 plugins/postcss-relative-color-syntax/dist/index.d.ts delete mode 100644 plugins/postcss-relative-color-syntax/dist/index.mjs diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6f8dbd9d7..f79e410df 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,6 +13,8 @@ defaults: jobs: lint: runs-on: ubuntu-latest + env: + NODE_COMPILE_CACHE: '.cache/v8' steps: - uses: actions/checkout@v4 with: @@ -28,5 +30,12 @@ jobs: - name: lint run: npm run lint + - name: docs + run: npm run docs + - name: knip run: npm run knip + + - name: repo is clean after "build", "lint" and "docs" steps + run: | + git diff --name-only --exit-code diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0aea71cff..effecd1eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,6 +30,8 @@ jobs: is_base_os_version: true - node: 22 is_base_node_version: true + env: + NODE_COMPILE_CACHE: '.cache/v8' steps: - uses: actions/checkout@v4 with: @@ -41,13 +43,10 @@ jobs: - name: npm ci run: | npm ci - env: - BROWSER_TESTS: true if: ${{ (matrix.is_base_node_version && matrix.is_base_os_version) }} - - name: npm ci run: | - NPM_CONFIG_ENGINE_STRICT=false npm ci --ignore-scripts + npm ci --ignore-scripts if: ${{ !(matrix.is_base_node_version && matrix.is_base_os_version) }} - name: determine modified workspaces @@ -65,10 +64,6 @@ jobs: npm run build --if-present $MODIFIED_WORKSPACES if: matrix.is_base_node_version && matrix.is_base_os_version - - name: docs - run: npm run docs - if: matrix.is_base_node_version && matrix.is_base_os_version - - name: repo is clean after "build", "lint" and "docs" steps run: | git diff --name-only --exit-code @@ -79,12 +74,13 @@ jobs: env: ENABLE_ANNOTATIONS_FOR_NODE: ${{ matrix.is_base_node_version }} ENABLE_ANNOTATIONS_FOR_OS: ${{ matrix.is_base_os_version }} + BROWSER_TESTS: ${{ (matrix.is_base_node_version && matrix.is_base_os_version) }} # CLI Tests # running "npm install" places the cli in node_modules/bin - name: test:cli run: | - NPM_CONFIG_ENGINE_STRICT=false npm install --ignore-scripts + npm install --ignore-scripts npm run test:cli --if-present $MODIFIED_WORKSPACES # E2E Tests diff --git a/.gitignore b/.gitignore index bcb52d0bb..d9e1c7d30 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ reports !sites/package-lock.json .cached-commit _types +.cache diff --git a/.nvmrc b/.nvmrc index 33206cbae..379b25d1c 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v22.0.0 +v22.1.0 diff --git a/package.json b/package.json index 46dc82f3c..1e1526aa5 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,6 @@ "knip": "knip" }, "volta": { - "node": "22.0.0" + "node": "22.1.0" } } diff --git a/plugins/postcss-relative-color-syntax/dist/index.cjs b/plugins/postcss-relative-color-syntax/dist/index.cjs deleted file mode 100644 index 3ce20e78e..000000000 --- a/plugins/postcss-relative-color-syntax/dist/index.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var s=require("@csstools/postcss-progressive-custom-properties"),e=require("@csstools/css-color-parser"),a=require("@csstools/utilities"),r=require("@csstools/css-parser-algorithms"),t=require("@csstools/css-tokenizer");const o=/\b(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)\(/i,l=/\b(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)\(\s*?from/i,i=/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)$/i,n=/from/i,basePlugin=s=>({postcssPlugin:"postcss-relative-color-syntax",Declaration(c){const u=c.value;if(!o.test(u)||!n.test(u))return;if(a.hasFallback(c))return;if(a.hasSupportsAtRuleAncestor(c,l))return;const p=t.tokenize({css:u}),g=r.replaceComponentValues(r.parseCommaSeparatedListOfComponentValues(p),(s=>{if(!r.isFunctionNode(s)||!i.test(s.getName()))return;const a=e.color(s);return a&&!a.syntaxFlags.has(e.SyntaxFlag.Experimental)&&!a.syntaxFlags.has(e.SyntaxFlag.HasNoneKeywords)&&a.syntaxFlags.has(e.SyntaxFlag.RelativeColorSyntax)?e.serializeRGB(a):void 0})),b=r.stringify(g);if(b===u)return;let y=b;s?.subFeatures.displayP3&&(y=r.stringify(r.replaceComponentValues(r.parseCommaSeparatedListOfComponentValues(p),(s=>{if(!r.isFunctionNode(s)||!i.test(s.getName()))return;const a=e.color(s);return a&&!a.syntaxFlags.has(e.SyntaxFlag.Experimental)&&!a.syntaxFlags.has(e.SyntaxFlag.HasNoneKeywords)&&a.syntaxFlags.has(e.SyntaxFlag.RelativeColorSyntax)?e.colorDataFitsRGB_Gamut(a)?e.serializeRGB(a):e.serializeP3(a):void 0})))),c.cloneBefore({value:b}),s?.subFeatures.displayP3&&y!==b&&c.cloneBefore({value:y}),s?.preserve||c.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const a=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return a.subFeatures=Object.assign({displayP3:!0},a.subFeatures),a.enableProgressiveCustomProperties&&(a.preserve||a.subFeatures.displayP3)?{postcssPlugin:"postcss-relative-color-syntax",plugins:[s(),basePlugin(a)]}:basePlugin(a)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; diff --git a/plugins/postcss-relative-color-syntax/dist/index.d.ts b/plugins/postcss-relative-color-syntax/dist/index.d.ts deleted file mode 100644 index 5593b607f..000000000 --- a/plugins/postcss-relative-color-syntax/dist/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { PluginCreator } from 'postcss'; - -/** postcss-relative-color-syntax plugin options */ -export declare type pluginOptions = { - /** Preserve the original notation. default: false */ - preserve?: boolean; - /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ - enableProgressiveCustomProperties?: boolean; - /** Toggle sub features. default: { displayP3: true } */ - subFeatures?: { - /** Enable displayP3 fallbacks. default: true */ - displayP3?: boolean; - }; -}; - -declare const postcssPlugin: PluginCreator; -export default postcssPlugin; - -export { } diff --git a/plugins/postcss-relative-color-syntax/dist/index.mjs b/plugins/postcss-relative-color-syntax/dist/index.mjs deleted file mode 100644 index 0184ff352..000000000 --- a/plugins/postcss-relative-color-syntax/dist/index.mjs +++ /dev/null @@ -1 +0,0 @@ -import s from"@csstools/postcss-progressive-custom-properties";import{color as e,SyntaxFlag as r,serializeRGB as o,colorDataFitsRGB_Gamut as t,serializeP3 as a}from"@csstools/css-color-parser";import{hasFallback as l,hasSupportsAtRuleAncestor as i}from"@csstools/utilities";import{replaceComponentValues as c,parseCommaSeparatedListOfComponentValues as n,isFunctionNode as u,stringify as p}from"@csstools/css-parser-algorithms";import{tokenize as b}from"@csstools/css-tokenizer";const g=/\b(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)\(/i,h=/\b(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)\(\s*?from/i,m=/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)$/i,y=/from/i,basePlugin=s=>({postcssPlugin:"postcss-relative-color-syntax",Declaration(f){const v=f.value;if(!g.test(v)||!y.test(v))return;if(l(f))return;if(i(f,h))return;const x=b({css:v}),F=c(n(x),(s=>{if(!u(s)||!m.test(s.getName()))return;const t=e(s);return t&&!t.syntaxFlags.has(r.Experimental)&&!t.syntaxFlags.has(r.HasNoneKeywords)&&t.syntaxFlags.has(r.RelativeColorSyntax)?o(t):void 0})),P=p(F);if(P===v)return;let d=P;s?.subFeatures.displayP3&&(d=p(c(n(x),(s=>{if(!u(s)||!m.test(s.getName()))return;const l=e(s);return l&&!l.syntaxFlags.has(r.Experimental)&&!l.syntaxFlags.has(r.HasNoneKeywords)&&l.syntaxFlags.has(r.RelativeColorSyntax)?t(l)?o(l):a(l):void 0})))),f.cloneBefore({value:P}),s?.subFeatures.displayP3&&d!==P&&f.cloneBefore({value:d}),s?.preserve||f.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-relative-color-syntax",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; From b228ed05575848c6643a6d682f0210d47181c00a Mon Sep 17 00:00:00 2001 From: Romain Menke Date: Sun, 5 May 2024 13:32:58 +0200 Subject: [PATCH 5/7] fix --- .github/workflows/test.yml | 4 ++-- .../dist/index.cjs | 1 + .../dist/index.d.ts | 19 +++++++++++++++++++ .../dist/index.mjs | 1 + 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 plugins/postcss-relative-color-syntax/dist/index.cjs create mode 100644 plugins/postcss-relative-color-syntax/dist/index.d.ts create mode 100644 plugins/postcss-relative-color-syntax/dist/index.mjs diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index effecd1eb..780d67c46 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,8 +16,8 @@ jobs: strategy: fail-fast: false # Test node 18/20/22 on ubuntu - # Test node 20 on macos/windows - # Enable annotations only for node 20 + ubuntu + # Test node 22 on macos/windows + # Enable annotations only for node 22 + ubuntu matrix: os: [ubuntu-latest] node: [18, 20, 22] diff --git a/plugins/postcss-relative-color-syntax/dist/index.cjs b/plugins/postcss-relative-color-syntax/dist/index.cjs new file mode 100644 index 000000000..3ce20e78e --- /dev/null +++ b/plugins/postcss-relative-color-syntax/dist/index.cjs @@ -0,0 +1 @@ +"use strict";var s=require("@csstools/postcss-progressive-custom-properties"),e=require("@csstools/css-color-parser"),a=require("@csstools/utilities"),r=require("@csstools/css-parser-algorithms"),t=require("@csstools/css-tokenizer");const o=/\b(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)\(/i,l=/\b(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)\(\s*?from/i,i=/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)$/i,n=/from/i,basePlugin=s=>({postcssPlugin:"postcss-relative-color-syntax",Declaration(c){const u=c.value;if(!o.test(u)||!n.test(u))return;if(a.hasFallback(c))return;if(a.hasSupportsAtRuleAncestor(c,l))return;const p=t.tokenize({css:u}),g=r.replaceComponentValues(r.parseCommaSeparatedListOfComponentValues(p),(s=>{if(!r.isFunctionNode(s)||!i.test(s.getName()))return;const a=e.color(s);return a&&!a.syntaxFlags.has(e.SyntaxFlag.Experimental)&&!a.syntaxFlags.has(e.SyntaxFlag.HasNoneKeywords)&&a.syntaxFlags.has(e.SyntaxFlag.RelativeColorSyntax)?e.serializeRGB(a):void 0})),b=r.stringify(g);if(b===u)return;let y=b;s?.subFeatures.displayP3&&(y=r.stringify(r.replaceComponentValues(r.parseCommaSeparatedListOfComponentValues(p),(s=>{if(!r.isFunctionNode(s)||!i.test(s.getName()))return;const a=e.color(s);return a&&!a.syntaxFlags.has(e.SyntaxFlag.Experimental)&&!a.syntaxFlags.has(e.SyntaxFlag.HasNoneKeywords)&&a.syntaxFlags.has(e.SyntaxFlag.RelativeColorSyntax)?e.colorDataFitsRGB_Gamut(a)?e.serializeRGB(a):e.serializeP3(a):void 0})))),c.cloneBefore({value:b}),s?.subFeatures.displayP3&&y!==b&&c.cloneBefore({value:y}),s?.preserve||c.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const a=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return a.subFeatures=Object.assign({displayP3:!0},a.subFeatures),a.enableProgressiveCustomProperties&&(a.preserve||a.subFeatures.displayP3)?{postcssPlugin:"postcss-relative-color-syntax",plugins:[s(),basePlugin(a)]}:basePlugin(a)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; diff --git a/plugins/postcss-relative-color-syntax/dist/index.d.ts b/plugins/postcss-relative-color-syntax/dist/index.d.ts new file mode 100644 index 000000000..5593b607f --- /dev/null +++ b/plugins/postcss-relative-color-syntax/dist/index.d.ts @@ -0,0 +1,19 @@ +import type { PluginCreator } from 'postcss'; + +/** postcss-relative-color-syntax plugin options */ +export declare type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; + /** Toggle sub features. default: { displayP3: true } */ + subFeatures?: { + /** Enable displayP3 fallbacks. default: true */ + displayP3?: boolean; + }; +}; + +declare const postcssPlugin: PluginCreator; +export default postcssPlugin; + +export { } diff --git a/plugins/postcss-relative-color-syntax/dist/index.mjs b/plugins/postcss-relative-color-syntax/dist/index.mjs new file mode 100644 index 000000000..0184ff352 --- /dev/null +++ b/plugins/postcss-relative-color-syntax/dist/index.mjs @@ -0,0 +1 @@ +import s from"@csstools/postcss-progressive-custom-properties";import{color as e,SyntaxFlag as r,serializeRGB as o,colorDataFitsRGB_Gamut as t,serializeP3 as a}from"@csstools/css-color-parser";import{hasFallback as l,hasSupportsAtRuleAncestor as i}from"@csstools/utilities";import{replaceComponentValues as c,parseCommaSeparatedListOfComponentValues as n,isFunctionNode as u,stringify as p}from"@csstools/css-parser-algorithms";import{tokenize as b}from"@csstools/css-tokenizer";const g=/\b(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)\(/i,h=/\b(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)\(\s*?from/i,m=/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)$/i,y=/from/i,basePlugin=s=>({postcssPlugin:"postcss-relative-color-syntax",Declaration(f){const v=f.value;if(!g.test(v)||!y.test(v))return;if(l(f))return;if(i(f,h))return;const x=b({css:v}),F=c(n(x),(s=>{if(!u(s)||!m.test(s.getName()))return;const t=e(s);return t&&!t.syntaxFlags.has(r.Experimental)&&!t.syntaxFlags.has(r.HasNoneKeywords)&&t.syntaxFlags.has(r.RelativeColorSyntax)?o(t):void 0})),P=p(F);if(P===v)return;let d=P;s?.subFeatures.displayP3&&(d=p(c(n(x),(s=>{if(!u(s)||!m.test(s.getName()))return;const l=e(s);return l&&!l.syntaxFlags.has(r.Experimental)&&!l.syntaxFlags.has(r.HasNoneKeywords)&&l.syntaxFlags.has(r.RelativeColorSyntax)?t(l)?o(l):a(l):void 0})))),f.cloneBefore({value:P}),s?.subFeatures.displayP3&&d!==P&&f.cloneBefore({value:d}),s?.preserve||f.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-relative-color-syntax",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; From 592dafcc6e1b8e1f80b1b2231fc923c8a1f220a1 Mon Sep 17 00:00:00 2001 From: Romain Menke Date: Sun, 5 May 2024 14:20:51 +0200 Subject: [PATCH 6/7] tweak --- .github/workflows/lint.yml | 2 -- .github/workflows/test.yml | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f79e410df..a25b1ef95 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,8 +13,6 @@ defaults: jobs: lint: runs-on: ubuntu-latest - env: - NODE_COMPILE_CACHE: '.cache/v8' steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 780d67c46..cd397d278 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,8 +30,6 @@ jobs: is_base_os_version: true - node: 22 is_base_node_version: true - env: - NODE_COMPILE_CACHE: '.cache/v8' steps: - uses: actions/checkout@v4 with: @@ -63,6 +61,8 @@ jobs: run: | npm run build --if-present $MODIFIED_WORKSPACES if: matrix.is_base_node_version && matrix.is_base_os_version + env: + NODE_COMPILE_CACHE: '.cache/v8' - name: repo is clean after "build", "lint" and "docs" steps run: | @@ -72,9 +72,10 @@ jobs: - name: test run: npm run test --if-present $MODIFIED_WORKSPACES env: + BROWSER_TESTS: ${{ (matrix.is_base_node_version && matrix.is_base_os_version) }} ENABLE_ANNOTATIONS_FOR_NODE: ${{ matrix.is_base_node_version }} ENABLE_ANNOTATIONS_FOR_OS: ${{ matrix.is_base_os_version }} - BROWSER_TESTS: ${{ (matrix.is_base_node_version && matrix.is_base_os_version) }} + NODE_COMPILE_CACHE: '.cache/v8' # CLI Tests # running "npm install" places the cli in node_modules/bin From e023769d241a90d1f61995310954593a80842cd3 Mon Sep 17 00:00:00 2001 From: Romain Menke Date: Sun, 5 May 2024 14:21:40 +0200 Subject: [PATCH 7/7] tweak --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cd397d278..a600771bf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -75,7 +75,6 @@ jobs: BROWSER_TESTS: ${{ (matrix.is_base_node_version && matrix.is_base_os_version) }} ENABLE_ANNOTATIONS_FOR_NODE: ${{ matrix.is_base_node_version }} ENABLE_ANNOTATIONS_FOR_OS: ${{ matrix.is_base_os_version }} - NODE_COMPILE_CACHE: '.cache/v8' # CLI Tests # running "npm install" places the cli in node_modules/bin