I suggest you ...

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.

26 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Håkan Save HanssonHåkan Save Hansson shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    3 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • FelickzFelickz commented  ·   ·  Flag as inappropriate

        We really need M$ to sponsor one of these technologies so we can all get on board with it!

      • Håkan Save HanssonHåkan Save Hansson commented  ·   ·  Flag as inappropriate

        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.

        ...not to mention that we don't have to install and manage any special add-ons or third-party libs to our project/Visual Studio/web server/client side JavaScript to handle the CSS files (compile them and serve them as pure CSS).

        ...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.

      Feedback and Knowledge Base