Skip to content

Commit 27e1321

Browse files
committed
chore(postcss): :where to :is when uni-app x
1 parent b9d3dfc commit 27e1321

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

packages/postcss/src/selectorParser.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ function createRuleTransform(rule: Rule, options: IStyleHandlerOptions) {
8282
selector.value = composeIsPseudo(cssSelectorReplacement.root)
8383
}
8484
else if (selector.value === ':where') {
85+
if (uniAppX) {
86+
selector.value = ':is'
87+
}
8588
// :where(.space-y-1 > :not(:last-child))
8689
// https://tailwindcss.com/docs/upgrade-guide#space-between-selector
8790
// only for tailwindcss@4

packages/postcss/test/__snapshots__/darkMode.test.ts.snap

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ exports[`darkMode > darkMode: 'selector', 1`] = `
3535
`;
3636

3737
exports[`darkMode > darkMode: 'selector', uni-app x 1`] = `
38-
".darkcbg-black:where(.dark,.dark) {
39-
--tw-bg-opacity: 1;
40-
background-color: rgba(0, 0, 0, var(--tw-bg-opacity, 1)) ;
41-
}
42-
.darkcbg-black:where(.dark,.dark) {
38+
".darkcbg-black.dark,.dark .darkcbg-black,.dark .darkcbg-black {
4339
--tw-bg-opacity: 1;
4440
background-color: rgba(0, 0, 0, var(--tw-bg-opacity, 1)) ;
4541
}"
@@ -57,7 +53,7 @@ exports[`darkMode > darkMode: ['selector', '[data-mode="dark"]'], 1`] = `
5753
`;
5854

5955
exports[`darkMode > darkMode: ['selector', '[data-mode="dark"]'], uni-app x 1`] = `
60-
".darkcbg-black {
56+
".darkcbg-black,.darkcbg-black {
6157
--tw-bg-opacity: 1;
6258
background-color: rgba(0, 0, 0, var(--tw-bg-opacity, 1)) ;
6359
}"

0 commit comments

Comments
 (0)