Reputation: 41
I'm using the "rem" unit for all my "modern" websites, to make this compatible with ie7-8 I'm using a less function ".font-size(10);"
that outputs "font-size:10px; font-size:1rem;"
As I am using rem for practical everything (width, top, letter-spacing,...) my css would be much leaner without the pixel fallback. How difficult would it be making a .htc file that automatically formats rem into px? Are there other ways without js?
Upvotes: 1
Views: 1063
Reputation: 228182
If you need to support IE7/8, just stick with the LESS fallback function.
It's simply not worth trying to get rid of the pixel fallback to save bytes.
Let's exaggerate and say you have 100 instances of font-size: 10px;
in your CSS. That's 100*16 bytes, which is just ~1.6KB. And it will be even less than that after HTTP compression. It's negligible.
You probably have more important things to worry about.
Upvotes: 2