【问题标题】:Rails 3.1 HAML SCSS filter in mailer views邮件视图中的 Rails 3.1 HAML SCSS 过滤器
【发布时间】:2012-01-29 13:32:33
【问题描述】:

haml 中是否有类似现有 :sass-filter 的 :scss 过滤器?

在 goolge 中查找,但没有找到有用的东西..

还有没有 scss-filer 存在的原因(据我所知)?

【问题讨论】:

  • 我很好奇,您是否尝试过使用:sass 过滤器?此外,您可能希望将此作为问题提交到 HAML github 存储库 github.com/nex3/haml/issues

标签: ruby-on-rails ruby ruby-on-rails-3 haml sass


【解决方案1】:

https://gist.github.com/1646573

# haml_scss_initializer.rb
module Haml::Filters
  module Scss
    include Base
    lazy_require 'sass/plugin'

    def render(text)
      ::Sass::Engine.new(text, ::Sass::Plugin.engine_options.merge(:syntax => :scss)).render
    end
  end
end

【讨论】:

    【解决方案2】:

    没有过滤器,我在github页面上发布了一个问题:

    https://github.com/nex3/haml/issues/474

    【讨论】:

      猜你喜欢
      • 2011-12-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-06
      • 1970-01-01
      • 1970-01-01
      • 2012-02-22
      • 2011-12-12
      相关资源
      最近更新 更多