3 ms·
It kind of works. I didn't really expect it to work for my mamotth 9000 line CSS. Would be perfect for small projects though definitely. I write in LESS to sta
by chrisacky 14y ago
It kind of works. I didn't really expect it to work for my mamotth 9000 line CSS. Would be perfect for small projects though definitely.
I write in LESS to start with. So I took the compiled CSS from less, then tried to run it through the css2less convertor, then recompile what it generates.
Few things I noticed.
[1] Selectors get rearranged
[2] Cannot correctly handle base64 images
[3] Cannot handle child selectors. ie :child / n-th child.
[4] Comments get mangled (confirmed from another commentor below)
[5] Generates duplicate properties (where the duplicates didn't exist in precompiled). Creating duplication properties is actually correct, such is the case where you would want duplicate background properties (to support IE/FF/Chrome gracefully etc). However, you don't want it to generate identical properties where the values are also the same.
[6] font-faces wrong. (To be fair, this is hard to get right even in normal LESS).
All constructive feedback. I'm still impressed that it did a fairly decent job.
- masklinn 14y agoOther things which would be nice: * Correctly extract sets of compatibility (prefixed) properties into a mixin * Extract and fix prefixed properties missing the unprefixed version and/or other prefixes