CSS 什么是指南针,什么是 sass ......它们有什么不同?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13777215/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is Compass, what is sass...how do they differ?
提问by Chiko
I would like to start using compass and sass to speed up development. At the moment, I have installed Sass on a mac and instructed it to watch scss file for input, and a css file for generated output.
我想开始使用指南针和 sass 来加快开发速度。目前,我已经在 mac 上安装了 Sass 并指示它观察 scss 文件的输入,以及生成的输出的 css 文件。
From many articles, Sass is used with Compass, I'm wondering why that is the case and just what does Compass add that Sass comes without? If you can give an example, the better.
从许多文章中,Sass 与 Compass 一起使用,我想知道为什么会这样,并且 Compass 添加了什么 Sass 没有?如果能举个例子就更好了。
Thanks
谢谢
采纳答案by Jonathan de M.
From Sass and Compass in Action, by Wynn Netherland, Nathan Weizenbaum, Chris Eppstein, and Brandon Mathis:
来自Wynn Netherland、Nathan Weizenbaum、Chris Eppstein 和 Brandon Mathis 的Sass 和 Compass in Action:
1.3 What is Compass?
Compass helps Sass authors write smarter stylesheets and empowers a community of designers and developers to create and share powerful frameworks. Put simply, Compass is a Sass framework, designed to make the work of styling the web smooth and efficient. Much like Rails as a web application framework for Ruby, Compass is a collection of helpful tools and battle-tested best practices for Sass.
1.3 什么是指南针?
Compass 帮助 Sass 作者编写更智能的样式表,并授权设计师和开发人员社区创建和共享强大的框架。简而言之, Compass 是一个 Sass 框架,旨在使 Web 样式化工作顺畅高效。与作为 Ruby 的 Web 应用程序框架的 Rails 非常相似, Compass 是一组有用的工具和经过实战考验的 Sass 最佳实践。
(emphasis added)
(强调)
回答by cimmanon
Compass is an extension of Sass (as in Compass requires Sass). It has its own compiler (instead of sass --watch
, you use compass watch
). It has a large collection of mixins and functions that you'll find incredibly useful (while commonly pointed to for generating vendor prefixed CSS3 properties, it can do things like automatically generate spritemaps and the CSS to go with them).
Compass 是 Sass 的扩展(如 Compass 需要 Sass)。它有自己的编译器(而不是sass --watch
您使用compass watch
)。它有大量的 mixin 和函数,你会发现它们非常有用(虽然通常用于生成供应商前缀的 CSS3 属性,但它可以做一些事情,比如自动生成 spritemaps 和 CSS 以配合它们)。
Compass is also built in such a way that you can bundle your own bootstraptype library for easily deploying in multiple projects without the need to copy/paste the source for it in each one.
Compass 还以这样一种方式构建,您可以捆绑自己的引导程序类型库,以便在多个项目中轻松部署,而无需在每个项目中复制/粘贴源代码。