Bootstrap

How to implement custom color modes in Bootstrap 5.3?

March 18, 2026

download ready
Thank You
Your submission has been received.
We will be in touch and contact you soon!

Bootstrap 5.3 officially supports only light and dark color modes. However, it is technically possible to create custom color modes using the data-bs-theme attribute by overriding Bootstrap’s CSS variables. Since Bootstrap 5.3 is fully CSS-variable driven, any custom theme name (e.g., teal, brand, custom) will work as long as the required variables are defined, even though these modes are not officially documented or maintained by Bootstrap.

CSS Overrides:-

Code

[data-bs-theme="teal"] { 
  --bs-primary: #20c997; 
  --bs-primary-rgb: 32, 201, 151;
}
      

HTML Implementation:-

Code

<!DOCTYPE html>
<html lang="en" data-bs-theme="teal">
<head>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
  <div class="container py-5">
    <div class="btn btn-primary mb-3">Teal Primary Button</div>
    <div class="card bg-primary text-white p-4">
      <h5>Custom Teal Theme Card</h5>
      <p>All components adapt automatically</p>
    </div>
  </div>
</body>
</html>
      
Hire Now!

Need Help with Bootstrap Development ?

Work with our skilled bootstrap developers to accelerate your project and boost its performance.
**Hire now**Hire Now**Hire Now**Hire now**Hire now

How to implement custom color modes in Bootstrap 5.3?

Bootstrap 5.3 officially supports only light and dark color modes. However, it is technically possible to create custom color modes using the data-bs-theme attribute by overriding Bootstrap’s CSS variables. Since Bootstrap 5.3 is fully CSS-variable driven, any custom theme name (e.g., teal, brand, custom) will work as long as the required variables are defined, even though these modes are not officially documented or maintained by Bootstrap.

CSS Overrides:-

Code

[data-bs-theme="teal"] { 
  --bs-primary: #20c997; 
  --bs-primary-rgb: 32, 201, 151;
}
      

HTML Implementation:-

Code

<!DOCTYPE html>
<html lang="en" data-bs-theme="teal">
<head>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
  <div class="container py-5">
    <div class="btn btn-primary mb-3">Teal Primary Button</div>
    <div class="card bg-primary text-white p-4">
      <h5>Custom Teal Theme Card</h5>
      <p>All components adapt automatically</p>
    </div>
  </div>
</body>
</html>