【问题标题】:use a different file extension instead of css while compiling with Compass使用 Compass 编译时使用不同的文件扩展名而不是 css
【发布时间】:2015-01-20 15:01:15
【问题描述】:

我正在尝试像平常一样编译一个 sass 文件,但我希望输出文件具有文件扩展名“.scss.liquid”而不是常规的“.css”。

例如: 如果我有文件“main.scss”,我希望编译时的输出是“main.scss.liquid”,而不是“main.css”。

我想要这个,因为我正在使用 shopify。

请注意:我仍然希望得到与使用 compass 正常编译时相同的输出。

更新:

值得一提的是,如果您想做这种简单的 sass,可以通过以下方式完成(我认为):

sass input.scss output.scss.liquid

但是如何使用指南针来完成这项工作

【问题讨论】:

    标签: css sass shopify liquid compass


    【解决方案1】:

    多亏了这个,我设法弄清楚了: https://coderwall.com/p/5by4ww/compass-add-min-to-the-filename

    我只是将它附加到 config.rb 文件的末尾:

    require 'fileutils'
    
    on_stylesheet_saved do |file|
      if File.exists?(file)
        filename = File.basename(file, File.extname(file))
        File.rename(file, "assets" + "/" + filename + ".scss.liquid")
      end
    end
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-05-14
      • 2015-01-16
      • 1970-01-01
      • 1970-01-01
      • 2017-01-27
      • 1970-01-01
      • 1970-01-01
      • 2012-10-02
      相关资源
      最近更新 更多