Git Product home page Git Product logo

Comments (6)

failwyn avatar failwyn commented on July 17, 2024

Do you know if this worked on the 2019 version?

also, purely out of curiosity, is there an advantage to using custom properties instead of sass properties?

from webcompiler.

moehoward avatar moehoward commented on July 17, 2024

It worked perfectly well in VS 2019 (for years).
Hence, I noticed the error when I upgraded.

Go to https://jsonformatter.org/scss-to-css and type:

$var-name: green;
p {
--my-custom-color: $var-name;
}

See the result to the right.
See the result in WebCompiler2019 (a.k.a. WebCompiler)
See the result in WebCompiler2022.

More good info here:
https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties
https://developer.mozilla.org/en-US/docs/Web/CSS/--*

Sass has advantages over css and that's the whole point using WebCompiler - right?
:<)

from webcompiler.

failwyn avatar failwyn commented on July 17, 2024

I'll take a look to see if I can identify what changed during the upgrade, it makes it easier to track down the issue knowing if it worked in 2019.

I was wondering about the mixing of variable types, the custom properties with the sass variables; I haven't used custom properties and was just wondering if I was missing something with them.

from webcompiler.

failwyn avatar failwyn commented on July 17, 2024

It looks like this was caused by a change to node-sass

sass/node-sass#2627
sass/libsass#2621
https://sass-lang.com/documentation/style-rules/declarations#custom-properties

Can you try the following and let me know if it works?

$var-name: green;
p {
--my-custom-color: #{$var-name};
}

from webcompiler.

moehoward avatar moehoward commented on July 17, 2024

Pingo that was it!
But dang, they moved my cheese!

So instead of using (which worked in Web Compiler 2019):
$var-name: green;
p {
--my-custom-color: $var-name;
}

I now have to use (in Web Compiler 2022):
$var-name: green;
p {
--my-custom-color: #{$var-name};
}

Well, it's obvious I suck at keeping current with Sass.
https://sass-lang.com/documentation/interpolation

Thanks a Million!

from webcompiler.

failwyn avatar failwyn commented on July 17, 2024

I hate when they move the cheese!

// I'm not gonna lie, I haven't been keeping current with it either, I should go peruse the documentation to see what I'm missing out on

from webcompiler.

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.