Retina 対応 mixin
$spriteName: sprite-map("folder/*.png", $spacing: 5px); | |
@mixin sprite-hoge($name){ | |
background-image: $spriteName; | |
background-repeat: no-repeat; | |
width: image-width(sprite-file($spriteName, $name)) / 2; | |
height: image-height(sprite-file($spriteName, $name)) / 2; | |
$ypos: round(nth(sprite-position($spriteName, $name), 2) / 2); | |
background-position: 0 $ypos; | |
background-size: round(image-width(sprite-path($spriteName)) / 2) round(image-height(sprite-path($spriteName)) / 2); | |
} | |
.no1{ | |
@include sprite-hoge($name); | |
} |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
round ってのは四捨五入らしい。
http://kanapple.net/study/archives/17