在不同的项目/站点之间共享 SCSS 变量 [英] Share SCSS variables across different Projects/Sites
问题描述
我想知道是否可以在来自中央静态服务器/位置的不同项目之间共享我的 SASS 变量.
例如:
<前>[静态服务器上的变量文件]||{项目 1 |{项目2然后加载变量 |加载相同编译CSS} |变量和编译 CSS}项目2的布局不同,但颜色相同.这就是我想分享变量的原因.
感谢您的任何帮助/建议!
SASS 中的 @import
语句没有导入远程 http 文件的能力,它会将 http 导入视为一个简单的css 导入代替.(SASS @import
文档)但是,GitHub 上有一个名为 remote-sass 的项目你问什么.
RemoteSass 是一个允许 Sass 导入远程 sass/scss 的小宝石基于 HTTP/S 的样式表.有了这个,你可以设置一个中央服务器来为您的样式表资产提供服务并在许多人之间共享 css应用程序.
I was wondering if it's possible to share my SASS variables between different projects from a central static server/location.
For example:
[Vars file on static server] | | {Project 1 | {Project 2 load vars then | load the same compile CSS} | vars and compile CSS}
The layout of project 2 is different but it has the same colours. That's why I want to share the vars.
Thanks for any help/suggestions!
The @import
statement in SASS does not have the capability to import remote http files, it would treat an http import as a simple css import instead. (SASS @import
documentation)
However, there is a project on GitHub called remote-sass which does what you ask.
RemoteSass is a small gem that allows Sass to import remote sass/scss stylsheets over HTTP/S. With this, you can set up a central server to serve your stylesheet assets and share css among your many applications.
这篇关于在不同的项目/站点之间共享 SCSS 变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!