Skip to content

update dependencies #1225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 18 additions & 20 deletions plugin-packs/postcss-preset-env/test/basic.vendors-2.expect.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,24 @@
.test-nesting-rules {
order: 4;

& p {
order: 5;
}

order: 6;
}

.test-nesting-rules p {
order: 5;
}

.test-nesting-rules,
#test-is-pseudo {
order: 7;

& + p {
order: 8;
}

order: 9;
}

.test-nesting-rules + p, #test-is-pseudo + p {
order: 8;
}

@custom-media --narrow-window (max-width: 30em);

@media (--narrow-window) {
Expand Down Expand Up @@ -542,11 +542,9 @@

@custom-selector :--view-m [data-view-size=m];

.view {
:--view-m & {
:--view-m .view {
background: red;
}
}

.nested-calc {
order: calc(1 * (8 / 3 + (5 * 10)));
Expand Down Expand Up @@ -621,17 +619,17 @@
}

.test-css-color-5-interop {
color-1: color(from rgb(196, 129, 72) a98-rgb r g b / alpha);
color-1: rgb(196, 129, 72);
color-2: color(from rgb(196, 129, 72) a98-rgb r g b / none);
color-3: color(from rgb(234, 133, 82) prophoto-rgb r g b);
color-3: rgb(234, 133, 82);
color-4: color(from rgb(234, 133, 82) prophoto-rgb r g none);
color-5: hwb(from rgb(179, 157, 51) h w b);
color-6: lab(from rgb(179, 35, 35) l a b);
color-7: lch(from rgb(163, 57, 39) l c h);
color-8: oklab(from rgb(141, 0, 0) l a b);
color-8: oklab(from color(display-p3 0.50566 0.0781 0) l a b);
color-9: oklch(from rgb(130, 31, 0) l c h);
color-9: oklch(from color(display-p3 0.48896 0.1211 0) l c h);
color-5: rgb(179, 157, 51);
color-6: rgb(179, 35, 35);
color-7: rgb(163, 57, 39);
color-8: rgb(141, 0, 0);
color-8: color(display-p3 0.50566 0.0781 0);
color-9: rgb(130, 31, 0);
color-9: color(display-p3 0.48896 0.1211 0);
}

.test-property-with-var {
Expand Down
20 changes: 9 additions & 11 deletions plugin-packs/postcss-preset-env/test/basic.vendors-3.expect.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,24 @@
.test-nesting-rules {
order: 4;

& p {
order: 5;
}

order: 6;
}

.test-nesting-rules p {
order: 5;
}

.test-nesting-rules,
#test-is-pseudo {
order: 7;

& + p {
order: 8;
}

order: 9;
}

.test-nesting-rules + p, #test-is-pseudo + p {
order: 8;
}

@custom-media --narrow-window (max-width: 30em);

@media (--narrow-window) {
Expand Down Expand Up @@ -541,11 +541,9 @@

@custom-selector :--view-m [data-view-size=m];

.view {
:--view-m & {
:--view-m .view {
background: red;
}
}

.nested-calc {
order: calc(1 * (8 / 3 + (5 * 10)));
Expand Down
3 changes: 0 additions & 3 deletions plugins/css-blank-pseudo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ const creator: PluginCreator<pluginOptions> = (opts?: pluginOptions) => {

if (i === selectorAST.nodes[0].nodes.length - 1) {
// Append the class to the end of the selector if no combinator or pseudo element was found.
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
selectorAST.nodes[0].append(parser.className({ value: POLYFILL_READY_CLASSNAME }));
break;
}
Expand All @@ -118,9 +117,7 @@ const creator: PluginCreator<pluginOptions> = (opts?: pluginOptions) => {

if (selectorAST.nodes?.[0]?.nodes) {
// Prepend a space combinator and the class to the beginning of the selector.
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
selectorASTClone.nodes[0].prepend(parser.combinator({ value: ' ' }));
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
selectorASTClone.nodes[0].prepend(parser.className({ value: POLYFILL_READY_CLASSNAME }));
}

Expand Down
3 changes: 0 additions & 3 deletions plugins/css-has-pseudo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,10 @@ const creator: PluginCreator<pluginOptions> = (opts?: pluginOptions) => {
if (x.type === 'selector') {
x.nodes.forEach((y) => {
delete y.parent;
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
hasContainingSelector.append(y);
});
} else {
delete x.parent;
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
hasContainingSelector.append(x);
}
});
Expand All @@ -167,7 +165,6 @@ const creator: PluginCreator<pluginOptions> = (opts?: pluginOptions) => {
const replacementNodes = encodedSelectorAST.nodes[0].nodes;

for (let i = replacementNodes.length - 1; i >= 0; i--) {
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
container.prepend(replacementNodes[i]);
}
});
Expand Down
4 changes: 0 additions & 4 deletions plugins/postcss-attribute-case-insensitive/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ function createSensitiveAttributes(attribute: selectorParser.Attribute) {
insensitive: false,
});

// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
newAttribute.setValue(x);

return newAttribute;
Expand All @@ -49,7 +48,6 @@ function createNewSelectors(selector: selectorParser.Selector) {
selector.each((node) => {
if (!nodeIsInsensitiveAttribute(node)) {
newSelectors.forEach(newSelector => {
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
newSelector.append(node.clone());
});
return;
Expand All @@ -61,9 +59,7 @@ function createNewSelectors(selector: selectorParser.Selector) {
sensitiveAttributes.forEach(newNode => {
newSelectors.forEach(newSelector => {
const newSelectorWithNewNode = newSelector.clone({});
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
newSelectorWithNewNode.append(newNode);
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
newSelectorsWithSensitiveAttributes.push(newSelectorWithNewNode);
});
});
Expand Down
4 changes: 0 additions & 4 deletions plugins/postcss-dir-pseudo-class/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ const creator: PluginCreator<pluginOptions> = (opts?: pluginOptions) => {

if (first && !firstIsHtml && !firstIsRoot && !firstIsSpaceCombinator) {
parent.prepend(
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
selectorParser.combinator({
value: ' ',
}),
Expand Down Expand Up @@ -171,19 +170,16 @@ const creator: PluginCreator<pluginOptions> = (opts?: pluginOptions) => {
parent.insertAfter(first, notDirAttr);
} else {
// prepend :root
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
parent.prepend(notDirAttr);
}
} else if (firstIsHtml) {
// insert dir attribute after html tag
parent.insertAfter(first, dirAttr);
} else if (options.shadow && !firstIsRoot) {
// prepend :host-context([dir])
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
parent.prepend(hostContextPseudo);
} else {
// otherwise, prepend the dir attribute
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
parent.prepend(dirAttr);
}
});
Expand Down
3 changes: 0 additions & 3 deletions plugins/postcss-focus-visible/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ const creator: PluginCreator<pluginOptions> = (opts?: pluginOptions) => {

if (i === selectorAST.nodes[0].nodes.length - 1) {
// Append the class to the end of the selector if not combinator or pseudo element was found.
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
selectorAST.nodes[0].append(parser.className({ value: POLYFILL_READY_CLASSNAME }));
break;
}
Expand All @@ -106,9 +105,7 @@ const creator: PluginCreator<pluginOptions> = (opts?: pluginOptions) => {

if (selectorAST.nodes?.[0]?.nodes) {
// Prepend a space combinator and the class to the beginning of the selector.
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
selectorASTClone.nodes[0].prepend(parser.combinator({ value: ' ' }));
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
selectorASTClone.nodes[0].prepend(parser.className({ value: POLYFILL_READY_CLASSNAME }));
}

Expand Down
3 changes: 0 additions & 3 deletions plugins/postcss-focus-within/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ const creator: PluginCreator<pluginOptions> = (opts?: pluginOptions) => {

if (i === selectorAST.nodes[0].nodes.length - 1) {
// Append the class to the end of the selector if not combinator or pseudo element was found.
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
selectorAST.nodes[0].append(parser.className({ value: POLYFILL_READY_CLASSNAME }));
break;
}
Expand All @@ -118,9 +117,7 @@ const creator: PluginCreator<pluginOptions> = (opts?: pluginOptions) => {

if (selectorAST.nodes?.[0]?.nodes) {
// Prepend a space combinator and the class to the beginning of the selector.
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
selectorASTClone.nodes[0].prepend(parser.combinator({ value: ' ' }));
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
selectorASTClone.nodes[0].prepend(parser.className({ value: POLYFILL_READY_CLASSNAME }));
}

Expand Down
5 changes: 0 additions & 5 deletions plugins/postcss-pseudo-class-any-link/src/replace-any-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,21 @@ function modifiedSelector(selector: string, areaHrefNeedsFixing: boolean) {
}

if (!areaHrefNeedsFixing) {
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
replacements.push([linkAST.clone(), visitedAST.clone()]);
return;
}

const tags = getTagElementsNextToPseudo(pseudo);
if (tags.includes('area')) {
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
replacements.push([linkAST.clone(), visitedAST.clone(), hrefAST.clone()]);
return;
}

if (tags.length) {
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
replacements.push([linkAST.clone(), visitedAST.clone()]);
return;
}

// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
replacements.push([linkAST.clone(), visitedAST.clone(), areaHrefAST.clone()]);
});

Expand All @@ -89,7 +85,6 @@ function modifiedSelector(selector: string, areaHrefNeedsFixing: boolean) {

replacementsCartesianProduct.forEach((replacement) => {
const clone = selectorsAST.clone();
// @ts-expect-error https://github.com/postcss/postcss-selector-parser/pull/284
clone.walkPseudos((pseudo) => {
if (pseudo.value.toLowerCase() !== ':any-link' || (pseudo.nodes && pseudo.nodes.length)) {
return;
Expand Down