Commit 5b2a4c5
authored
feat(formatter): add writeCSSComments option (#1112)
Currently when writing the css file comments before each class is
present.
```css
/* Background */ .bg { color: #cdd6f4; background-color: #1e1e2e;-moz-tab-size: 2; -o-tab-size: 2; tab-size: 2; }
/* PreWrapper */ .chroma { color: #cdd6f4; background-color: #1e1e2e;-moz-tab-size: 2; -o-tab-size: 2; tab-size: 2; }
/* Error */ .chroma .err { color: #f38ba8 }
/* LineLink */ .chroma .lnlinks { outline: none; text-decoration: none; color: inherit }
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
/* LineHighlight */ .chroma .hl { background-color: #45475a }
...
```
(Also why is there a .bg class, feels like that could collide)
This is probably a micro-optimization but felt like the comments didn't
serve any purpose except clarity and debug value.
Also skipped writing empty css classes.
Before and after writing css file for style "catppuccin-mocha"
```sh
> ls -l -B
.rw-r--r-- 4,934 jocke 25 Jul 01:51 with.css
.rw-r--r-- 3,337 jocke 25 Jul 01:50 without.css
```
I didn't wanna make any changes to the output without changes to the
options.
Maybe we could just remove the comments all together and skip this extra
logic.1 parent 02ff9d4 commit 5b2a4c5
1 file changed
+33
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
| |||
131 | 134 | | |
132 | 135 | | |
133 | 136 | | |
134 | | - | |
135 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
136 | 140 | | |
137 | 141 | | |
138 | 142 | | |
| |||
197 | 201 | | |
198 | 202 | | |
199 | 203 | | |
| 204 | + | |
200 | 205 | | |
201 | 206 | | |
202 | 207 | | |
| |||
416 | 421 | | |
417 | 422 | | |
418 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
419 | 439 | | |
420 | 440 | | |
421 | 441 | | |
| 442 | + | |
422 | 443 | | |
423 | | - | |
| 444 | + | |
424 | 445 | | |
425 | 446 | | |
426 | 447 | | |
427 | | - | |
| 448 | + | |
428 | 449 | | |
429 | 450 | | |
430 | 451 | | |
431 | 452 | | |
432 | | - | |
433 | | - | |
| 453 | + | |
| 454 | + | |
434 | 455 | | |
435 | 456 | | |
436 | 457 | | |
437 | 458 | | |
438 | 459 | | |
439 | 460 | | |
440 | 461 | | |
441 | | - | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
442 | 467 | | |
443 | 468 | | |
444 | 469 | | |
| |||
456 | 481 | | |
457 | 482 | | |
458 | 483 | | |
459 | | - | |
460 | | - | |
| 484 | + | |
461 | 485 | | |
462 | 486 | | |
463 | 487 | | |
| |||
0 commit comments