Skip to content

Instantly share code, notes, and snippets.

@nickautomatic
Created March 10, 2015 16:19

Revisions

  1. nickautomatic created this gist Mar 10, 2015.
    20 changes: 20 additions & 0 deletions breakpoint.scss
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    // Super simple mobile-first breakpoint mixin:
    @mixin breakpoint($from) {
    @media screen and (min-width: $from) { @content; }
    }

    // Example usage:
    $small: 480px;
    nav {
    @include breakpoint($small) {
    display: none;
    }
    }

    // ...alternative usage (for, eg. one-off tweakpoints):
    // cf. https://adactio.com/journal/6044
    nav {
    @include breakpoint(480px) {
    display: none;
    }
    }