Skip to content

Instantly share code, notes, and snippets.

@hiloki
Created November 15, 2012 09:12
Show Gist options
  • Save hiloki/4077554 to your computer and use it in GitHub Desktop.
Save hiloki/4077554 to your computer and use it in GitHub Desktop.
CambletのアイコンをSass mixinでライブラリー化
// Camblet http://cambelt.co/
// 高解像度向け対応
@mixin cam-icon($width:16,$height:16,$type:avatar) {
display: inline-block;
width: $width + px;
height: $height + px;
background-image: url("http://cambelt.co/icon/" + $type + "/" + $width * 2 + "x" + $height * 2);
-webkit-background-size: 100% auto;
background-size: 100% auto;
}
$types:
avatar,
bubble,
clock,
calendar,
camera,
document,
email,
folder,
heart,
home,
minus,
plus,
question,
smiley,
star,
tick,
warning;
@each $type in $types {
.cam-icon-#{$type} {
@include cam-icon(36,36,$type);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment