问题
So far I have found the SCSS file node_modules/bootstrap/scss/_variables.scss
to change the primary color for example and I have stopped npm and run the front-end again but changes in that file are not shown in the actual behaviour.
My guess is that it's because I need to recompile Bootstrap but as I have never used SCSS and my Angular project uses CSS I have no idea nor I could find an easy explanation on how to achieve this.
Thanks in advance !
回答1:
TODO:
- create a variable.scss file in your project and write this
$primary: red;
- in your main.scss file
@import 'variables';
@import '~bootstrap/scss/bootstarp'
- compile it.
here is the example
NOTE: like this you can modify avery variables that BS used.
来源:https://stackoverflow.com/questions/63324908/how-can-i-recompile-bootstrap-so-that-my-theme-color-changes-in-variables-scss