Home › Forums › CSS › CSS Clutter – What is the best way to optimize? › Reply To: CSS Clutter – What is the best way to optimize?
June 27, 2017 at 7:40 am
#256154
Participant
You could create a custom build of Bootstrap from their website, specifying that there should be 0px padding on all margins. That would provide you a solution that removes a lot of redundant CSS.
You could also just eliminate all the bajillion .col
declarations with a wildcard:
[class*='col-'] {
position: relative;
min-height: 1px;
padding-right: 0;
padding-left: 0;
}
A more robust approach might be to combine the wildcard AND your .no-padding
idea, but apply the latter to the .container
.
.no-padding [class*='col-'] {
position: relative;
min-height: 1px;
padding-right: 0;
padding-left: 0;
}
That let’s you have padded grid layouts where appropriate, and those without where desired.