Skip to content

Commit 38cbaf0

Browse files
authored
AUI: Added support for pseudo selectors in part conditions (#226)
1 parent cd4d7da commit 38cbaf0

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "AUI: Added support for pseudo selectors in part conditions",
4+
"packageName": "@adaptive-web/adaptive-ui",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/adaptive-ui/src/core/modules/selector.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,13 @@ export function makeSelector(params: StyleModuleEvaluateParameters, state: Inter
7171
// Add the part selector
7272
if (params.part) {
7373
if (params.part === "*") {
74-
selectors.push("*");
74+
selectors.push(" *");
75+
} else if (params.part.startsWith("::")) {
76+
selectors.push(params.part);
7577
} else {
76-
selectors.push(`${params.part}${params.partCondition || ""}${params.stateOnContext !== true ? stateSelector : ""}`);
78+
selectors.push(` ${params.part}${params.partCondition || ""}${params.stateOnContext !== true ? stateSelector : ""}`);
7779
}
7880
}
7981

80-
return selectors.join(" ");
82+
return selectors.join("");
8183
}

0 commit comments

Comments
 (0)