Skip to content

Instantly share code, notes, and snippets.

@iamtyce
Last active December 18, 2015 11:49
Show Gist options
  • Save iamtyce/5778876 to your computer and use it in GitHub Desktop.
Save iamtyce/5778876 to your computer and use it in GitHub Desktop.
Simple mixin to write inline responsive arguments within Rockhammer
// Respond-to mixin for Rock Hammer (https://github.com/malarkey/rock-hammer/)
// Author: @iamtyce
// Original author: @wernah, based on @benschwarz
// ******************** //
// RESPOND TO //
// ******************** //
// Use: @include respond-to(bp5) { }
@mixin respond-to($breakpoint) {
$respondToLoop: bp1, bp2, bp3, bp4, bp5, bp6;
@each $respondTo in $respondToLoop {
@if $breakpoint == #{$respondTo} {
@media only #{$media} and ($feature: #{$respondTo}) { @content }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment