mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
don't give style tags a 'title' attribute, it screws things up. [browser]
This commit is contained in:
@@ -107,18 +107,16 @@ function loadStyleSheet(sheet, callback, async) {
|
||||
}
|
||||
|
||||
function createCSS(styles, sheet, lastModified) {
|
||||
var css, title, id;
|
||||
var css;
|
||||
|
||||
// If there is no title set, use the filename, minus the extension
|
||||
title = sheet.title || sheet.href.match(/(?:^|\/)([-\w]+)\.[a-z]+$/i)[1];
|
||||
id = 'less:' + title;
|
||||
var id = 'less:' + (sheet.title || sheet.href.match(/(?:^|\/)([-\w]+)\.[a-z]+$/i)[1]);
|
||||
|
||||
// If the stylesheet doesn't exist, create a new node
|
||||
if ((css = document.getElementById(id)) === null) {
|
||||
css = document.createElement('style');
|
||||
css.type = 'text/css';
|
||||
css.media = 'screen';
|
||||
css.title = title;
|
||||
css.id = id;
|
||||
document.getElementsByTagName('head')[0].appendChild(css);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user