Last active
August 29, 2015 14:16
-
-
Save AdmireNL/8703871b8485b8da18a2 to your computer and use it in GitHub Desktop.
Revisions
-
AdmireNL revised this gist
Mar 1, 2015 . 1 changed file with 15 additions and 1 deletion.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 @@ -3,4 +3,18 @@ // Compass (v1.0.3) // ---- // For loop sprite coordinates $star-width: 50px; .rating { width: 240px; height: 38px; margin-bottom: 50px; background: url("http://imgh.us/stars.svg") no-repeat; background-position: 0 0; @for $i from 0 through 5 { &.rating-#{$i} { background-position: -((5-$i) * $star-width) 0; } } } -
AdmireNL created this gist
Mar 1, 2015 .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,6 @@ <div class="rating rating-0"></div> <div class="rating rating-1"></div> <div class="rating rating-2"></div> <div class="rating rating-3"></div> <div class="rating rating-4"></div> <div class="rating rating-5"></div> 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,6 @@ // ---- // Sass (v3.4.12) // Compass (v1.0.3) // ---- // For loop sprite coordinates$star-width: 50px;.rating { width: 240px; height: 38px; margin-bottom: 50px; background: url("http://imgh.us/stars.svg") no-repeat; background-position: 0 0; @for $i from 0 through 5 { &.rating-#{$i} { background-position: -((5-$i) * $star-width) 0; } }} 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,25 @@ .rating { width: 240px; height: 38px; margin-bottom: 50px; background: url("http://imgh.us/stars.svg") no-repeat; background-position: 0 0; } .rating.rating-0 { background-position: -250px 0; } .rating.rating-1 { background-position: -200px 0; } .rating.rating-2 { background-position: -150px 0; } .rating.rating-3 { background-position: -100px 0; } .rating.rating-4 { background-position: -50px 0; } .rating.rating-5 { background-position: 0px 0; } 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,6 @@ <div class="rating rating-0"></div> <div class="rating rating-1"></div> <div class="rating rating-2"></div> <div class="rating rating-3"></div> <div class="rating rating-4"></div> <div class="rating rating-5"></div>