Tips/UsingSass

Using Sass

If you like using  Sass for writing CSS, you can. nanoc comes with a Sass filter by default.

Step 1: Create an item that'll hold your Sass stylesheet. Put your Sass code in the item's content file.

Step 2: Create a rule (or modify an existing rule) so that the Sass stylesheet is filtered properly. For example:

compile '/assets/style/*/' do
  filter :sass
end

route '/assets/style/*/' do
  item.identifier.chop + '.css' # so that the /assets/style/screen/ item is compiled to /assets/style/screen.css
end

Step 3: There is no step 3.