Created
March 19, 2013 14:33
-
-
Save owzim/5196620 to your computer and use it in GitHub Desktop.
Revisions
-
Christian revised this gist
Mar 19, 2013 . 1 changed file with 21 additions and 24 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,14 +10,6 @@ $prefixes: ("-webkit-","-moz-", "-o-", "-ms-", ""); } } /* @@ -29,6 +21,8 @@ $prefixes: ("-webkit-","-moz-", "-o-", "-ms-", ""); } } /* @include keyframe(background-shift) { 0% { @@ -58,7 +52,9 @@ $prefixes: ("-webkit-","-moz-", "-o-", "-ms-", ""); } } /* div.logo { background: url("logo.png") no-repeat; @include image-2x("logo2x.png", 100px, 25px); @@ -77,23 +73,24 @@ div.logo { } /* @include sprites((".item.calendar",".item.tickets",".item.newsletter"), 64px, 64px, 0, " .icon"); sprites should look like this: _______ _______ _______ _______ | | | | | regular state | icon1 | icon2 | icon3 | icon4 | |_______|_______|_______|_______| | | | | | hover state | icon1 | icon2 | icon3 | icon4 | |_______|_______|_______|_______| | | | | | active state | icon1 | icon2 | icon3 | icon4 | |_______|_______|_______|_______| */ @mixin sprites($selectors, $width, $height, $position: 0, $suffix: "" ) { $i: $position; -
Christian revised this gist
Mar 19, 2013 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -78,19 +78,19 @@ div.logo { /* @include slices((".item.calendar",".item.tickets",".item.newsletter"), 64px, 64px, 0, " .icon"); sprites should look like this: _______ _______ _______ _______ | | | | | regular state | icon1 | icon2 | icon3 | icon4 | |_______|_______|_______|_______| | | | | | hover state | icon1 | icon2 | icon3 | icon4 | |_______|_______|_______|_______| | | | | | active state | icon1 | icon2 | icon3 | icon4 | |_______|_______|_______|_______| */ @mixin slices($selectors, $width, $height, $position: 0, $suffix: "" ) { -
Christian revised this gist
Mar 19, 2013 . 1 changed file with 10 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -82,16 +82,16 @@ div.logo { sprites should look like this: _______ _______ _______ _______ | | | | | regular state | icon1 | icon2 | icon3 | icon4 | |_______|_______|_______|_______| | | | | | hover state | icon1 | icon2 | icon3 | icon4 | |_______|_______|_______|_______| | | | | | active state | icon1 | icon2 | icon3 | icon4 | |_______|_______|_______|_______| */ @mixin slices($selectors, $width, $height, $position: 0, $suffix: "" ) { -
Christian revised this gist
Mar 19, 2013 . 1 changed file with 16 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -78,11 +78,24 @@ div.logo { /* @include slices((".item.calendar",".item.tickets",".item.newsletter"), 64px, 64px, 0, " .icon"); sprites should look like this: _______ _______ _______ _______ | | | | | regular state | icon1 | icon2 | icon3 | icon4 | |_______|_______|_______|_______| | | | | | hover state | icon1 | icon2 | icon3 | icon4 | |_______|_______|_______|_______| | | | | | active state | icon1 | icon2 | icon3 | icon4 | |_______|_______|_______|_______| */ @mixin slices($selectors, $width, $height, $position: 0, $suffix: "" ) { $i: $position; @each $name in $selectors { #{$name}#{$suffix} { -
Christian revised this gist
Mar 19, 2013 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -78,20 +78,20 @@ div.logo { /* @include slices((".item.calendar",".item.tickets",".item.newsletter"), 64px, 64px, " .icon"); */ @mixin slices($selectors, $width, $height, $suffix: "" ) { $i: 0; @each $name in $selectors { #{$name}#{$suffix} { background-position: (-($width * $i)) 0; } #{$name}:hover#{$suffix} { background-position: (-($width * $i)) (-($height)); } #{$name}:active#{$suffix} { background-position: (-($width * $i)) (-($height * 2)); } $i: $i + 1; -
Christian created this gist
Mar 19, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,103 @@ $prefixes: ("-webkit-","-moz-", "-o-", "-ms-", ""); @mixin selection($color, $background, $textshadow: none) { @each $prefix in $prefixes { ::#{$prefix}selection { color: $color; background: $background; text-shadow: none; } } } @mixin transparent($color, $alpha) { $rgba: rgba($color, $alpha); $ie-hex-str: ie-hex-str($rgba); background-color: transparent; background-color: $rgba; filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$ie-hex-str},endColorstr=#{$ie-hex-str}); zoom: 1; } /* @include animation(some-name 1s infinite linear); */ @mixin animation($animation) { @each $prefix in $prefixes { #{$prefix}animation: $animation; } } /* @include keyframe(background-shift) { 0% { background-position: 0; } 100% { background-position: -100%; } } */ @mixin keyframe($animation-name) { @-webkit-keyframes $animation-name { @content; } @-moz-keyframes $animation-name { @content; } @-o-keyframes $animation-name { @content; } @keyframes $animation-name { @content; } } /** div.logo { background: url("logo.png") no-repeat; @include image-2x("logo2x.png", 100px, 25px); } */ @mixin image-2x($image, $width, $height) { @media (min--moz-device-pixel-ratio: 1.3), (-o-min-device-pixel-ratio: 2.6/2), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx) { /* on retina, use image that's scaled by 2 */ background-image: url($image); background-size: $width $height; } } /* @include slices((icon-calendar,icon-tickets,icon-newsletter), 64px, 64px); */ @mixin slices($sliceNames, $width, $height) { $i: 0; @each $name in $sliceNames { .#{$name} { background-position: (-($width * $i)) 0; } .#{$name}:hover { background-position: (-($width * $i)) (-($height)); } .#{$name}:active { background-position: (-($width * $i)) (-($height * 2)); } $i: $i + 1; } }