Skip to content

Instantly share code, notes, and snippets.

@dannygarcia
Created July 27, 2013 00:20
Show Gist options
  • Save dannygarcia/6093089 to your computer and use it in GitHub Desktop.
Save dannygarcia/6093089 to your computer and use it in GitHub Desktop.

Revisions

  1. dannygarcia created this gist Jul 27, 2013.
    25 changes: 25 additions & 0 deletions _absolute.scss
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    @mixin absolute($top: false, $right: false, $bottom: false, $left: false) {
    position: absolute;
    @if $top != false {
    top: $top;
    }
    @if $right != false {
    right: $right;
    }
    @if $bottom != false {
    bottom: $bottom;
    }
    @if $left != false {
    left: $left;
    }
    }

    // Example
    .item {
    @include absolute(0, 10%, false, 20%);
    // generates
    position: absolute;
    top: 0;
    right: 10%;
    left: 20%;
    }