SASS / SCSS @import前面的〜是什么意思/做什么? [英] What does the ~ in front of the SASS/SCSS @import mean/do?
问题描述
我被告知GitHub在我的SASS / SCSS @import
路径之前开始使用〜
。尝试谷歌,但找不到合适的答案。我想这甚至都不太费劲,但是我想学习它。
I was told on GitHub to start using a ~
before my SASS/SCSS @import
paths. Tried to Google it but couldn't find a proper answer. I guess it's too newbie to even bother writing about, but I would like to learn it.
推荐答案
〜是一个相对的引用你的代码文件。
~ is a relative reference to your code files.
〜当我们导入角度材质主题和其他库时,指的是node_modules。
,如果是〜,如果SASS引用你的本地文件加载你的部分。例如:@import'~scss / variables';
通常是文件系统的默认位置引用。我不确定正确的术语。
~ refers to node_modules when we import angular material themes and other libraries. while in case of ~ in case of SASS references to your local files to load your partials. for eg: @import '~scss/variables'; Generally its a default location reference to the file system. I am not sure about the correct terminologies.
这篇关于SASS / SCSS @import前面的〜是什么意思/做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!