Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS @import doesn't support 'layer' or 'supports' #428

Open
JohnnyQuest1983 opened this issue Aug 30, 2024 · 0 comments · May be fixed by #429
Open

CSS @import doesn't support 'layer' or 'supports' #428

JohnnyQuest1983 opened this issue Aug 30, 2024 · 0 comments · May be fixed by #429

Comments

@JohnnyQuest1983
Copy link

JohnnyQuest1983 commented Aug 30, 2024

CSS @import supports code in the following formats:

@import url;
@import url layer;
@import url layer(layer-name);
@import url layer(layer-name) supports(supports-condition);
@import url layer(layer-name) supports(supports-condition) list-of-media-queries;
@import url layer(layer-name) list-of-media-queries;
@import url supports(supports-condition);
@import url supports(supports-condition) list-of-media-queries;
@import url list-of-media-queries;

Looking at

protected function combineImports($source, $content, $parents)
it seems that the CSS Minifier only recognises @import url; and @import url list-of-media-queries;, 'layer' and 'supports' are not checked.

Basic layer Test Case:

@import url('file1.css') layer(testLayer1);
@import url('file2.css') layer(testLayer2);

Minified Outcome (invalid code, not used by browser):

@media layer(testLayer1){/*...file1.css...*/}@media layer(testLayer2){/*...file2.css...*/}

Expected Outcome (imported files converted to appropriate @layer entries):

@layer testLayer1{/*...file1.css...*/}@layer testLayer2{/*...file2.css...*/}
@JohnnyQuest1983 JohnnyQuest1983 changed the title CSS @import doesn't supper 'layer' or 'supports' CSS @import doesn't support 'layer' or 'supports' Sep 2, 2024
@snap01 snap01 linked a pull request Sep 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant