Created
November 5, 2014 13:35
-
-
Save meodai/bda172ef16a168d99b3d to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains 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 characters
<h1>We Simplify</h1> |
This file contains 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 characters
// ---- | |
// Sass (v3.4.7) | |
// Compass (v1.0.1) | |
// ---- | |
/* | |
* will generate an icon helper class for different sized icons | |
* usage: | |
* @include icons("icons", 32, 10 14 16 25, "px") | |
*/ | |
@mixin icons ($className: "icon", $defaultSize: 32, $iconSizes: 10 14 16 21 32, $unit: "px") { | |
.#{$className} { | |
display: inline-block; | |
background-size: 100% 100%; | |
background-position: center center; | |
vertical-align: middle; | |
width: #{$defaultSize}#{$unit}; height: #{$defaultSize}#{$unit}; | |
} | |
@each $size in $iconSizes { | |
.#{$className}[class*="--#{$size}"]{ | |
width: #{$size}#{$unit}; | |
height: #{$size}#{$unit}; | |
} | |
} | |
} | |
@include icons("foo", 1.4, 1 1.2 1.4 1.5, "rem"); |
This file contains 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 characters
/* | |
* will generate an icon helper class for different sized icons | |
* usage: | |
* @include icons("icons", 32, 10 14 16 25, "px") | |
*/ | |
.foo { | |
display: inline-block; | |
background-size: 100% 100%; | |
background-position: center center; | |
vertical-align: middle; | |
width: 1.4rem; | |
height: 1.4rem; | |
} | |
.foo[class*="--1"] { | |
width: 1rem; | |
height: 1rem; | |
} | |
.foo[class*="--1.2"] { | |
width: 1.2rem; | |
height: 1.2rem; | |
} | |
.foo[class*="--1.4"] { | |
width: 1.4rem; | |
height: 1.4rem; | |
} | |
.foo[class*="--1.5"] { | |
width: 1.5rem; | |
height: 1.5rem; | |
} |
This file contains 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 characters
<h1>We Simplify</h1> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment