@pandacss/generator 0.0.0-dev-20231019215914 → 0.0.0-dev-20231020132218
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +17 -4
- package/dist/index.mjs +17 -4
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -518,12 +518,25 @@ function getDeepestNode(node) {
|
|
|
518
518
|
function cleanupSelectors(css2, varSelector) {
|
|
519
519
|
const root = import_postcss2.default.parse(css2);
|
|
520
520
|
root.walkRules((rule) => {
|
|
521
|
+
const selectors = [];
|
|
521
522
|
rule.selectors.forEach((selector) => {
|
|
522
|
-
|
|
523
|
-
if (res.length === 0)
|
|
524
|
-
return;
|
|
525
|
-
rule.selector = res.join(varSelector);
|
|
523
|
+
selectors.push(selector.trim());
|
|
526
524
|
});
|
|
525
|
+
const ruleSelector = selectors.join(", ");
|
|
526
|
+
if (ruleSelector === varSelector) {
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
const trimmedSelector = selectors.join(",");
|
|
530
|
+
if (trimmedSelector === varSelector) {
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
const selectorsWithoutVarRoot = selectors.map((selector) => {
|
|
534
|
+
const res = selector.split(varSelector).filter(Boolean);
|
|
535
|
+
return res.join("");
|
|
536
|
+
}).filter(Boolean);
|
|
537
|
+
if (selectorsWithoutVarRoot.length === 0)
|
|
538
|
+
return;
|
|
539
|
+
rule.selector = selectorsWithoutVarRoot.join(", ");
|
|
527
540
|
});
|
|
528
541
|
return root.toString();
|
|
529
542
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -487,12 +487,25 @@ function getDeepestNode(node) {
|
|
|
487
487
|
function cleanupSelectors(css2, varSelector) {
|
|
488
488
|
const root = postcss2.parse(css2);
|
|
489
489
|
root.walkRules((rule) => {
|
|
490
|
+
const selectors = [];
|
|
490
491
|
rule.selectors.forEach((selector) => {
|
|
491
|
-
|
|
492
|
-
if (res.length === 0)
|
|
493
|
-
return;
|
|
494
|
-
rule.selector = res.join(varSelector);
|
|
492
|
+
selectors.push(selector.trim());
|
|
495
493
|
});
|
|
494
|
+
const ruleSelector = selectors.join(", ");
|
|
495
|
+
if (ruleSelector === varSelector) {
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
const trimmedSelector = selectors.join(",");
|
|
499
|
+
if (trimmedSelector === varSelector) {
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
const selectorsWithoutVarRoot = selectors.map((selector) => {
|
|
503
|
+
const res = selector.split(varSelector).filter(Boolean);
|
|
504
|
+
return res.join("");
|
|
505
|
+
}).filter(Boolean);
|
|
506
|
+
if (selectorsWithoutVarRoot.length === 0)
|
|
507
|
+
return;
|
|
508
|
+
rule.selector = selectorsWithoutVarRoot.join(", ");
|
|
496
509
|
});
|
|
497
510
|
return root.toString();
|
|
498
511
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/generator",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20231020132218",
|
|
4
4
|
"description": "The css generator for css panda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"pluralize": "8.0.0",
|
|
21
21
|
"postcss": "^8.4.31",
|
|
22
22
|
"ts-pattern": "5.0.5",
|
|
23
|
-
"@pandacss/core": "0.0.0-dev-
|
|
24
|
-
"@pandacss/is-valid-prop": "0.0.0-dev-
|
|
25
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
26
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
27
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
28
|
-
"@pandacss/types": "0.0.0-dev-
|
|
23
|
+
"@pandacss/core": "0.0.0-dev-20231020132218",
|
|
24
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20231020132218",
|
|
25
|
+
"@pandacss/logger": "0.0.0-dev-20231020132218",
|
|
26
|
+
"@pandacss/shared": "0.0.0-dev-20231020132218",
|
|
27
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20231020132218",
|
|
28
|
+
"@pandacss/types": "0.0.0-dev-20231020132218"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/pluralize": "0.0.30",
|
|
32
32
|
"hookable": "5.5.3",
|
|
33
|
-
"@pandacss/fixture": "0.0.0-dev-
|
|
33
|
+
"@pandacss/fixture": "0.0.0-dev-20231020132218"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"prebuild": "tsx scripts/prebuild.ts",
|