How can I recompile Bootstrap so that my theme color changes in _variables.scss when I am using Angular with CSS?

家住魔仙堡 提交于 2021-02-11 12:38:06

问题


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:

  1. create a variable.scss file in your project and write this
$primary: red; 
  1. in your main.scss file
@import 'variables';
@import '~bootstrap/scss/bootstarp'
  1. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!