为什么要在文件名前面放“_"呢?或“_"在 scss/css 中? [英] Why put in front of the file name "_" or "_" in scss/css?
本文介绍了为什么要在文件名前面放“_"呢?或“_"在 scss/css 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么在 scss 中将 _
放在文件名前面?
Why put _
in front of the filename in scss?
_filename.scss
- 为什么需要 _
?
_filename.scss
- Why does it need _
?
推荐答案
_(下划线)是 scss 的一部分.这意味着样式表将被导入(@import)到主样式表,即styles.scss.使用部分的优势在于您可以使用多个文件来组织您的代码,并且所有内容都将被编译到一个文件中.
The _ (underscore) is a partial for scss. That means the stylesheet its going to be imported (@import) to a main stylesheet i.e. styles.scss. The advantage on using partials is that you can use many files to organize your code and everything will be compiled on a single file.
这篇关于为什么要在文件名前面放“_"呢?或“_"在 scss/css 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文