-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Description
I noticed that
<style type="text/less">...</style>
doesn't appear to be working in IE. It throws an exception when trying to set the innerHTML of the generated style element. I was able to implement a fix for this by changing:
function loadStyles() {
...
new(less.Parser)().parse(styles[i].innerHTML || '', function (e, tree) {
styles[i].type = 'text/css';
styles[i].innerHTML = tree.toCSS();
});
...
}
to:
function loadStyles() {
...
new(less.Parser)().parse(styles[i].innerHTML || '', function (e, tree) {
styles[i].type = 'text/css';
if (styles[i].styleSheet) { // IE
styles[i].styleSheet.cssText = tree.toCSS();
} else {
styles[i].innerHTML = tree.toCSS();
}
});
...
}
This seems to resolve the issue. I also noticed less was already doing this logic for link elements, so I believe this is the correct fix.
Metadata
Metadata
Assignees
Labels
No labels