If I have:
.foo
{
background-color:#fff;
}
LESS converts this to:
.foo
{
background-color:white;
}
Why is this? Do browsers process named colours faster than HEX values?
I'm implementing LESS using dotless. Could this be carrying out the conversion? And if so why?
Color compression
In dotless we favour the color keyword over the hex code, if one matches. When compressing it chooses whichever is shorter.. e.g. #FFF, #FFFFFF, white then #FFF will be chosen, but in the case of red, the keyword red will be used.
In less.js every colour is replaced with a hex code.
The above quote is from the official Dotless GitHub page.
Notes:
DisableColorCompression
flag has already been added to disable this compression.DisableColorCompression
flag addresses the hex code to color name conversion item fully.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With