Skip to content

proposal: [CSS-cascade] import only in moment when we need it. #3050

@ghost

Description

I have suggestion/proposal:
I think, it's awkward when browser is downloading all styles included print styles, also in situation when user will not print page. So I want add something like "only-if" rule to @import...

like we have:
@import url("print.css") print;
I think we can have:
@import url("print.css") only-if("print");

or something like that.
It mean print.css will be downloaded only after user on page click on print button. Now it's impossible without JS or serverside to do that. So it's uselessly downloading styles, which user doesn't need in this moment.

(sry for my bad English).

https://www.w3.org/TR/css-cascade-3/

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions