bootstrap dark color hex code

Bootstrap Dark Color Hex Code

By Sarah Jackson
AD

When it comes to web design, Bootstrap is a popular choice due to its responsive design and extensive UI components. But what if you want to create a dark themed website to match your content or brand? This is where understanding Bootstrap dark color hex codes comes in handy.

Hex codes are a numeric representation of colors used in digital design. Bootstrap uses these codes to style its components. Understanding the dark mode hex codes allows you to create a cohesive, engaging, and user-friendly experience for your visitors.

Bootstrap's Default Dark Color Hex Codes

Bootstrap 5 comes with a built-in dark mode. Here are some of its base colors used in dark mode:

AD
the screenshoter is displaying different numbers and symbols
the screenshoter is displaying different numbers and symbols
5 Colour Pallet Covers "Dark Romance" Aesthetic Themed 🖤
5 Colour Pallet Covers "Dark Romance" Aesthetic Themed 🖤
the user interface is designed to look like it has been made with different materials and colors
the user interface is designed to look like it has been made with different materials and colors

Color Hex Code
Primary #212529
Secondary #495057
Success #198754
Danger #dc3545
Warning #ffc107
Info #0dcaf0
Light #f8f9fa
Dark #212529

the dark red color scheme is shown in three different colors, and it appears to be from
the dark red color scheme is shown in three different colors, and it appears to be from
an image of the back side of a cell phone with different buttons and numbers on it
an image of the back side of a cell phone with different buttons and numbers on it
#251b28 · Color Palette
#251b28 · Color Palette

Using the Default Dark Hex Codes

You can use these hex codes in your CSS to apply the dark theme to your Bootstrap components. For example:

button.btn-primary { color: #fff; background-color: #212529; border-color: #212529; }

AD

This will make your primary button white text with a dark background and border.

Color Palette 038
Color Palette 038
the color scheme for baby barn owl is red, brown, and black with white flowers
the color scheme for baby barn owl is red, brown, and black with white flowers
Color Palette #306
Color Palette #306
some type of black and white color scheme on a desk with headphones, notebooks and other items
some type of black and white color scheme on a desk with headphones, notebooks and other items
Ui Ux Color Palette, Flat Color Palette, Website Color Palette, Gradient Color Design, Cmf Design, Page Layout Design, Hex Color Palette, Color Palette Challenge, Cool Color Palette
Ui Ux Color Palette, Flat Color Palette, Website Color Palette, Gradient Color Design, Cmf Design, Page Layout Design, Hex Color Palette, Color Palette Challenge, Cool Color Palette
the chess game is being played on an iphone screen, and it appears to be in progress
the chess game is being played on an iphone screen, and it appears to be in progress

Customizing Dark Color Hex Codes

You might want to customize these colors to better match your brand. You can do this by changing the variables in Bootstrap's source files. For instance, you can change the default `$primary` color to your desired hex code:

$primary: #your-own-hex-code;

AD

Find these variables in the `variables.scss` file located in the `scss` folder of Bootstrap.

Applying Dark Hex Codes in Bootstrap's Utilities

Bootstrap also has utility classes for text and backgrounds that use these dark colors. These utilities can be used to quickly apply dark styles to your elements:

Text Color Utilities

For example, `text-dark` will apply the dark text color to an element:

AD

.text-dark { color: #212529; }

Background Color Utilities

`bg-dark` will apply the dark background color:

.bg-dark { background-color: #212529; }

Using these utilities can save you time and keep your code clean and consistent.

Changing Background Colors Based on Hex Codes

Imagine you want a gradient background that transitions between two dark colors. You can use the background-image property and linear-gradient to achieve this.

background-image: linear-gradient(to right, #111, #333);

This will create a dark gradient from nearly black to a dark grey.

Like any design tool, understanding Bootstrap dark color hex codes gives you more control over your website's appearance. Don't shy away from these codes. They are powerful tools that can help you create stunning, user-friendly websites.

AD