-
Notifications
You must be signed in to change notification settings - Fork 148
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
inline import of .css file gets transformed to a generic css import #141
Comments
Just found out this is not unexpected behavior;
What am I doing wrong here? |
Hey @UltraCakeBakery 👋 This seems related to how scss is handling that |
Hey @kaisermann 👋
main.css (screenshot from devtools) I almost feel like it is not even considering it all to be SCSS but meanwhile nested classes and other stuff works perfectly fine. |
@UltraCakeBakery having a similar issue #146 |
@DominusVilicus I haven't found a fix yet. Kinda moved on to other problems. @kaisermann do you have any idea on what's going on? |
so important and too small note
-,-this is fail <style lang="scss" >
@use "@material/icon-button";
@use "@material/drawer";
@use "@material/list";
:global() {
@include icon-button.core-styles;
@include drawer.core-styles;
@include list.core-styles;
}
</style> this is ok <style lang="scss" global>
@use "@material/icon-button";
@use "@material/drawer";
@use "@material/list";
@include icon-button.core-styles;
@include drawer.core-styles;
@include list.core-styles;
</style> |
@UltraCakeBakery Is this still happening to you? @qwabra this seems to be unrelated to the current issue. Besides that, if I'm not mistaken, |
Yes. It just prints the entire line in the compiled css file. Doesn't matter if i use |
I resolved this issue in my codebase by using // rollup.config.js
import sveltePreprocess from 'svelte-preprocess';
import atImport from 'postcss-import';
// snip
preprocess: sveltePreprocess({
sourceMap: !production,
defaults: {
style: 'scss'
},
sass: {
includePaths: ['src'],
},
postcss: {
plugins: [atImport({path: ['src/styles']})],
},
}),
// snip What I think this is doing is inlining the CSS that's imported via an |
@benwoodward The postcss transformer is the last one to be executed. It's working for you because you're importing a plain css file and the postcss plugin is handling that for ya. |
Closing this as Thanks for the help anyways @kaisermann 👋 |
Describe the bug
In my project i'm trying to import normalize.css in to my _layout.svelte component.
Instead of it getting impoted in to the main.css file it just adds the generic CSS import line instead.
Logs
None
To Reproduce
Expected behavior
Inline import it instead of having the generic css import line.
Stacktraces
None
Information about your project:
The text was updated successfully, but these errors were encountered: