Answers for "how to use media queries in scss"

CSS
4

media query in scss

$media-desktop: "only screen and (max-width : 1024px)";
$media-tablet: "only screen and (max-width : 768px)";
$media-mobile: "only screen and (max-width : 600px)";
$media-mobile-sm: "only screen and (max-width : 480px)";


@media #{$media-desktop} {
  background: red;
}

@media #{$media-tablet} {
  background: red;
}

@media #{$media-mobile} {
  background: red;
}

@media #{$media-mobile-sm} {
  background: red;
}
Posted by: Guest on February-21-2021
2

media queries scss

@mixin breakpoint($size) {
    @if $size == mobile {
      @media (max-width: 599px) { @content; }
    } @else if $size == tablet-portrait-up {
      @media (min-width: 600px) { @content; }
    } @else if $size == tablet-landscape-up {
      @media (min-width: 768px) { @content; }
    } @else if $size == laptop-desktop {
      @media (min-width: 992px) { @content; }
    } @else if $size == extra-large-devices {
      @media (min-width: 1200px) { @content; }
    }
}

.header{
    height: 10vh;
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid black;
}
Posted by: Guest on May-03-2021
0

how to use media query scss

@mixin breakpoint($size) {
    @if $size == mobile {
      @media (max-width: 599px) { @content; }
    } @else if $size == tablet-portrait-up {
      @media (min-width: 600px) { @content; }
    } @else if $size == tablet-landscape-up {
      @media (min-width: 900px) { @content; }
    } @else if $size == desktop-up {
      @media (min-width: 1200px) { @content; }
    } @else if $size == big-desktop-up {
      @media (min-width: 1800px) { @content; }
    }
}
/* used in this .scss file*/
.logo{
    &__link{
       &__img{
        @include breakpoint(mobile) {
            width:30%; 
          }
          width:20%;
          height:auto; 
       } 
    }
}
Posted by: Guest on June-28-2021
0

media query in scss

$size__site_content_width: 1024px;

/* Media Queries */ Not necessarily correct, edit these at will 
$media_queries : (
    'mobile'    : "only screen and (max-width: 667px)",
    'tablet'    : "only screen and (min-width: 668px) and (max-width: $size__site_content_width)",
    'desktop'   : "only screen and (min-width: ($size__site_content_width + 1))",
    'retina2'   : "only screen and (-webkit-min-device-pixel-ratio: 2) and (min-resolution: 192dpi)",
    'retina3'   : "only screen and (-webkit-min-device-pixel-ratio: 3) and (min-resolution: 288dpi)",
    'landscape' : "screen and (orientation:landscape) ",    
    'portrait'  : "screen and (orientation:portrait) "
);

@mixin for_breakpoint($breakpoints) {
    $conditions : ();
    @each $breakpoint in $breakpoints {
        // If the key exists in the map
        $conditions: append(
            $conditions,
            #{inspect(map-get($media_queries, $breakpoint))},
            comma
        );
    }

    @media #{$conditions} {
        @content;
    }

}
Posted by: Guest on August-05-2021
0

media query sass

@media #{$small-and-down} {
    // styles for small screens and down
  }
  @media #{$medium-and-up} {
    // styles for medium screens and larger
  }
  @media #{$medium-and-down} {
    // styles for medium screens and down
  }
  @media #{$large-and-up} {
    // styles for large screens and up
  }
  @media #{$extra-large-and-up} {
    // styles for extra large screens and up
  }
Posted by: Guest on June-27-2021

Code answers related to "how to use media queries in scss"

Browse Popular Code Answers by Language