I am using bootstrap 4 alpha-6,I want to modify bootstrap 4's primary color(#0275d8),is there a variable that can set the value?
Asked
Active
Viewed 3,846 times
1
-
Here's a link to the documentation: https://v4-alpha.getbootstrap.com/getting-started/options/ – creimers Apr 04 '17 at 20:22
2 Answers
0
You could overwrite the relevant css styles with your own custom styles, otherwise it might be worth it to look into using Less. Less is a CSS Preprocessor that allows you to store variables used in your css such as color values. You can see an example of this below:
@brand-primary: darken(#428bca, 6.5%); // #337ab7
@brand-success: #5cb85c;
@brand-info: #5bc0de;
@brand-warning: #f0ad4e;
@brand-danger: #d9534f;
.masthead {
background-color: @brand-primary;
}
You can read more on bootstraps use of Less here

Tony
- 2,890
- 1
- 24
- 35
-1
Update 2019 Bootstrap 4
It's easily done with SASS. Just set the $brand-primary
$primary
variable.
$primary: hotpink;

Carol Skelly
- 351,302
- 90
- 710
- 624
-
In Bootstrap v4. It's been changed to the `$primary` variable. https://github.com/twbs/bootstrap/blob/v4.0.0/scss/_variables.scss – kartikluke Jan 22 '18 at 08:35