As this article suggesting
or different external CSS for different media would be better option?
in terms of maintainability, site performance.
As this article suggesting
or different external CSS for different media would be better option?
in terms of maintainability, site performance.
Combined Style Sheet Pros:
Combined Style Sheet Cons:
Basically, if you can programmatically add CSS files to your client based on the media (as long as you only send ONE css file in the end), then yes, build multiple CSS files based on the @media.
If you cannot add css programmatically, then I would suggest combining them into a single css file (since you have to send them all to the client regardless), thus reducing the number of http requests by the client.
fewer http requests = faster page loads.
You could use media-dependent @import rules like so:
@import url("print.css") print;
@import url("projection.css") projection, tv;
it should work in everything but IE5-7 (as per: http://www.westciv.com/wiki/CSS_Guide:_Media#mediaspecific ) I can't test for IE8 so you might be disappointed there too.
it would result in a very small initial CSS load, then upload just the needed stylesheets based on media.