Last active
August 29, 2015 14:15
-
-
Save xzyfer/9e8e20ffe4ca184321b7 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ---- | |
| // Sass (v3.4.12) | |
| // Compass (v1.0.3) | |
| // ---- | |
| $breakpoints: ( | |
| // This needs to be quoted otherwse only the `(max-width: 900px)` | |
| // is outputted. | |
| "small": "(min-width: 480px) and (max-width: 900px)", | |
| // "small": (min-width: 480px) and (max-width: 900px), | |
| "medium": (min-width: 480px), | |
| ); | |
| /// Responsive manager. | |
| /// @access public | |
| /// @param {String} $breakpoint - Breakpoint | |
| /// @requires $breakpoints | |
| /// Taken from http://sass-guidelin.es/#media-queries-usage | |
| @mixin respond-to($breakpoint) { | |
| @if map-has-key($breakpoints, $breakpoint) { | |
| $query: map-get($breakpoints, $breakpoint); | |
| $query: if(type-of($query) == "string", unquote($query), inspect($query)); | |
| @media #{$query} { | |
| @content; | |
| } | |
| } | |
| @else { | |
| @error 'No value found for `#{$breakpoint}`. ' | |
| + 'Please make sure it is defined in `$breakpoints` map.'; | |
| } | |
| } | |
| .input { | |
| @include respond-to('small') { | |
| color: red; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @media (min-width: 480px) and (max-width: 900px) { | |
| .input { | |
| color: red; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment