@ripple-ts/prettier-plugin 0.2.166 → 0.2.168
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/package.json +2 -2
- package/src/index.js +32 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ripple-ts/prettier-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.168",
|
|
4
4
|
"description": "Ripple plugin for Prettier",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"prettier": "^3.6.2",
|
|
28
|
-
"ripple": "0.2.
|
|
28
|
+
"ripple": "0.2.168"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {},
|
|
31
31
|
"files": [
|
package/src/index.js
CHANGED
|
@@ -1966,6 +1966,14 @@ function printRippleNode(node, path, options, print, args) {
|
|
|
1966
1966
|
nodeContent = printCSSNestingSelector(node, path, options, print);
|
|
1967
1967
|
break;
|
|
1968
1968
|
|
|
1969
|
+
case 'PseudoClassSelector':
|
|
1970
|
+
nodeContent = printCSSPseudoClassSelector(node, path, options, print);
|
|
1971
|
+
break;
|
|
1972
|
+
|
|
1973
|
+
case 'PseudoElementSelector':
|
|
1974
|
+
nodeContent = printCSSPseudoElementSelector(node, path, options, print);
|
|
1975
|
+
break;
|
|
1976
|
+
|
|
1969
1977
|
case 'Block':
|
|
1970
1978
|
nodeContent = printCSSBlock(node, path, options, print);
|
|
1971
1979
|
break;
|
|
@@ -4481,6 +4489,30 @@ function printCSSNestingSelector(node, path, options, print) {
|
|
|
4481
4489
|
return '&';
|
|
4482
4490
|
}
|
|
4483
4491
|
|
|
4492
|
+
function printCSSPseudoClassSelector(node, path, options, print) {
|
|
4493
|
+
// PseudoClassSelector for :hover, :global(), etc.
|
|
4494
|
+
const parts = [':', node.name || ''];
|
|
4495
|
+
|
|
4496
|
+
// If it has args (like :global(.classname)), print them
|
|
4497
|
+
if (node.args !== null && node.args !== undefined) {
|
|
4498
|
+
parts.push('(', node.args, ')');
|
|
4499
|
+
}
|
|
4500
|
+
|
|
4501
|
+
return concat(parts);
|
|
4502
|
+
}
|
|
4503
|
+
|
|
4504
|
+
function printCSSPseudoElementSelector(node, path, options, print) {
|
|
4505
|
+
// PseudoElementSelector for ::before, ::after, etc.
|
|
4506
|
+
const parts = ['::', node.name || ''];
|
|
4507
|
+
|
|
4508
|
+
// If it has args (like ::slotted(span)), print them
|
|
4509
|
+
if (node.args !== null && node.args !== undefined) {
|
|
4510
|
+
parts.push('(', node.args, ')');
|
|
4511
|
+
}
|
|
4512
|
+
|
|
4513
|
+
return concat(parts);
|
|
4514
|
+
}
|
|
4515
|
+
|
|
4484
4516
|
function printCSSBlock(node, path, options, print) {
|
|
4485
4517
|
// CSS Block contains declarations
|
|
4486
4518
|
if (node.children && node.children.length > 0) {
|