1.4.0 • Published 4 years ago

@sass-collective/sass-breakpoint v1.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Sass Breakpoint

Sass Breakpoint

Version Download License

Introduction

Generate CSS breakpoint.

Install

npm install @sass-collective/sass-breakpoint --save

Usage

Mixin

breakpoint($min-width, $max-width, $root-selector);

Variables

NamesValuesDescriptions
$stricttrueSubtract 1px on max-width value, 960px come 959px
$very-small320iPhone in portrait mode
$small480iPhone in landscape mode
$medium768iPad in portrait mode
$large960Desktop
$wide1200Wide screen

Update default variables in global

@use "@sass-collective/sass-breakpoint" with (
    $large: 960
);

Module System

@use "@sass-collective/sass-breakpoint";

// Mixin

body {
    // Min width
    @include sass-breakpoint.breakpoint(960) {
        font-size: 10px;
    }

    // Max width
    @include sass-breakpoint.breakpoint($max-width: 960) {
        font-size: 10px;
    }

    // Between
    @include sass-breakpoint.breakpoint(480, 960) {
        font-size: 10px;
    }

    // Parent class or ID
    @include sass-breakpoint.breakpoint(480, $root-selector: '.class') {
        font-size: 10px;
    }
}

Legacy @import

@import "@sass-collective/sass-breakpoint";

// Mixin

body {
    // Min width
    @include sass-breakpoint(960) {
        font-size: 10px;
    }

    // Max width
    @include sass-breakpoint($max-width: 960) {
        font-size: 10px;
    }

    // Between
    @include sass-breakpoint(480, 960) {
        font-size: 10px;
    }

    // Parent class or ID
    @include sass-breakpoint(480, $root-selector: '.class') {
        font-size: 10px;
    }
}

CSS

/* Min width */
@media all and (min-width: 960px) {
    body {
        font-size: 10px;
    }
}

/* Max width */
@media all and (max-width: 959px) {
    body {
        font-size: 10px;
    }
}

/* Between */
@media all and (min-width: 480px) and (max-width: 959px) {
    body {
        font-size: 10px;
    }
}

/* Parent class or ID */
@media all and (min-width: 480px) {
    .class body {
        font-size: 10px;
    }
}
1.4.0

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago