Created
June 16, 2010 14:55
-
-
Save dbergey/440808 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Here is how to get less parsing of <style> tags for quick development | |
// I made this with less.js 1.0.17, not sure how far back it works | |
// change this to wherever your less.js is stored | |
<script src="http://dkb.local/js/lessjs/less.js"></script> | |
// then do this somewhere | |
<script> | |
var styleEls = document.getElementsByTagName('style'); | |
for (var i in styleEls) | |
(new less.Parser).parse(styleEls[i].innerHTML || '', function(e, css) { | |
styleEls[i].innerHTML = css.toCSS(); | |
}); | |
</script> |
This is unneeded from 1.0.30 and forward, just use < style type="text/less" >< /style >.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated to use innerHTML (so it doesn't insert
s) and a fallback string.