-
-
Notifications
You must be signed in to change notification settings - Fork 833
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
fix(web-fonts): hoist @import
in single layer
#2909
Conversation
✅ Deploy Preview for unocss ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I don't know if it's better to handle it in |
Done. |
@import
on top of css@import
in single layer
packages/core/src/generator/index.ts
Outdated
.map(async (i) => { | ||
const css = await i.getCSS(preflightContext) | ||
return css ? hoistAtImport(css) : undefined | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should put in the rule, not the core, as it, again, coupled and affect every generation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean, when writing them, put them into the import layer actively?
prelights: [
{
layer: 'imports',
getCSS: ()=> `@import ....`
}
]
coupled and affect every generation
Although it is a bit coupled, uno can correct it in the final stage by Regexp, and extract the correct import css to the layer. Make it a default behavior? 😅
Pushed the changes. In some CSS parsers, If the change looks good to you, we could merge it and proceed. |
@import
in single layer@import
in single layer
Thanks your guide, keep it in mind.🥰 |
When building with this warning, i think we can sort the css ahead of time.