scss-prettier 4.0.22 → 4.0.24

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/LICENSE.txt CHANGED
@@ -1,27 +1,27 @@
1
- Proprietary License
2
-
3
- Copyright (c) Daekyung Yoo. All rights reserved.
4
-
5
- This software and associated documentation files (the "Software") are the
6
- exclusive property of Daekyung Yoo.
7
-
8
- 1. GRANT OF USE: You are granted a non-exclusive, non-transferable license
9
- to use the Software solely through official distribution channels
10
- (Visual Studio Code Marketplace, npm registry, and the author's servers)
11
- for your personal or internal business purposes.
12
-
13
- 2. RESTRICTIONS: You may NOT, without prior written permission from the
14
- copyright holder:
15
- - Copy, modify, merge, or create derivative works of the Software
16
- - Distribute, sublicense, sell, or transfer the Software
17
- - Reverse engineer, decompile, or disassemble the Software
18
- - Remove or alter any proprietary notices or labels
19
-
20
- 3. TERMINATION: This license is effective until terminated. It will
21
- terminate automatically if you fail to comply with any term of this
22
- license.
23
-
24
- 4. DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
25
- KIND, EXPRESS OR IMPLIED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
26
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM THE USE
27
- OF THE SOFTWARE.
1
+ Proprietary License
2
+
3
+ Copyright (c) Daekyung Yoo. All rights reserved.
4
+
5
+ This software and associated documentation files (the "Software") are the
6
+ exclusive property of Daekyung Yoo.
7
+
8
+ 1. GRANT OF USE: You are granted a non-exclusive, non-transferable license
9
+ to use the Software solely through official distribution channels
10
+ (Visual Studio Code Marketplace, npm registry, and the author's servers)
11
+ for your personal or internal business purposes.
12
+
13
+ 2. RESTRICTIONS: You may NOT, without prior written permission from the
14
+ copyright holder:
15
+ - Copy, modify, merge, or create derivative works of the Software
16
+ - Distribute, sublicense, sell, or transfer the Software
17
+ - Reverse engineer, decompile, or disassemble the Software
18
+ - Remove or alter any proprietary notices or labels
19
+
20
+ 3. TERMINATION: This license is effective until terminated. It will
21
+ terminate automatically if you fail to comply with any term of this
22
+ license.
23
+
24
+ 4. DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
25
+ KIND, EXPRESS OR IMPLIED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
26
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM THE USE
27
+ OF THE SOFTWARE.
package/README.md CHANGED
@@ -3,14 +3,14 @@
3
3
 
4
4
  **Professional CSS/SCSS/LESS formatter with property sorting, inline & expanded modes, and smart cascade protection.**
5
5
 
6
- The only formatter that combines **property sorting + inline formatting** in a single tool. No more juggling Prettier + Stylelint + postcss-sorting.
6
+ The only formatter that combines **property sorting + inline formatting** in a single tool no extra plugins or config needed.
7
7
 
8
8
  ---
9
9
 
10
10
  ## Why SCSS Prettier?
11
11
 
12
- | Feature | Prettier | Stylelint+Order | CSScomb | **SCSS Prettier** |
13
- |---------|:--------:|:---------------:|:-------:|:-----------------:|
12
+ | Feature | Tool A | Tool B | Tool C | **SCSS Prettier** |
13
+ |---------|:------:|:------:|:------:|:-----------------:|
14
14
  | Property Sorting | No | Plugin | Dead | **Built-in** |
15
15
  | Inline Mode | No | No | Yes | **Yes (default)** |
16
16
  | Expanded Mode | Yes | N/A | Yes | **Yes** |
@@ -20,6 +20,12 @@ The only formatter that combines **property sorting + inline formatting** in a s
20
20
  | Cascade Protection | No | No | No | **Yes** |
21
21
  | Active Maintenance | Yes | Yes | No | **Yes** |
22
22
 
23
+ ### Inline Formatting
24
+ <img src="https://github.com/user-attachments/assets/e1f20be8-6a23-46fb-990f-a84277d9876f" width="600" />
25
+
26
+ ### Property Sorting
27
+ <img src="https://github.com/user-attachments/assets/21fa9fc8-7158-4512-a09f-f741a64480f6" width="600" />
28
+
23
29
  ---
24
30
 
25
31
  ## Quick Start
@@ -31,10 +37,12 @@ The only formatter that combines **property sorting + inline formatting** in a s
31
37
  .box { color: red; padding: 10px; background: blue; display: flex; margin: 5px; }
32
38
 
33
39
  /* After - Ctrl+S */
34
- .box { display: flex; padding: 10px; margin: 5px; background: blue; color: red; }
40
+ .box {
41
+ display: flex; padding: 10px; margin: 5px; color: red; background: blue;
42
+ }
35
43
  ```
36
44
 
37
- Properties are automatically sorted: **position → display → width → padding → margin → backgroundcolor**
45
+ Properties are automatically sorted: **position → display → width → padding → margin → colorbackground**
38
46
 
39
47
  ---
40
48
 
@@ -65,20 +73,20 @@ Properties on one line — compact and scroll-efficient.
65
73
 
66
74
  ```scss
67
75
  .card {
68
- display: flex; padding: 20px; margin: 10px; background: white; color: #333;
76
+ display: flex; padding: 20px; margin: 10px; color: #333; background: white;
69
77
  }
70
78
  ```
71
79
 
72
80
  ### Expanded
73
- Each property on its own line — like Prettier.
81
+ Each property on its own line — traditional style.
74
82
 
75
83
  ```scss
76
84
  .card {
77
85
  display: flex;
78
86
  padding: 20px;
79
87
  margin: 10px;
80
- background: white;
81
88
  color: #333;
89
+ background: white;
82
90
  }
83
91
  ```
84
92
 
@@ -86,7 +94,7 @@ Each property on its own line — like Prettier.
86
94
  Everything compressed.
87
95
 
88
96
  ```scss
89
- .card{display:flex;padding:20px;margin:10px;background:white;color:#333;}
97
+ .card{display:flex;padding:20px;margin:10px;color:#333;background:white;}
90
98
  ```
91
99
 
92
100
  Set globally: `"scssPrettier.formatMode": "expanded"`
@@ -128,18 +136,30 @@ Override per-rule with `///expand` or `///minify` directives.
128
136
  | `scssPrettier.shorthandCascade` | `true` | Protect shorthand/longhand order |
129
137
  | `scssPrettier.removeEmptyRules` | `false` | Remove empty rule blocks |
130
138
  | `scssPrettier.duplicateProperties` | `"ignore"` | `ignore` / `warn` / `remove` |
139
+ | `scssPrettier.printWidth` | `0` | Max line length in inline mode (`0` = unlimited) |
140
+ | `scssPrettier.quoteStyle` | `"preserve"` | `preserve` / `single` / `double` |
141
+ | `scssPrettier.sortEnabled` | `true` | Sort properties (`false` keeps the written order) |
131
142
  | `scssPrettier.exclude` | `[]` | File patterns to skip |
132
143
  | `scssPrettier.debugJson` | `false` | Export AST to JSON |
133
144
 
134
145
  ### Workspace Config (`.scssPrettier.json`)
135
146
 
147
+ Put a config file in your project so the editor, the CLI and the LSP server all format the same way.
148
+ It accepts the same keys as the VS Code settings (without the `scssPrettier.` prefix):
149
+
136
150
  ```json
137
151
  {
138
- "propsPriority": ["position", "display", "width", "height", "padding", "margin"]
152
+ "formatMode": "expanded",
153
+ "indentSize": 2,
154
+ "quoteStyle": "single",
155
+ "propsPriority": ["position", "display", "width", "height", "padding", "margin"],
156
+ "exclude": ["**/vendor/**"]
139
157
  }
140
158
  ```
141
159
 
142
- Priority: `.scssPrettier.json` > VS Code settings > Default preset
160
+ The nearest `.scssPrettier.json` above the file being formatted is used.
161
+
162
+ Priority: CLI flags > `.scssPrettier.json` > VS Code settings > Defaults
143
163
 
144
164
  ---
145
165
 
@@ -181,6 +201,8 @@ Custom properties (`--*`) maintain their authored order in any selector.
181
201
  .box { margin: 10px; margin-left: 0; }
182
202
  ```
183
203
 
204
+ Declarations that only partly overlap (`border-left` and `border-color`, `padding-block` and `padding-top`, …) keep the order you wrote them in, because swapping them would change the result.
205
+
184
206
  ### Vendor Prefix Grouping
185
207
  ```scss
186
208
  /* Grouped together */