Skip to content

Instantly share code, notes, and snippets.

@Swistikkk
Last active November 14, 2019 13:58
Show Gist options
  • Save Swistikkk/e2d8c6631a64dcf53011 to your computer and use it in GitHub Desktop.
Save Swistikkk/e2d8c6631a64dcf53011 to your computer and use it in GitHub Desktop.
Adaptive mixin (sass)
@mixin adaptive($media)
@if $media == mobile
@media only screen and (max-width: $mobile)
@content
@else if $media == pad
@media only screen and (min-width: $mobile + 1) and (max-width: $desktop - 1)
@content
@else if $media == desktop
@media only screen and (min-width: $desktop )
@content
@Swistikkk
Copy link
Author

Использую в sass

.body { @include adaptive(desktop) { // тут пишу стили для разрешения $desktop } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment