Code Monkey home page Code Monkey logo

Comments (6)

epegzz avatar epegzz commented on July 23, 2024 1

Thanks for reporting @olafur164, will fix it ASAP! :)

from sass-vars-loader.

olafur164 avatar olafur164 commented on July 23, 2024

@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.

epegzz avatar epegzz commented on July 23, 2024

@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.

olafur164 avatar olafur164 commented on July 23, 2024

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.

epegzz avatar epegzz commented on July 23, 2024

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.

epegzz avatar epegzz commented on July 23, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.