How do you override the default Bootstrap CSS?
- Load your CSS after the Bootstrap CSS.
- Change the CSS variables: for a button use
--bs-btn-bg,--bs-btn-border-color, and for the page use--bs-body-font-family,--bs-border-radius. - If a rule does not win, make your selector a little more specific. Avoid
!importantwhen possible. - For a big change, use Sass variables.
- Never edit the files in
node_modulesor the downloaded Bootstrap files.
Learn more about the similar topics:
| Tutorials |
|---|
| Bootstrap Color Modes (Dark Mode) |
| Bootstrap Customization |
| Exercises & Assignments |
|---|
| Create a button which switches the page to dark mode |