如果 SASS 是 HAML 的一部分,为什么我在 Merb 中需要 Compass?
这是一个理论问题,也是一个实践问题。我只是无法理解所有这些技术是如何结合的......
我听到过各种各样的事情,包括:
- “HAML 和 SASS 包含在 Merb 中”
- “SASS 是 HAML 的一部分”
- “HAML 在 Merb 中工作,但要使用 SASS”你需要添加 'merb-haml' 依赖项"(?)
- "你需要 Compass 在 Merb 中运行 SASS"
- http://haml-lang.com/docs/yardoc/(搜索“merb”)
- https://github.com/Compass/compass/wiki/merb-integration
所以我的问题是:...什么?
我确实有 SASS 在 Merb 工作。我已经安装了 Compass 并使用 Chris Eppstein 的 Github wiki 上的说明来使其正常工作。但是为什么需要 Compass,为什么许多来源似乎认为不需要它并且 SASS 支持内置于 HAML 或 Merb 中?
This is a theoretical question as much as a practical one. I just can't wrap my head around how all these technologies mesh...
I have heard various things including:
- "HAML and SASS are included in Merb"
- "SASS is part of HAML"
- "HAML works in Merb, but to use SASS you need to add the 'merb-haml' dependency"(?)
- "You need Compass to run SASS in Merb"
- http://haml-lang.com/docs/yardoc/ (search for "merb")
- https://github.com/Compass/compass/wiki/merb-integration
So my question is: ...WHAT??
I do have SASS working in Merb. I have installed Compass and used the instructions on Chris Eppstein's Github wiki to get it working. But why is Compass needed, and why do many sources seem to think that it is not needed and SASS support is built into HAML or Merb?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,它们是分开的。
Sass 和 Haml 虽然在技术上截然不同,但它们捆绑在一起。它们都是
haml
gem 的一部分。所以你需要安装该 gem 才能使用 Sass。请注意,这并不要求您在应用程序中实际使用 Haml。实际上是相反的。您可以通过安装
merb-haml
gem 在 merb 中使用 Haml。这添加了 Haml 特定的 merb 生成器并插入到 merb 模板中。然而,Sass 只需要haml
依赖项(在 config/dependency.rb 中)即可与 merb 一起使用。不正确。 Compass 是一个构建在 Sass 之上的框架。它有大量用于 CSS 样式的通用函数。但使用 Sass 不需要 Compass。您可以查看文档。
No, they are separate.
Sass and Haml, while technically pretty different libraries, come bundled together. They are both part of the
haml
gem. So you need to install that gem to use Sass. Note that that doesn't require you to actually use Haml in your application.It's actually the other way round. You can use Haml in merb by installing the
merb-haml
gem. This adds Haml-specific merb generators and plugs into merbs templating. Sass however only requires thehaml
dependency (in config/dependencies.rb) for it to work with merb.Not true. Compass is a framework built on top of Sass. It has tons of general purpose functions for CSS styling. But you don't need Compass to use Sass. You can take a look at the docs.