mirror of
https://github.com/less/less.js.git
synced 2026-01-22 21:58:14 -05:00
less.js now works in firefox, safari and chrome
This commit is contained in:
@@ -7,11 +7,17 @@ for (var i = 0; i < sheets.length; i++) {
|
||||
(function (sheet) { // Because the functions here are async, we need to create a closure
|
||||
xhr(sheet.href, function (data) {
|
||||
new(less.Parser)({ optimization: 3 }).parse(data, function (e, root) {
|
||||
var css = document.createElement('style');
|
||||
var css = document.createElement('style'), styles;
|
||||
css.type = 'text/css';
|
||||
css.media = 'screen';
|
||||
css.title = sheet.title || sheet.href.match(/\/([-\w]+)\.[a-z]+$/i)[1];
|
||||
css.innerHTML = root.toCSS();
|
||||
styles = root.toCSS();
|
||||
|
||||
if (css.styleSheet) {
|
||||
css.styleSheet.cssText = styles;
|
||||
} else {
|
||||
css.appendChild(document.createTextNode(styles));
|
||||
}
|
||||
document.getElementsByTagName('head')[0].appendChild(css);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var tree = exports;
|
||||
if (typeof(require) !== 'undefined') { var tree = exports }
|
||||
|
||||
tree.find = function (obj, fun) {
|
||||
for (var i = 0, r; i < obj.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user