Skip to content

Instantly share code, notes, and snippets.

@tormjens
Created April 23, 2015 12:54
Show Gist options
  • Save tormjens/8cd3b3dbb1095f08c6ca to your computer and use it in GitHub Desktop.
Save tormjens/8cd3b3dbb1095f08c6ca to your computer and use it in GitHub Desktop.
Foundation Breakpoint Mixin
@mixin breakpoint($breakpoint, $orientation:"") {
$break: $breakpoint;
$orient: "";
@if $breakpoint == 'small' {
$break: $small-only;
}
@else if $breakpoint == 'small-up' {
$break: $small-up;
}
@else if $breakpoint == 'medium' {
$break: $medium-only;
}
@else if $breakpoint == 'medium-up' {
$break: $medium-up;
}
@else if $breakpoint == 'large' {
$break: $large-only;
}
@else if $breakpoint == 'large-up' {
$break: $large-up;
}
@else if $breakpoint == 'xlarge' {
$break: $xlarge-only;
}
@else if $breakpoint == 'xlarge-up' {
$break: $xlarge-up;
}
@else if $breakpoint == 'xxlarge-up' {
$break: $xxlarge-up;
}
@if $orientation != "" {
$orient: 'and (orientation : #{$orientation})';
}
$bp: #{$break} #{$orient};
@media #{$bp} {
@content;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment