Created
February 17, 2018 13:38
-
-
Save ilya-korotya/0f49362b848501f66e20586d5d4ba372 to your computer and use it in GitHub Desktop.
brakepoint sass
This file contains 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
$breakpoints: ( | |
'medium': (min-width: 200px), | |
'large': (min-width: 400px), | |
'huge': (min-width: 600px), | |
); | |
@mixin respond-to($breakpoint) { | |
@if map-has-key($breakpoints, $breakpoint) { | |
@media #{inspect(map-get($breakpoints, $breakpoint))} { | |
@content; | |
} | |
} @else { | |
@error 'Не указано значение для `#{$breakpoint}`. ' | |
+ 'Пожалуйста, убедитесь, что точка остановки объявлена в карте `$breakpoints`.'; | |
} | |
} | |
@include respond-to(medium) { | |
color: red; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment