Global scss variables for Angular components without importing them everytime

后端 未结 3 1339
梦如初夏
梦如初夏 2021-02-02 07:09

I do already have SCSS variables defined in src/styles/settings/_variables.scss and I am importing them into src/styles.scss, but still these variables

3条回答
  •  爱一瞬间的悲伤
    2021-02-02 07:32

    In angular 8 work for me.

    In your _variable.scss file you have to add:

    :root{--my-var:#fabada}
    

    After that go in your angular.json and add this in "styles":

    {"input":"yourPath/_variables.scss"}
    

提交回复
热议问题