在多个 Compass 项目中加载全局 SASS 文件
我想创建一个多个 Compass 项目将访问的 SASS 文件目录。该目录将包含许多具有相似样式(表单元素、clearfixes、重置等)的常见元素的 SASS 文件,我希望在多个项目中访问和使用这些元素。
如何在多个项目中包含这个全局 SASS 文件夹?
I'd like to create a directory of SASS files that multiple Compass projects will access. This directory would contain a number of SASS files for common elements with similar styles (form elements, clearfixes, resets, etc.) that I'd like to access and use across multiple projects.
How can I include this single global SASS folder in multiple projects?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Compass 的创建者 Chris Eppstein 有一个视频详细描述了如何做到这一点:
https://vimeo.com/13804978
本质上,您将在您的一个项目中创建一个框架,然后构建未来的任何其他项目(或追溯地向旧项目的配置添加一行)以包含该框架。
Chris Eppstein, the creator of Compass, has a video describing exactly how to do that here:
https://vimeo.com/13804978
Essentially, you'll create a framework in one of your projects, and then build any future other projects (or retroactively add a line to older projects' configurations) to include that framework.
Compass 公开了这个名为
additional_import_paths
的附加属性,它接受一个字符串数组,表示将 Sass 文件导入到项目的路径。我相信这是一种更直接的解决方案;我最近刚刚在自己的项目中实现了它,它很有魅力。
希望这有帮助。
这是进一步参考的链接:
http://compass-style.org/help/documentation/configuration-reference/
Compass exposes this additional property called
additional_import_paths
, which accepts an Array of Strings that represents paths from where to import Sass files to your project.I believe this is a way more straight-forward solution; I've just recently implemented on my own projects, and it works as a charm.
Hope this helps.
Here's the link for further reference:
http://compass-style.org/help/documentation/configuration-reference/