Sass and global imports
See original GitHub issueHi,
I’d like to automatically add imports at the top of scss files just like webpack.
So instead of adding:
@import "src/global-styling/variables.scss";
At the top of every scss file, I’d like it if it could be added automatically.
I basically need the functionality of the following PR from this library: https://github.com/hytromo/rollup-plugin-postcss-retain-sass-data#readme
The problem is that that PR doesn’t work anymore and crashes. Could anyone tell me how I could achieve this? Perhaps there is another plugin that can help me?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Sass: @import
Sass imports have the same syntax as CSS imports, except that they allow ... @import makes all variables, mixins, and functions globally accessible....
Read more >How to import Sass/SCSS mixins global? - DEV Community
I import the two .scss files in the App.js so I can access the classes/mixins/variables global. But only the classes are accessible.
Read more >How do I import a global rule in a sass file without it getting ...
And import it via import './global.sass' in my js file, the css doesn't get loaded on the page at all. How do I...
Read more >Global SCSS Imports · Issue #832 · vitejs/vite - GitHub
I have a scss file with variables I would like to use throughout my app without importing it in every <style> block. Describe...
Read more >Sass @import and Partials - W3Schools
Sass Importing Files ... Just like CSS, Sass also supports the @import directive. The @import directive allows you to include the content of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This works for me…
Got it. You can add
postcss-loader
with custom PostCSS plugin beforesass-loader
.This custom plugin will be like:
Unfortunately, in Parcel you should use 2.0 alpha, since 1.0 doesn’t have this flexibility.
Did I answer your question?