jmo*_*ohr 12 windows newline sass line-endings compass-sass
我刚刚在Windows 7上使用Ruby 1.9.2安装了Compass 0.11.5.
我的开发环境设置为对所有文件使用Unix行结尾.
我创建了一个初始的sass-test项目,并注意到它创建的所有文件都有Windows行结尾.我将现有的.css文件从另一个项目(带有unix行结尾)移动到sass文件夹中,并将扩展名更改为.scss.我运行'compass compile'命令为这个新文件生成.css文件,它创建的.css文件有Windows行结尾.
我在Compass文档中找不到任何配置选项来强制Compass生成带有Unix行结尾的文件.
是否可以将Compass配置为在Windows上生成带有Unix行结尾的文件?
经过进一步调查后,可以选择将配置选项从Compass传递给Sass.
Property Name Type Description
sass_options Hash These options are passed directly to the Sass compiler. For more details on the format of sass options, please read the sass options documentation.
Run Code Online (Sandbox Code Playgroud)
Sass有一个生成unix行结尾的选项:
:unix_newlines
如果为true,则在编写文件时使用Unix样式的换行符.只有在Windows上有意义,并且只有当Sass正在编写文件时(在Rack,Rails或Merb中,直接使用Sass :: Plugin时,或者在使用命令行可执行文件时).
似乎将以下行添加到sass-test项目的config.rb文件应该可以解决问题:
sass_options = {:unix_newlines => true}
Run Code Online (Sandbox Code Playgroud)
但是,它对创建的.css文件没有任何影响 - 它们仍然具有Windows行结尾.
根据https://github.com/chriseppstein/compass/issues/949,它应该在 sass 3.1.20 中修复,但在我的盒子上没有喜悦......仍然是 Windows 行结尾
| 归档时间: |
|
| 查看次数: |
2261 次 |
| 最近记录: |