Answer the question
In order to leave comments, you need to log in
How to remove css (less) style overrides? Too many styles are repeated?
There is a less file which has a lot of style defined like:
.btn-default,
.btn-default:hover,
.btn-default:focus,
.btn-default:active,
.btn-default.active,
.btn-default.focus,
.btn-default:active,
.btn-default:focus,
.btn-default:hover,
Answer the question
In order to leave comments, you need to log in
You can run your styles through a minifier such as "clean-css" or "cssnano", it combines repetitive code. Further, if necessary, you can decompress with some kind of "prettify".
If you have styles that have repeating rules in their selectors, then there is only one thing (I didn’t find others, but I really looked for) that will clear css from such rules - https://github.com/purifycss/purifycss
At the same time, it will clean from styles that aren't used on the page (it's so smart that it even takes into account js-generated class names)
This applies to styles like
.btn-default:active,
.btn-default.active,
.btn-default.active,
.btn-default.focus,
.btn-default:active{
color: #FFF;
}
.btn-default:active{
color: #FFF;
}
.btn-default:active{
text-align: center;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question