matype / stylefmt

stylefmt is a tool that automatically formats stylesheets.
Other
2.1k stars 89 forks source link

number-no-trailing-zeros への対応が不完全です #208

Closed irok closed 7 years ago

irok commented 7 years ago
    letter-spacing: 1.05em;

のようなCSSがあるとき、number-no-trailing-zeros: true になっていると

    letter-spacing: 15em;

となってしまいます。

lib/formatZeros.js#L18 を以下のように変更すれば直るかと思います。

-    value = value.replace(/(\d+)(\.0+)/g, '$1')
+    value = value.replace(/(\d+)(\.0+)(?=\D|$)/g, '$1')
olegshilov commented 7 years ago

have the same issue.

font-size: calc(var(--default-font-size) * 1.075);

after format turn into this:

font-size: calc(var(--default-font-size) * 175);
matype commented 7 years ago

@irok Thank you for your report 👍