Last active
August 16, 2018 11:19
-
-
Save WebDevLuke/1a2117c302d659e37d31e688db18e115 to your computer and use it in GitHub Desktop.
Bootstrap Spacing Utilities - Disable for last child
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------------------------------------------------------------------------------------ | |
// SPACING LAST CHILD | |
//------------------------------------------------------------------------------------------------ | |
/* | |
Extends Bootstraps spacing utility classes to create modifier classes | |
for margin/padding bottom which disable spacing only if the element in question | |
is last-child. | |
This is useful, as when you're using these classes with dynamically | |
generated content, it allows you to disable the margin for the | |
last item, as that can sometimes result in too much spacing when combined | |
with the spacing of its parent. | |
*/ | |
// stylelint-disable declaration-no-important | |
// Margin and Padding | |
@each $prop, $abbrev in (margin: m, padding: p) { | |
.#{$abbrev}b-lc:last-child { | |
#{$prop}-bottom: 0 !important; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment