Keeda
❔ How can I import json file inside a sass file?
I have looked around in the web for various solutions and found it could be done easily in javascript with a node package called node-sass and sass-json-importer something like that. But none of that solution works according to my requirement.
What I am looking for is a nuget package which can help my life easier?
I came across this nuget package called LibSassHost it can compile sass files with imported json into css files but whenever I compile them via code it through exception regarding the wrong sass format.
There is another extension webcompiler in VS2022 can I use this to achieve the same but from my knowledge it doesn't allows json imported statements at the top.
Basically What I want to do is get some variables like hosturl etc from some json file and then be able to import that json file inside a sass file so I can use the urls in various classes? Does this makes any sense?
6 replies