In the new alpha versions, they introduced service interval classes . The structure can be changed if you use them in a smart way.
Spatial Utility Classes
<div class="container-fluid"> <div class="row"> <div class="col-sm-4 col-md-3 pl-0">β¦</div> <div class="col-sm-4 col-md-3">β¦</div> <div class="col-sm-4 col-md-3">β¦</div> <div class="col-sm-4 col-md-3 pr-0">β¦</div> </div> </div>
pl-0 and pr-0 remove leading and trailing margins from columns. One problem remained - inline column rows, as they still have a negative margin. In this case:
<div class="col-sm-12 col-md-6 pl-0"> <div class="row ml-0"> </div>
Version differences
Also note that the service space classes have been changed from version 4.0.0-alpha.4 . Before they were separated by 2 dashes, for example, => px-0 and pl-0 and so on ...
To stay in topic for version 3: this is what I use in Bootstrap 3 projects and enable compass settings for this particular spacing utility in bootstrap-sass (version 3) or bootstrap (version 4.0.0-alpha.3) with double traits or bootstrap loading (version 4.0.0-alpha.4 and higher) with single traits.
In addition, recent versions increase 5 times (e.g. pt-5 padding-top 5) instead of 3.
Compass
$grid-breakpoints: (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px) !default; @import "../scss/mixins/breakpoints"; // media-breakpoint-up, breakpoint-infix @import "../scss/utilities/_spacing.scss";
CSS output
Of course, you can always copy / paste padding classes only from the generated CSS file.
.p-0 { padding: 0 !important; } .pt-0 { padding-top: 0 !important; } .pr-0 { padding-right: 0 !important; } .pb-0 { padding-bottom: 0 !important; } .pl-0 { padding-left: 0 !important; } .px-0 { padding-right: 0 !important; padding-left: 0 !important; } .py-0 { padding-top: 0 !important; padding-bottom: 0 !important; } .p-1 { padding: 0.25rem !important; } .pt-1 { padding-top: 0.25rem !important; } .pr-1 { padding-right: 0.25rem !important; } .pb-1 { padding-bottom: 0.25rem !important; } .pl-1 { padding-left: 0.25rem !important; } .px-1 { padding-right: 0.25rem !important; padding-left: 0.25rem !important; } .py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; } .p-2 { padding: 0.5rem !important; } .pt-2 { padding-top: 0.5rem !important; } .pr-2 { padding-right: 0.5rem !important; } .pb-2 { padding-bottom: 0.5rem !important; } .pl-2 { padding-left: 0.5rem !important; } .px-2 { padding-right: 0.5rem !important; padding-left: 0.5rem !important; } .py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; } .p-3 { padding: 1rem !important; } .pt-3 { padding-top: 1rem !important; } .pr-3 { padding-right: 1rem !important; } .pb-3 { padding-bottom: 1rem !important; } .pl-3 { padding-left: 1rem !important; } .px-3 { padding-right: 1rem !important; padding-left: 1rem !important; } .py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; } .p-4 { padding: 1.5rem !important; } .pt-4 { padding-top: 1.5rem !important; } .pr-4 { padding-right: 1.5rem !important; } .pb-4 { padding-bottom: 1.5rem !important; } .pl-4 { padding-left: 1.5rem !important; } .px-4 { padding-right: 1.5rem !important; padding-left: 1.5rem !important; } .py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; } .p-5 { padding: 3rem !important; } .pt-5 { padding-top: 3rem !important; } .pr-5 { padding-right: 3rem !important; } .pb-5 { padding-bottom: 3rem !important; } .pl-5 { padding-left: 3rem !important; } .px-5 { padding-right: 3rem !important; padding-left: 3rem !important; } .py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
Tim Vermaelen Jun 29 '17 at 15:12 2017-06-29 15:12
source share