Permalink
Browse files

Added sprite mixin.

  • Loading branch information...
Tom Krush
Tom Krush committed Jan 4, 2012
1 parent 5c7f888 commit af548d6bc02cdfaf49e57c3bc7c24ca357b022ef
Showing with 8 additions and 0 deletions.
  1. +8 −0 _mixins.scss
View
@@ -5,6 +5,14 @@
#{$property}: $value;
}
+@mixin sprite($file, $row:1, $col:1, $width: 16px, $height: 16px)
+{
+ width: $width;
+ height: $height;
+ background-position: $row * $width $col*$height;
+ background-image: url($file);
+}
+
@mixin position($top: false, $left: false, $bottom: false, $right: false, $zindex: false) {
position: absolute;
@if type_of($top) == number {

2 comments on commit af548d6

Collaborator

jamesfinley replied Jan 6, 2012

Okay, that is a cool addition.

Collaborator

tomkrush replied Jan 6, 2012

@mixin icon($row: 1, $col: 1)
{
    position: relative;
    &:before {
        position: absolute;
        left: 10px;
        top: 7px;
        display: block;
        content: '';
        @include sprite('../images/icon-sprites.png', $row, $col, 16px, 16px);      
    }
}

@include icon(1, 3);
Please sign in to comment.