Answers for "mixins media query sass"

CSS
1

media screen scss mixin

// respond is the name of your mixin

    @mixin respond ($breakpoint) {

        // $breakpoint is simply a variable that can have several values

        @if $breakpoint==tablet {

            // here `laptop` is the value of $breakpoint
            // when call laptop, we mean the following piece of code        

        @media only screen and (max-width: 600px) {
          @content;
        }
      }

      @if $breakpoint==mobile {
        @media only screen and (max-width: 480px) {
          @content;
        }
      }
    }
Posted by: Guest on October-24-2020
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

Browse Popular Code Answers by Language