Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@dreipol/scss-mq

Package Overview
Dependencies
Maintainers
6
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dreipol/scss-mq

Dreipol scss media queries helper function

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
6
Created
Source

scss-mq

Dreipol scss media queries helper

Build Status NPM version NPM downloads MIT License

Documentation

  • API
  • Demo

Usage

Installation

npm i @dreipol/scss-mq -S

Import

You can import the mq mixin in your sass files simply using the @use rule for example:

@use 'node_modules/@dreipol/scss-mq' as *;

a {
    @include mq('xs') {
        color: red;
    }
} 

Notice that you can override the internal module variables using the with rule for example:

@use 'node_modules/@dreipol/scss-mq' as * with (
    $breakpoints: (xs: 600px, sm: 767px, md: 991px, lg: 1279px, xl: 1599px)
);

a {
    @include mq('xs') {
        color: red;
    }
} 

IMPORTANT You should override the internal scss-mq variables only once and at beginning of your main.scss file.`For example

In main.scss

@use 'node_modules/@dreipol/scss-mq' as * with (
    $breakpoints: (xs: 600px, sm: 767px, md: 991px, lg: 1279px, xl: 1599px)
);
// Grid
@use 'path/to/grid';

// components
@use 'path/to/a/component-b';
@use 'path/to/a/component-b';

In grid.scss

// you don't need to override again the breakpoints here!
@use 'node_modules/@dreipol/scss-mq' as *;

.grid {
    @include mq('xs') {
        width: 100%;
    }
}

Keywords

sass

FAQs

Package last updated on 12 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts