Last active
August 29, 2015 14:04
-
-
Save netzwahnHH/3dcf141f259292ee080b to your computer and use it in GitHub Desktop.
Sass adaption of "Bootstrap v3.2 optional responsive CSS classes"
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
// Generate optional visibility layout classes for the different viewports of Bootstrap | |
// Sass adaption of Bootstrap v3.2 optional responsive CSS classes https://gist.github.com/webtobesocial/2f3d9254e696336a083b#file-column-classes-css | |
@mixin optional-viewport-only-column($visibilty-class) { | |
@for $i from 1 through 12 { | |
.col-#{$visibilty-class}-#{$i}-only { | |
width: (($i/12)*100) * 1%; | |
} | |
} | |
} | |
// Optional xs only layout classes | |
@media (max-width: 767px) { | |
@include optional-viewport-only-column('xs'); | |
} | |
// Optional sm only layout classes | |
@media (min-width: 768px) and (max-width: 991px) { | |
@include optional-viewport-only-column('sm'); | |
} | |
// Optional md only layout classes | |
@media (min-width: 992px) and (max-width: 1199px) { | |
@include optional-viewport-only-column('md'); | |
} | |
// Optional lg only layout classes | |
@media (min-width: 1200px) { | |
@include optional-viewport-only-column('lg'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great I love it!