Global scss variables in react-create-app

后端 未结 2 894
借酒劲吻你
借酒劲吻你 2021-02-19 20:02

In my src folder, I have assets/styles folder where my global scss files are.

In my index.scss I import them like this

@import \'assets/styl         


        
2条回答
  •  轮回少年
    2021-02-19 20:21

    Use partials when importing parts into index.scss

    @import 'assets/styles/colors';
    @import 'assets/styles/links';
    @import 'assets/styles/basics';
    

    The filenames should be

    _colors.scss
    _links.scss
    _basics.scss
    

    You can read more about this in the SASS docs under the Partial section.

提交回复
热议问题