Why put in front of the file name “_” or “_” in scss/css?

前端 未结 6 1774
悲&欢浪女
悲&欢浪女 2020-12-02 10:45

Why put _ in front of the filename in scss?

_filename.scss - Why does it need _ ?

6条回答
  •  独厮守ぢ
    2020-12-02 11:15

    Files with _ (underscore) are ignored by compiler. However, all those files are imported into single, main SCSS file (i.e. styles.scss) which is actually the file that is compiled (it doesn't have _ (underscore) in it's name)

    The final goal is to compile only one SCSS file, and to have only one CSS file as a result of that, which has various advantages.

提交回复
热议问题