The leading 0 in fractional numeric values of CSS properties is optional and values like margin: .5rem; are globally supported by rendering engines.
Current CSS Coding Convention misses a clear guideline on how to write fractional numbers with leading 0. Therefore we're facing differences across project implementations, for example in
Vector:
Minerva:
It is definitely micro-optimization, but there is a fairly good amount of those values available.
I'd suggest to include a cropping mechanism for the following fractional numeric values (mind the preceding whitespace/colon/comma!):
- 0.7rem -> .7rem
- :0.7rem -> :.7rem
- -0.7rem -> -.7rem
- ,0.7 -> ,.7
Code example before:
.mw-selector {
color: rgba( 255,255,255,0.7 );
margin: -0.7rem;
padding:0.7rem 0.77rem;
}and after:
.mw-selector{color:rgba(255,255,255,.7);margin:-.7rem;padding:.7rem .77rem;}