Comments (6)
Thanks for reporting @olafur164, will fix it ASAP! :)
from sass-vars-loader.
@epegzz Cool! :D I was also wondering if there is any solution for getting the highlight in sass files.
so if i have a color variable primary
imported from a javascript file i get in the editor in sass file that $primary
exists
If not then me and a coworker of mine are thinking on working on an extension in VS Code for that.
from sass-vars-loader.
@olafur164 Syntax highlighting for variables in sass should be supported by the used sass plugin or even natively in VS Code. But it complains because it cannot find the definition of the variable, is that what you mean?
In any way, I'm myself an IntelliJ user, so my motivation to work on an VS Code plugin is a bit limited at this time :D
from sass-vars-loader.
What I was trying to say is that i don't get for example $primary highlight in sass file.
So i use your loader for importing variables from a javascript file, variables like colors, media breakpoints and etc so they are both available in the sass and javascript.
I then have https://github.com/shakacode/sass-resources-loader for loading other resources like functions and mixins.
then in the styles.scss file I do color: $primary and that works but i don't get the highlights like i get when the variable is defined in a sass resource file instead of a javascript file.
doesn't give me any complains and works fine but I always have to check inside the colors.js file to check what the variable name is if i don't remember it.
Though maybe there is a plugin in VSCode already that solves this for me, just thought to ask :) But you're saying you get this in IntelliJ natively without a plugin?
edit*
This would be autocomplete not highlight :D
from sass-vars-loader.
Nopes, I'm not getting this natively in IntelliJ either. This is a bit tricky and would definitely require a plugin :)
Hey BTW, you might not need the sass-resource-loader
, you could simply add the files containing your mixins like that:
{ loader: "@epegzz/sass-vars-loader", options: {
syntax: 'scss',
files: [
path.resolve(__dirname, 'config/my-mixins.sass')
]
}
This does inline the mixins instead of adding an @import
, but probably works as well :)
from sass-vars-loader.
@olafur164 fixed in v4.3.1
:)
Now we only add quotes if the string starts with a white space or with a leading zero in order to still solve #27
from sass-vars-loader.
Related Issues (20)
- Respect file order HOT 1
- Variable not getting to scss with web pack 3.11 in angular 5 HOT 5
- Typescript support HOT 1
- Leading zero in string gets removed HOT 14
- Missing dependencies in 4.1.0 HOT 1
- Can I use this for stylus or less ? HOT 2
- Module build failed with Vue-CLI HOT 14
- Improve documentation
- HRM doesn't work for variable files in symlinks or packages HOT 3
- Missing additional loader? Any help? HOT 1
- Variables undefined when use sass-loader.options.data attribute HOT 19
- Assertion error on precommit hook HOT 3
- SyntaxError: Unexpected token ']', web pack HOT 3
- Color names in JSON keys are interpreted as color objects by SASS HOT 4
- Unable to pass version string to add inside css comment HOT 2
- Is it possible to load the JSON file using inline loaders? HOT 1
- Passing transformer function as option HOT 3
- SassError: Invalid CSS after "..., -apple-system": expected ":", was ", BlinkMacSystemFon" HOT 1
- Webpack 5 implimentation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sass-vars-loader.