In CSS I'm used to define styles globally for all elements like button { /* style stuff */ }
Is there a way to set all buttons to bootstraps btn btn-sm btn-default
without explicitly setting the class for every element?
For example something like
button {
btn btn-sm btn-default
}
If you are familiar with LESS, you could edit the bootstrap core and prepend each .btn
with button
, so .btn, button
, and recompile the less. buttons.less is the file you want to be looking at.
Alternatively, just do a search and replace for ".btn {
" and replace it with ".btn, button {
" in the compiled css of bootstrap. Although you will have to do this multiple times and be quite careful, since there are a lot of subclasses in bootstrap (.btn-default
, .btn-primary
and so on).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With