Support for Razor alternative to SASS/SCSS/Less
I've been experimenting with the use of Razor/C# code in CSS files. Like other precompiling CSS solutions, it compiles the CSS source file to get a clean CSS output.
Two major advantages over other solutions:
– There are few limitations. Anything I can accomplish in Razor/C# I can also do in my CSS file (variables, loops, dynamic data, helpers... you name it!).
– I can use a programming language that I, and others (!), are already familiar with. My team don't have to learn any new syntax, and when a new team member is assigned he understands the code instantly.
We really need M$ to sponsor one of these technologies so we can all get on board with it!
Håkan Save Hansson commented
Thanks Scott. Web Workbench looks like an great tool.
My main point is that if we could use Razor/C# syntax in a CSS file in the same way we can in a Razor view we wouldn't have to learn yet another "programming language" like SASS, SCSS, Less or whatever. And any programmer knowing C# can handle that code.
With proper support in Visual Studio/ASP.NET/MVC we can also get built in syntax highlighting, intellisense and so on directly in the studio.
...and you can also easily add built-in support for combining and minifying these "Razor CSS" files on the fly as they get compiled (as I have done in my proof of concept implementation). (You're already working on built-in combining and minifying, I've heard.)
I'm sure there are one or another thing that you can do more elegantly in the SASS/SCSS/Less languages, as they are specially crafted for extending the CSS syntax, but most things can be done just as easy and elegant in Razor/C#. Some things get even slicker in Razor/C#. And some things that _can't_ be done in SASS/SCSS/Less can actually be done in C#.
Thanks for reading.
Have you tried http://www.mindscapehq.com/products/web-workbench?