Skip to content

Sass: make respond-max() mixin use $width - 1px #8

@branneman

Description

@branneman

Example implementation:

@mixin respond-max($width) {
    $width: $width - 0.0625; // -1px
    @if $fix-mqs {
        @if $fix-mqs <= $width {
            @content;
        }
    } @else {
        @media screen and (max-width: $width) {
            @content;
        }
    }
}

However; this hardcodes 1em = 16px, which is not true for all environments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions