Skip to content

Instantly share code, notes, and snippets.

@iamtyce
Last active January 3, 2016 20:09
Show Gist options
  • Save iamtyce/8512994 to your computer and use it in GitHub Desktop.
Save iamtyce/8512994 to your computer and use it in GitHub Desktop.
Simple mixin to write inline responsive arguments within Sass Bootstrap v3
// Respond-to mixin for Bootstrap v3 (Sass) (https://github.com/twbs/bootstrap-sass)
// Author: @iamtyce
// Original author: @wernah, based on @benschwarz
// ******************** //
// RESPOND TO //
// ******************** //
// Use: @include respond-to(screen-xs) { }
@mixin respond-to($breakpoint) {
$respondToLoop: $screen-xs, $screen-sm, $screen-md, $screen-lg;
@each $respondTo in $respondToLoop {
@if $breakpoint == #{$respondTo} {
@media only #{$media} and ($feature: #{$respondTo}) { @content }
}
}
}
@Jakobud
Copy link

Jakobud commented Sep 19, 2014

Doesn't work cause you don't have $feature defined.

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