mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Only set media type when one is present
Defaulting to media="screen" causes the browser to ignore inline @media print and other queries. Fixes #612
This commit is contained in:
@@ -195,7 +195,7 @@ function createCSS(styles, sheet, lastModified) {
|
||||
if ((css = document.getElementById(id)) === null) {
|
||||
css = document.createElement('style');
|
||||
css.type = 'text/css';
|
||||
css.media = sheet.media || 'screen';
|
||||
if( sheet.media ){ css.media = sheet.media; }
|
||||
css.id = id;
|
||||
document.getElementsByTagName('head')[0].appendChild(css);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user