Answer the question
In order to leave comments, you need to log in
How to gracefully override bootstrap properties?
Good evening!
I am using bootstrap components to build in a project.
Often it is necessary to overlap some properties.
For example: outline: none
Is there a more elegant way out of this situation? (mixins?)
Thanks!
Answer the question
In order to leave comments, you need to log in
The first thing to do is to try to set it up via _valiables.scss
If there is no required option, override the CSS property at the end of your
styles.scss file:
import bootstrap
.button { ... }
If there are many such overrides (define the threshold yourself), then you can override some bootstrap mixins.
// Core variables and mixins
import "variables";
import "mixins";
// here are your redefined mixins
.. then the rest of the bootstrap
Here the trick is that of the two mixins with the same name, the one declared later in the code will be used.
upd did not notice that you have a stylus. I don’t know how he reacts to the re-declaration of the mixin.
Is there a more elegant way out of this situation? (mixins?)
.btn
// bootstrap styles
.mybtn
@extends .btn
//..
.mybtn2
@extends .btn
//..
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question