How can I use Razor in CSS files?
I'm using Razor View Engine for some time and I was curious about using it on style sheets. I can use Razor in <style>
blocks of .cshtml files but I was wondering if I can use it in external .css files also (would like to have a .cscss format). So I googled it and found two things:
The first one is LESS: "The dynamic stylesheet language". It seems easy-to-use and powerful with all the features but I need Razor-C#, really.
The second is Dynamic CSS Using Razor Engine, a CodeProject article which is more like what I want but it has no caching or pre-compiling support (by "no support" I meant the writer didn't mention these aspects). I also would like to have some syntax highlighting in Visual Studio but this is secondary.
So, how can I write Razor in CSS files with minimum performance cost and preferably with syntax highlighting?
- Is there a "more complete" project for that?
- Can I improve the above project to achieve caching/compiling? If so, how?
As a side note:
I found a project called RazorJS. It's like the Javascript version of the same thing I want for CSS with its caching support. I'm mentioning this just to clarify my needs. I don't need to use Razor in Javascript currently but I guess if I make it out with CSS, doing the same thing with Javascript wouldn't be too hard.