Advertisement
Guest User

Untitled

a guest
Jul 6th, 2017
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.91 KB | None | 0 0
  1. @mixin media-query($media) {
  2.   @if $media == lg {
  3.     @media only screen and (max-width: $screen-lg-max) {
  4.       @content;
  5.     }
  6.   }
  7.   @else if $media == md {
  8.     @media only screen and (max-width: $screen-md-max) {
  9.       @content;
  10.     }
  11.   }
  12.   @else if $media == sm {
  13.     @media only screen and (max-width: $screen-sm-max) {
  14.       @content;
  15.     }
  16.   }
  17.   @else if $media == xs {
  18.     @media only screen and (max-width: $screen-xs-max) {
  19.       @content;
  20.     }
  21.   }
  22. }
  23.  
  24. // lets go
  25. html {
  26.   body {
  27.     .test {
  28.         background: black;
  29.         width: 500px;
  30.         @include media-query(lg) { // lg, md, sm, xs
  31.           width: 400px;
  32.         }
  33.         @include media-query(md) { // lg, md, sm, xs
  34.           width: 300px;
  35.         }
  36.         @include media-query(sm) { // lg, md, sm, xs
  37.           width: 200px;
  38.         }
  39.         @include media-query(xs) { // lg, md, sm, xs
  40.           width: 100px;
  41.         }
  42.     }
  43.   }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement