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

@import css files does not work once the assets get compiled #24

Open
coorasse opened this issue Feb 7, 2024 · 3 comments
Open

@import css files does not work once the assets get compiled #24

coorasse opened this issue Feb 7, 2024 · 3 comments

Comments

@coorasse
Copy link

coorasse commented Feb 7, 2024

I have an application.scss file that imports various files, some are SCSS and some simple CSS.
I like to keep CSS files because dartsass does not need to process them and the feedback loop while developing is much faster, so I like to keep some files as simple CSS.
The problem is that the @import "components/my_component.css" instruction is not compiled. I'd expect it to simply inline the CSS file as it is, but the instruction is kept. This even works in development mode so it seems that everywork will just work fine until you release in production and "components/my_component.css" cannot be resolved anymore.

I think this is quite unexpected behavior. I'd have liked my CSS file to be inlined.

Thoughts?

@sronsiek
Copy link

I came across the same thing - in my case removing the .css extension from all @import statements fixed.it.

@johnnyshields
Copy link
Contributor

@coorasse can you try removing .css from your @import statements? If that works, it will be the accepted workaround for this, and I'll close the issue.

@kieraneglin
Copy link

Not OP, but I can confirm removing .css resolves the issue for me

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

No branches or pull requests

4 participants