Permalink
Browse files

(new) parse style tags with type=text/less

  • Loading branch information...
1 parent 6426ac5 commit 45592cb3cc6c71c4ab493436139f8d1c51e61087 cloudhead committed Jul 1, 2010
Showing with 11 additions and 0 deletions.
  1. +11 −0 lib/less/browser.js
View
@@ -72,6 +72,17 @@ for (var i = 0; i < links.length; i++) {
}
}
+var styles = document.getElementsByTagName('style');
+
+for (var i = 0; i < styles.length; i++) {
+ if (styles[i].type.match(typePattern)) {
+ new(less.Parser)().parse(styles[i].innerHTML || '', function (e, tree) {
+ styles[i].type = 'text/css';
+ styles[i].innerHTML = tree.toCSS();
+ });
+ }
+}
+
var startTime = endTime = new(Date);
less.refresh = function (reload) {

0 comments on commit 45592cb

Please sign in to comment.