Advertisement
Guest User

Untitled

a guest
May 4th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. @mixin responsive-sprite($map, $icon){
  2. $icon-file: sprite-file($map, $icon);
  3. $icon-width: image-width($icon-file);
  4. $icon-height: image-height($icon-file);
  5.  
  6. $sprite-file: sprite-path($map);
  7. $sprite-width: image-width($sprite-file);
  8. $sprite-height: image-height($sprite-file);
  9.  
  10. $space-top: floor(nth(sprite-position($map, $icon), 2));
  11. @if $space-top == 0 {
  12. $space-top: 0px
  13. }
  14.  
  15. width:percentage($sprite-width / $icon-width);
  16. display: block;
  17. height: 0;
  18. padding-bottom: percentage($icon-height / $icon-width);
  19. background-size: 100%;
  20. background-position:0 percentage(
  21. -1 * $space-top / ( $sprite-height - $icon-height )
  22. );
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement