Global scss variables in react-create-app

后端 未结 2 733
借酒劲吻你
借酒劲吻你 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:07

    you can use craco. follow this url https://www.npmjs.com/package/@craco/craco

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题