Created
September 12, 2016 09:15
-
-
Save 4foot30/04e2efdf8262393def580cd2296ec467 to your computer and use it in GitHub Desktop.
For making Bootstrap's pull classes be breakpoint-specific
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
// Floating - like Bootstrap's pull-left/pullright classes, but breakpoint-specific | |
// Usage: .pull-right-sm, .pull-left-md etc. | |
.make-pull-left(@breakpoint) { | |
.pull-left-@{breakpoint} { | |
float: left !important; | |
} | |
} | |
.make-pull-right(@breakpoint) { | |
.pull-right-@{breakpoint} { | |
float: right !important; | |
} | |
} | |
.make-pull-none(@breakpoint) { | |
.pull-none-@{breakpoint} { | |
float: none !important; | |
} | |
} | |
// Extra small grid | |
@media (min-width: 0px) and (max-width: @screen-xs-max) { | |
.make-pull-left(xs); | |
.make-pull-right(xs); | |
.make-pull-none(xs); | |
} | |
// Small grid | |
@media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { | |
.make-pull-left(sm); | |
.make-pull-right(sm); | |
.make-pull-none(sm); | |
} | |
// Medium grid | |
@media (min-width: @screen-md-min) and (max-width: @screen-md-max) { | |
.make-pull-left(md); | |
.make-pull-right(md); | |
.make-pull-none(md); | |
} | |
// Large grid | |
@media (min-width: @screen-lg-min) { | |
.make-pull-left(lg); | |
.make-pull-right(lg); | |
.make-pull-none(lg); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment