指南针可以合并 .css 文件吗?
我试图找出 Compass 是否可以合并 .css 文件,而不是在 Compass 编译 .scss 文件后使用第三方工具来合并 .css 文件。我已经浏览过网络和这里,但到目前为止什么也没有。我认为 config.rb 可能有一个选项,但我发现的只是压缩功能。
有人尝试过这个或者找到了与指南针配合良好的第三方工具吗?
I am trying to find out if Compass can merge .css files rather than using a third party tool to merge the .css files after Compass has compiled the .scss files. I have looked around the web and on here but nothing so far. I thought the config.rb may have an option for this but all I found is compress feature.
Anyone tried this or have a found a third party tool that works well with compass?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我很长一段时间以来一直想做同样的事情。我最终决定采用以下解决方案。
采用以下结构(即您的模块位于
sass
的子文件夹中)更新
main.scss
以包含:运行使用以下命令(来自
project
文件夹)来构建这只会编译
main.scss
,然后依次导入并导入每个模块。此外,compressed
样式选项可缩小输出。I'd wanted to do this same thing for quite some time. I finally settled on the following solution.
Take the following structure (i.e. with your modules in a sub-folder of
sass
)Update
main.scss
to contain:Run the following command (from the
project
folder) in order to buildThis just compiles
main.scss
, which inturn goes and imports each of your modules. Additionally thecompressed
style option minifies the output.它不是压缩,但您可以通过在文件名称前添加下划线来排除文件被复制到输出目录的情况。例如:
It's not compression, but you can exclude files from being copied to the output directory by prepending an underscore to their names. For example: