Inline css with @use
css from node_modules
#569
Replies: 6 comments
-
This probably isn't an issue with the inlining, these styles are likely not ending up in your |
Beta Was this translation helpful? Give feedback.
-
Thanks @damiani. I checked In my dev tools I can see that I get a 404 for the font files though - which is not the case if I don't use the inline version. I can't see how that is related though. |
Beta Was this translation helpful? Give feedback.
-
Hi @molerat619, Do you have a sample project where we can se the replicated issue? Or better yet, could you provide a project/repo which replicates said issue? |
Beta Was this translation helpful? Give feedback.
-
Hi @erickpatrick , yes I have just created a repository so you can have a better look: https://github.com/molerat619/jigsaw-dummy I verified that the issue occurs there too. I use node v12, run npm watch and npm run build (see package.json). If I use inline, I just get a square and the icon is not found. If I use it non inline, the icon (airplane) is displayed. |
Beta Was this translation helpful? Give feedback.
-
Hi @molerat619, I've just had time to look into your issue today. I've cloned your repository and ran the following:
Doing so, also gave me the same
The Material Design Icons uses a relative path to load its font files. Once you However, there's a solution for you. Instead of using
Once you do so, you will be able to see your real icon, as intended: Please, let us know if this helped your case and if your are now able to have the intended behaviour. Regards, |
Beta Was this translation helpful? Give feedback.
-
@erickpatrick thanks so much for looking into this and helping me! In fact, the But I thought Do you have an idea how to achieve that, other than copying the css from the node modules and having it inside my project directly? The downside here obviously is that it won't get updated with the dependency and I have to remember to update it manually. |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm trying to use this:
And it works, except that external css files are not considered. So in my main.scss I have this:
Not sure if it's actually good practice to point to a scss in the node_modules. But either way - when I run the build the materialdesignicons css is not inside the style-tag.
Any idea how to solve this?
Thank you for the great work on this project. It's a game changer!
Beta Was this translation helpful? Give feedback.
All reactions