Skip to content

Instantly share code, notes, and snippets.

@netzwahnHH
Last active August 29, 2015 14:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netzwahnHH/3dcf141f259292ee080b to your computer and use it in GitHub Desktop.
Save netzwahnHH/3dcf141f259292ee080b to your computer and use it in GitHub Desktop.
Sass adaption of "Bootstrap v3.2 optional responsive CSS classes"
// 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');
}
@p3t3r67x0
Copy link

Great I love it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment