ubuntu.com icon indicating copy to clipboard operation
ubuntu.com copied to clipboard

print.css should not be a separate network request

Open barrymcgee opened this issue 6 years ago • 3 comments

Summary

Currently, the relatively small print css file is a separate network request. this should be bundled with the main style sheet via a print media query.

Screenshot 2019-05-30 at 16 54 38

barrymcgee avatar May 30 '19 15:05 barrymcgee

Solving this with IE8 support is difficult

You can include a separately-rendered print.css with IE conditional comments - no ideal but tried-and-tested.

But! When you include the print styles in the main stylesheet in a @media print they are applied in addition to the screen styles. Sure, you could wrap the screen code in @media screen but that makes it invisible to IE8, defying the point of a lot of the work.

Polyfills for IE8 to understand media queries are an option but I don't know how they would work with print styling.

I can't think of a good solution.

deadlight avatar May 21 '20 10:05 deadlight

The conditional comments approach makes sense to avoid the extra HTTP request which is unnecessary for most browsers, but this would lead to having the print styles in two places - although I guess we can just import the same stylesheet into our main one with SASS.

steverydz avatar May 21 '20 10:05 steverydz

According to the webteam practices we don't provide support for IE8, so we can merge the print.css file with the rest of our css

petesfrench avatar Aug 14 '24 14:08 petesfrench

Closing this issue as it has been moved to the Vanilla repo, here

petesfrench avatar Jul 01 '25 07:07 petesfrench