Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions plugin-packs/postcss-preset-env/src/lib/list-features.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ export function listFeatures(cssdbList, options, sharedOptions) {

const stage = stageFromOptions(options);

// TODO : remove this hack in the next major
// see : https://github.com/csstools/cssdb/pull/78
// These features require client side polyfills and changing their stage is breaking for everyone with `preserve : false`
if (stage === 2 && sharedOptions && sharedOptions.preserve === false) {
cssdbList = JSON.parse(JSON.stringify(cssdbList)); // deep clone;
cssdbList.forEach((feature) => {
if (feature.id === 'blank-pseudo-class') {
feature.stage = 1;
} else if (feature.id === 'prefers-color-scheme-query') {
feature.stage = 1;
}
});
}

// polyfillable features (those with an available postcss plugin)
const polyfillableFeatures = prepareFeaturesList(cssdbList, insertBefore, insertAfter).map((feature) => {
return formatPolyfillableFeature(feature);
Expand Down