Topic: cannot override btn-primary colors
MaximeGheraille asked 4 years ago
Expected behavior
When using npm run build
or npm run start
it does never change.
I want to be able to change the color via my custom class, like this:
<MDBBtn rounded size="sm" onClick={() => CreateActualite()} className="background-color-blue">Cree</MDBBtn>
my scss file
$blue: #2d2180!important;
.background-color-blue{
background-color: $blue;
}
Actual behavior
I still get the standard color from bootstrap for the .btn-primary when inspecting in chrome dev
.btn-primary {
color: #fff;
background-color: #4285f4 !important;
}
this is what it gives (which is the wrong color)
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Open
- User: Free
- Premium support: No
- Technology: MDB React
- MDB Version: 4.27.0
- Device: PC
- Browser: chrome
- OS: windows
- Provided sample code: No
- Provided link: No
Piotr Glejzer staff commented 4 years ago
this is a bug. I checked it and there is a problem with that. Did you try inline styling?
MaximeGheraille commented 4 years ago
yes and it does not work because the bootstrap css overrides it and with inline styling I cannot add the ' !important' to override the bootstrap css
Piotr Glejzer staff commented 4 years ago
Yes, I know about that.