Config Key: no_leading_zero
Description: If in CSS values leading 0s immediately preceeding a decimal should be removed or prevented.
Available since version: 0.7.0 (Current: )
Type: boolean
Default: false
Support
Languages: CSS, Less, SCSS, Titanium Style Sheets
Beautifiers: Pretty Diff
Comparison Table
Examples
Invisible characters are shown with the following symbols:
Carriage Return = ␍; Line Feed = ␊; Tab = ⇥; Whitespace = ·.
🚧 Original Code
.c1·{␊
····font-size:·0.3em;␊
····border-radius:·00000.5;␊
}␊
.c2·{␊
····font-size:·01.3em;␊
····border-radius:·01.5;␊
}␊
.c3·{␊
····font-size:·10.3em;␊
····border-radius:·10.5;␊
}
🔧 true
Using Pretty Diff beautifier:
.c1·{␊
··font-size:·.3em;␊
··border-radius:·.5;␊
}␊
.c2·{␊
··font-size:·1.3em;␊
··border-radius:·1.5;␊
}␊
.c3·{␊
··font-size:·10.3em;␊
··border-radius:·10.5;␊
}␊
How to configure
A .unibeautify.json
file would look like the following:
{
"CSS": {
"indent_size": 2,
"indent_char": " ",
"no_leading_zero": true,
"beautifiers": [
"Pretty Diff"
]
}
}
Difference from original
@@ -1,12 +1,12 @@
.c1·{␊
-····font-size:·0.3em;␊
-····border-radius:·00000.5;␊
+··font-size:·.3em;␊
+··border-radius:·.5;␊
}␊
.c2·{␊
-····font-size:·01.3em;␊
-····border-radius:·01.5;␊
+··font-size:·1.3em;␊
+··border-radius:·1.5;␊
}␊
\ No newline at end of file
.c3·{␊
-····font-size:·10.3em;␊
-····border-radius:·10.5;␊
-}
+··font-size:·10.3em;␊
+··border-radius:·10.5;␊
+}␊
🔧 false
Using Pretty Diff beautifier:
.c1·{␊
··font-size:·0.3em;␊
··border-radius:·0.5;␊
}␊
.c2·{␊
··font-size:·1.3em;␊
··border-radius:·1.5;␊
}␊
.c3·{␊
··font-size:·10.3em;␊
··border-radius:·10.5;␊
}␊
How to configure
A .unibeautify.json
file would look like the following:
{
"CSS": {
"indent_size": 2,
"indent_char": " ",
"no_leading_zero": false,
"beautifiers": [
"Pretty Diff"
]
}
}
Difference from original
@@ -1,12 +1,12 @@
.c1·{␊
-····font-size:·0.3em;␊
-····border-radius:·00000.5;␊
+··font-size:·0.3em;␊
+··border-radius:·0.5;␊
}␊
.c2·{␊
-····font-size:·01.3em;␊
-····border-radius:·01.5;␊
+··font-size:·1.3em;␊
+··border-radius:·1.5;␊
}␊
\ No newline at end of file
.c3·{␊
-····font-size:·10.3em;␊
-····border-radius:·10.5;␊
-}
+··font-size:·10.3em;␊
+··border-radius:·10.5;␊
+}␊
🚧 Original Code
.c1·{␊
····font-size:·0.3em;␊
····border-radius:·00000.5;␊
}␊
.c2·{␊
····font-size:·01.3em;␊
····border-radius:·01.5;␊
}␊
.c3·{␊
····font-size:·10.3em;␊
····border-radius:·10.5;␊
}
🔧 true
Using Pretty Diff beautifier:
.c1·{␊
··font-size:·.3em;␊
··border-radius:·.5;␊
}␊
.c2·{␊
··font-size:·1.3em;␊
··border-radius:·1.5;␊
}␊
.c3·{␊
··font-size:·10.3em;␊
··border-radius:·10.5;␊
}␊
How to configure
A .unibeautify.json
file would look like the following:
{
"Less": {
"indent_size": 2,
"indent_char": " ",
"no_leading_zero": true,
"beautifiers": [
"Pretty Diff"
]
}
}
Difference from original
@@ -1,12 +1,12 @@
.c1·{␊
-····font-size:·0.3em;␊
-····border-radius:·00000.5;␊
+··font-size:·.3em;␊
+··border-radius:·.5;␊
}␊
.c2·{␊
-····font-size:·01.3em;␊
-····border-radius:·01.5;␊
+··font-size:·1.3em;␊
+··border-radius:·1.5;␊
}␊
\ No newline at end of file
.c3·{␊
-····font-size:·10.3em;␊
-····border-radius:·10.5;␊
-}
+··font-size:·10.3em;␊
+··border-radius:·10.5;␊
+}␊
🔧 false
Using Pretty Diff beautifier:
.c1·{␊
··font-size:·0.3em;␊
··border-radius:·0.5;␊
}␊
.c2·{␊
··font-size:·1.3em;␊
··border-radius:·1.5;␊
}␊
.c3·{␊
··font-size:·10.3em;␊
··border-radius:·10.5;␊
}␊
How to configure
A .unibeautify.json
file would look like the following:
{
"Less": {
"indent_size": 2,
"indent_char": " ",
"no_leading_zero": false,
"beautifiers": [
"Pretty Diff"
]
}
}
Difference from original
@@ -1,12 +1,12 @@
.c1·{␊
-····font-size:·0.3em;␊
-····border-radius:·00000.5;␊
+··font-size:·0.3em;␊
+··border-radius:·0.5;␊
}␊
.c2·{␊
-····font-size:·01.3em;␊
-····border-radius:·01.5;␊
+··font-size:·1.3em;␊
+··border-radius:·1.5;␊
}␊
\ No newline at end of file
.c3·{␊
-····font-size:·10.3em;␊
-····border-radius:·10.5;␊
-}
+··font-size:·10.3em;␊
+··border-radius:·10.5;␊
+}␊
🚧 Original Code
.c1·{␊
····font-size:·0.3em;␊
····border-radius:·00000.5;␊
}␊
.c2·{␊
····font-size:·01.3em;␊
····border-radius:·01.5;␊
}␊
.c3·{␊
····font-size:·10.3em;␊
····border-radius:·10.5;␊
}
🔧 true
Using Pretty Diff beautifier:
.c1·{␊
··font-size:·.3em;␊
··border-radius:·.5;␊
}␊
.c2·{␊
··font-size:·1.3em;␊
··border-radius:·1.5;␊
}␊
.c3·{␊
··font-size:·10.3em;␊
··border-radius:·10.5;␊
}␊
How to configure
A .unibeautify.json
file would look like the following:
{
"SCSS": {
"indent_size": 2,
"indent_char": " ",
"no_leading_zero": true,
"beautifiers": [
"Pretty Diff"
]
}
}
Difference from original
@@ -1,12 +1,12 @@
.c1·{␊
-····font-size:·0.3em;␊
-····border-radius:·00000.5;␊
+··font-size:·.3em;␊
+··border-radius:·.5;␊
}␊
.c2·{␊
-····font-size:·01.3em;␊
-····border-radius:·01.5;␊
+··font-size:·1.3em;␊
+··border-radius:·1.5;␊
}␊
\ No newline at end of file
.c3·{␊
-····font-size:·10.3em;␊
-····border-radius:·10.5;␊
-}
+··font-size:·10.3em;␊
+··border-radius:·10.5;␊
+}␊
🔧 false
Using Pretty Diff beautifier:
.c1·{␊
··font-size:·0.3em;␊
··border-radius:·0.5;␊
}␊
.c2·{␊
··font-size:·1.3em;␊
··border-radius:·1.5;␊
}␊
.c3·{␊
··font-size:·10.3em;␊
··border-radius:·10.5;␊
}␊
How to configure
A .unibeautify.json
file would look like the following:
{
"SCSS": {
"indent_size": 2,
"indent_char": " ",
"no_leading_zero": false,
"beautifiers": [
"Pretty Diff"
]
}
}
Difference from original
@@ -1,12 +1,12 @@
.c1·{␊
-····font-size:·0.3em;␊
-····border-radius:·00000.5;␊
+··font-size:·0.3em;␊
+··border-radius:·0.5;␊
}␊
.c2·{␊
-····font-size:·01.3em;␊
-····border-radius:·01.5;␊
+··font-size:·1.3em;␊
+··border-radius:·1.5;␊
}␊
\ No newline at end of file
.c3·{␊
-····font-size:·10.3em;␊
-····border-radius:·10.5;␊
-}
+··font-size:·10.3em;␊
+··border-radius:·10.5;␊
+}␊
No example found. Please submit a Pull Request!