How can I get the nanoc SASS filter to use SCSS syntax?

帅比萌擦擦* 提交于 2019-12-22 03:19:14

问题


In my nanoc site, I want to specify my styles using SCSS:

p {
  em {
    color: red;
  }
}

... not SASS:

p 
  em 
    color: red

But if I try using SCSS, I get a compile error from the SASS filter. How do I get it to use SCSS?


回答1:


This turned out to be quite simple:

filter :sass, syntax: :scss

Filters in nanoc seem to follow the pattern of taking any options they're given and passing them along to whatever object actually does the work. For instance, Nanoc::Filters::Sass does this in its run method:

def run(content, params={})
  options = params.dup
  # supply default options, etc...
  engine = ::Sass::Engine.new(content, options)
  # ...
  engine.render
end

Sass::Engine, in turn, has :syntax as an available option.



来源:https://stackoverflow.com/questions/13397472/how-can-i-get-the-nanoc-sass-filter-to-use-scss-syntax

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!