Git Product home page Git Product logo

scss-media-queries's Introduction

SCSS Mixins for Media Queries

Installation

Download and include media-queries.scss.

Usage

SCSS file provides three mixins to control media queries and a map with several breakpoints.

Avaible mixins

    // Screen width is in the breakpoint's range.
    @include media($name);

    // Screen width is less than breakpoint's minimum width.
    @include media-lt($name);

    // Screen width is greater than breakpoint's maximum width.
    @include media-gt($name);

Avaible media queries aliases

Edge Devtools consider the following breakpoints:

Breakpoint name Minimum width Maximum width
mobile-s 0px 320px
mobile-m 321px 375px
mobile-l 376px 425px
tablet 426px 768px
laptop 769px 1024px
laptop-l 1025px 1440px
4k 1441px 2560px

Angular Flex Layout MediaQueries consider the following breakpoints:

Breakpoint name Minimum width Maximum width
xs 0px 599px
sm 600px 959px
md 960px 1279px
lg 1280px 1919px
xl 1920px 5000px

Example

@use "media-queries.scss" as *;

.container {
    @include media("xs") {
        background: blue;
    }

    @include media-lt("mobile-s") {
        color: green;
    }

    @include media-gt("laptop") {
        color: red;
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.