mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
support type=text/less and text/x-less for specifying stylesheets
This commit is contained in:
@@ -61,11 +61,13 @@ try {
|
||||
// Get all <link> tags with the 'rel' attribute set to "stylesheet/less"
|
||||
//
|
||||
var links = document.getElementsByTagName('link');
|
||||
var typePattern = /^text\/(x-)?less$/;
|
||||
|
||||
less.sheets = [];
|
||||
|
||||
for (var i = 0; i < links.length; i++) {
|
||||
if (links[i].rel === 'stylesheet/less') {
|
||||
if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&
|
||||
(links[i].type.match(typePattern)))) {
|
||||
less.sheets.push(links[i]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user