Setup: MVC 5, .NET 4.7.2, Web Compiler extension in Visual Studio 2019.
What I want to do is dynamically set SASS variables based on values stored in a database. I am building a small site that will be used by multiple companies and I want to be able to change the styles (mainly colors) based on data loaded from the database. What I've done in the past is to just dynamically generate CSS using a generic handler, but I'd like to use SASS on this project and I don't know if there is a way to set SASS variables from .NET code.
I tried to use an @import and a generic handler, but that did not work because web compiler is trying to pull that code in and create the CSS on file save. It could be I am going about this completely the wrong way, so if there is another idea I'm open to it.
I read this post Set a SASS variable depending that I could potentially use, by setting all of the colors in the SCSS file and then set the body class dynamically using ViewBag. It would not be my preferred approach though.