According to this page, the CSS letter-spacing property has a default value of normal.
Notably, non-default values are added to the default value:
The most important point to note when using letter-spacing is that the value specified does not change the default, it is added to the default spacing the browser applies (based on the font metrics). letter-spacing also supports negative values, which will tighten the appearance of text, rather than loosening it.
According to this definition, 0 should be equivalent to the default value of normal since 0 + X = X.
1) Is it valid to use 0 as a replacement for the default value of normal? (This is for a slider implementation.)
2) Why isn't 0 the default value? Why introduce another value (i.e., normal)?
This test on CodePen also suggests a value of 0 is, indeed, equivalent to the default value of normal.
.loose {
letter-spacing: 2px;
}
.tight {
letter-spacing: -1px;
}
.zero {
letter-spacing: 0;
}
.normal {
letter-spacing: normal;
}
<p>This type has no additional letter-spacing applied.</p>
<p class="loose">This type is letter-spaced loosely at <code>2px</code>.</p>
<p class="tight">This type is letter-spaced tightly at <code>-1px</code></p>
<p class="zero">This type is letter-spaced at <code>0</code></p>
<p class="normal">This type is letter-spaced at <code>normal</code></p>
No both aren't exactly equivalent. If you check the current specification
normal
The spacing is the normal spacing for the current font. This value allows the user agent to alter the space between characters in order to justify text.
Then
<length>
This value indicates inter-character space in addition to the default space between characters. Values may be negative, but there may be implementation-specific limits. User agents may not further increase or decrease the inter-character space in order to justify text.
In most of the cases, they will render the same but as you can read, the user agent doesn't handle both the same.
The definition in the Draft of the next level seems to have changed slightly and both are now the same.
For legacy reasons, a computed letter-spacing of zero yields a resolved value (getComputedStyle() return value) of normal..
You can also read here: https://github.com/w3c/csswg-drafts/issues/1484
CSS2 used to treat normal different than 0, so computing differently was a requirement. Now that the spec treats them the same ...
I don't know if all the browsers are already implementing this level but you can most likely consider them the same