// /** // * Copyright (C) 2013 Crossing Hippos - Babs Gösgens. All rights reserved. // * Licensed under GNU General Public License version 2 or later; see LICENSE.txt // */ @if $trace-imports { @debug 'imported'; } // Expects a nested array of valid expressions, for example // $properties: (min-width,100px),(orientation,landscape) // Use false if a value should not be rendered (0 is a valid value) @mixin breakpoint($properties, $media: 'only screen') { @if $properties { $query: ''; @if length(nth($properties,1))>1{ @each $property in $properties { $name: nth($property,1); $value: nth($property,2); @if $value { $query: '#{$query} and (#{$name}: #{$value})'; } } } @else { $name: nth($properties,1); $value: nth($properties,2); $query: '#{$query} and (#{$name}: #{$value})'; } @media #{$media} #{$query} { @content; } } }