agyanadda@gmail.com

Bootstrap Customization

Projects and Best Practices 1 min read Updated Dec 1, 2026 Topic 30 of 32

Make Bootstrap look like your brand, not like every other Bootstrap site.

1. Override with your own CSS

Link style.css after Bootstrap and write normal CSS. Easiest for small changes.

2. CSS variables (Bootstrap 5.3)

Bootstrap uses variables like --bs-primary, --bs-body-font-family, --bs-border-radius. Change them once:

:root {
  --bs-body-font-family: 'Poppins', sans-serif;
  --bs-link-color: #1f386b;
  --bs-border-radius: .75rem;
}

Components have their own variables too, e.g. .btn { --bs-btn-padding-x: 1.5rem; }.

3. Your own button colour

Create a class like .btn-brand that sets --bs-btn-bg, --bs-btn-hover-bg and friends.

4. Sass (most powerful)

Install with npm, change $primary, $font-family-base, $border-radius before importing Bootstrap, and compile. Every component uses the new values, and you can remove components you do not use to make the file smaller.

Never edit bootstrap.min.css directly — your changes are lost when you update.

Example

Example — Brand theme with CSS variables HTML
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
  :root {
    --bs-body-font-family: Georgia, serif;
    --bs-link-color: #e8590c;
    --bs-border-radius: 1rem;
  }
  .btn-brand {
    --bs-btn-bg: #1f386b;
    --bs-btn-border-color: #1f386b;
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: #2d4f94;
    --bs-btn-hover-border-color: #2d4f94;
    --bs-btn-hover-color: #fff;
    --bs-btn-padding-x: 1.5rem;
  }
</style>

<div class="container my-4">
  <div class="card shadow-sm">
    <div class="card-body">
      <h4 class="card-title">Custom brand theme</h4>
      <p class="card-text">Rounder corners, a new font and <a href="#">orange links</a> — without editing Bootstrap.</p>
      <button class="btn btn-brand">Brand button</button>
      <button class="btn btn-outline-secondary">Default button</button>
    </div>
  </div>
</div>

Test Yourself With Exercises

Exercise 1 Multiple Choice

Where should your custom CSS file be linked?

Exercise 2 True / False

Editing bootstrap.min.css directly is the best way to customise Bootstrap.

Exercise 3 Fill in the Blank

In Sass, change the $___ variable to set the main brand colour.

Frequently Asked Questions

Buttons use their own --bs-btn-* variables built at compile time. Create a custom button class with --bs-btn-bg, or change $primary with Sass.