Dynamically re-import Sass partials after amending variables

后端 未结 1 1544
刺人心
刺人心 2021-01-29 08:35

I am working on a project utilizing Twitter Bootstrap pre-compiled with Sass.

Each time I override a variable, I have to re-import the _bootstrap.sass file

相关标签:
1条回答
  • 2021-01-29 09:32

    There is no language that will do what you're suggesting. If you specify $margin: 10px and then run some code that uses that variable, you can't change it to 20px and expect it to retroactively change the results of code that's already been run.

    If you want $margin: 20px, then you specify it that way before you run the procedures (mixins, imports, etc.) that depends on it. In other words, move your Bootstrap imports so that they are after you set your variables.

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