How to customize bootstrap 4 in reactjs app with reactstrap dependency?

后端 未结 2 1936
野的像风
野的像风 2021-02-09 07:19

I start developing a React app with reactstrap. I followed the Get Started running the following commands :

npm install -g create-react-app
create-react-app my-a         


        
2条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-09 07:59

    Instructions here: https://facebook.github.io/create-react-app/docs/adding-a-sass-stylesheet

    1. Install Sass: npm install node-sass --save
    2. Install reactstrap. First bootstrap: npm install bootstrap --save. Then reactstrap: npm install --save reactstrap react react-dom
    3. create your custom bootstrap theme file src/styles/custom-btsp.scss and edit as wanted (see theming v4).
    4. add import './styles/css/custom.scss'; in src/index.js

    Done!

    Here is an exemple of my custom-btsp.scss file:

    $theme-colors: (
      "primary": #ffb800
    );
    
    $btn-border-radius: 3000px;
    
    @import "~bootstrap/scss/bootstrap";
    

提交回复
热议问题