Comments (6)
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.
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.
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.
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.
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.
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)
- The system cannot find the file specified HOT 1
- Unable to compile sass files - browserslist says caniuse-lite is outdated HOT 12
- Handlebars: compiling directory with templates HOT 1
- Bootstrap SASS compiled with get-function inside CSS HOT 2
- Incompatible error when using calc(0.25rem - 0) HOT 1
- Disable "use strict" on minifying javascript HOT 1
- [ARM64] Plugin don't start in Visual Studio 17.4 (ARM64) HOT 13
- Feature - Web Compiler for Folder View
- SCSS Not Generating Map Files HOT 4
- BuildWebCompiler2022 dotnet6 supported? HOT 1
- Javascript files not automatically being recompiled on save HOT 6
- :has(...) selector not minifying correctly HOT 1
- SCSS compiler do not exclude CSS style Comments HOT 6
- JSX Optional Chaining results in Unexpected Token error on compilation HOT 2
- Build error when upgrading to 1.14.9 HOT 2
- Exception when running the tasks HOT 5
- v1.14.9 doesn't work in VS versions earlier than 17.4 HOT 3
- The 'WebCompilerInitPackage" package did not load correctly. HOT 8
- Js Complier (1.14.9.2 ) not working in lastest Visual Studio(17.4.2)! HOT 21
- Version 14.9.2 changes "0 none" to "0 0" during minification HOT 9
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 webcompiler.