diff --git a/lib/less/browser.js b/lib/less/browser.js index a4ddd326..8d1726e2 100644 --- a/lib/less/browser.js +++ b/lib/less/browser.js @@ -14,23 +14,16 @@ less.env = location.hostname == '127.0.0.1' || less.watch = function () { return this.watchMode = true }; less.unwatch = function () { return this.watchMode = false }; -// Load the stylesheets when the body is ready -var readyTimer = setInterval(function () { - if (document.body) { - sheets = select('link[rel="stylesheet/less"]'); +sheets = select('link[rel="stylesheet/less"]'); - clearInterval(readyTimer); - - loadStyleSheets(function (root, sheet, env) { - if (env.local) { - log("less: loading " + sheet.href + " from local storage."); - } else { - createCSS(root.toCSS(), sheet, env.lastModified); - log("less: parsed " + sheet.href + " successfully."); - } - }); +loadStyleSheets(function (root, sheet, env) { + if (env.local) { + log("less: loading " + sheet.href + " from local storage."); + } else { + createCSS(root.toCSS(), sheet, env.lastModified); + log("less: parsed " + sheet.href + " successfully."); } -}, 10); +}); if (less.env === 'development' && /!refresh/.test(location.hash)) { less.watchMode = true;