SASS CSS Preprocessor Support - SpiralAngle/SpiralAngle.Blazor.Samples.Forms GitHub Wiki
I thought getting SASS set up in Blazor was going to be a pain and force me to use some JavaScript build bits. That was something I was dreading. A CSS precompiler lets us do things like use variables and whatnot in our CSS, living without it in a large project is a nightmare.
Fortunately, the community did not let me down! It turns out some folks here https://github.com/excubo-ag/WebCompiler ported the old Visual Studio Web Compiler extension to .Net Core and does not require a javascript build manager. Just follow the instructions here and here and it's easy. In fact, it's easier (or at least fewer steps) than the old one.
It took maybe 15 minutes to set this up and it worked right away in the GitHub .Net build without any changes to the GitHub Action.
I'm still having some issues with dotnet watch run debug
that may be due to using a weird mix of .NET 5 RC 1 and .Net 3.1 on this machine. I'll update this if I get that reliably fixed. The only issue is updating the .scss files isn't triggering for some reason despite setting the watches in the .csproj
files. That's a little bit of a pain, but I'll take the easy setup and tackle the watch issue next time.
--Jim