// Mixins $breakpoints: ( 'small' : 768px, 'small-800' : 800px, 'medium' : 992px, 'large' : 1200px ); /* Usage: * * @include breakpoint(small) { ... } * @include breakpoint(medium) { ... } * @include breakpoint(large) { ... } * */ @mixin breakpoint($breakpoint) { // Retrieves the value from the key $value: map-get($breakpoints, $breakpoint); // If the key exists in the map @if $value != null { // Prints a media query based on the value @media (min-width: $value) { @content; } } // If the key doesn't exist in the map @else { @warn "Unfortunately, no value could be retrieved from `#{$breakpoint}`. " + "Please make sure it is defined in `$breakpoints` map."; } } /* Usage: * * @include placeholder { ... } * */ @mixin placeholder { // Chrome/Opera/Safari &::-webkit-input-placeholder { opacity: 1; @content; } // Firefox 19+ &::-moz-placeholder { opacity: 1; @content; } // IE 10+ &:-ms-input-placeholder { opacity: 1; @content; } // Firefox 18- &:-moz-placeholder { opacity: 1; @content; } }