2015-03-07

In my preceding post I described Greatness ASP.NET Web Config File. In this post I'm taking subsequent step - start off working with Compass - CSS Authoring Framework. Instantly right after installing Internet Workbench, you'll be able to create/edit SCSS file, which are compiled into CSS. By default, Internet Workbench compile SCSS files with SASS compiler. But there's a trick:

Setup Compass Project
Appropriate click on project node in answer explorer, then pick "Setup Compass Project"





It will modify your project by adding "sass" folder with "ie.scss", "print.scss" and "screen.scss" files and compass project configuration file "config.rb" in root.

"config.rb" is really a Ruby file, contains configuration properties, such "css_dir" - the directory where the css stylesheets are kept and "sass_dir" - the directory where the sass stylesheets are kept.

From now, all SASS files, positioned in "sass_dir" will be complied by Compass compiler and, accordingly, CSS output files will be stored in "css_dir".

Should you never desire to alter your ASP.NET project layout, you could choose to adjust Compass configuration.

I choose to help keep all SCSS files in separate directory, consequently I produced "Content/scss" folder and moved existing *.scss files there.
Then I changed config.rb file as bellow:

# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "Content"
sass_dir = "Content/scss"
images_dir = "images"
javascripts_dir = "Scripts"

Now Internet Workbench recognizes scss files as part of Compass project and runs Compass compiler against them. Output css files stay within the identical place, so no need to update views.

Get Magic of Compass

Just open Compass API references and commence coding. Lest consume certainly one of standard functions of Compass - Reset. add following line in beginning of SCSS file @import "compass/reset"; The only line will create plenty of reset rules in output css



Compass has a large amount of valuable functions, and all of them are obtainable in your ASP.NET application.

Best ASP.NET Hosting Recommendation

ASPHostPortal.com provides its customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. ASPHostPortal.com offers ASP.NET hosting starts from $1/month only. They also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable ASP.NET Hosting, ASPHostPortal.com should be your best choice.

Show more