LeaVerou/prefixfree — Issue #18: Stylesheet media type is not included
Author: kaij
Created: 2011-10-21 15:35:49+00:00
State: open

I used this great library in a new project. However, I ran into a problem by having a media="print" stylesheet. When using prefixfree, the print stylesheet gets included without media type - which will show the print view of the page (which has completely different layout in my case).

There is a workaround by including the "@media print {}" in the print stylesheet. However, I think it is safer to carry the media type into the newly created stylesheet node. Maybe you could include this patch:

73 +: media = link.getAttribute('media'),
97+: if (media) { style.setAttribute('media', media); }

Regards, Kai