Created
March 12, 2015 02:49
-
-
Save jackarmley/5b96b7986fb73b0d027c 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
// ---- | |
// Sass (v3.4.12) | |
// Compass (v1.0.3) | |
// ---- | |
$producticons: | |
posturalzonedsupport, | |
reducedpressurepoints, | |
healthysleepenvironment, | |
increasedbloodflow, | |
fullsleepsurface, | |
aquacool, | |
greaterflexibility, | |
reducedpartnerdisturbance | |
; | |
@mixin setsize($args) { | |
$arglen: length($args); | |
@if($arglen > 1){ | |
width: nth($args,1); | |
height: nth($args,2); | |
}@else{ | |
width: $args; | |
height: $args; | |
} | |
} | |
@mixin prodicon($icon: false, $size: 80px, $styles: true){ | |
// Set icon props | |
$iconw: $size; | |
$iconh: ($size + 2); | |
$iconlist: $producticons; | |
$iconlen: length($iconlist); | |
// Set icon position | |
@if $icon{ | |
$iconindex: index($iconlist,$icon); | |
$iconpos: -($iconh * ($iconindex - 1)); | |
background-position: 0 #{$iconpos}; | |
} | |
// Add additional styles | |
@if $styles{ | |
@include setsize($iconw); | |
display: inline-block; | |
background-image: url('../images/productfeature-icons.svg'); | |
background-size: $iconw ($iconh * $iconlen); | |
} | |
} | |
[class^='prodicon']{ | |
@include prodicon; | |
} | |
@each $icon in $producticons{ | |
.prodicon-#{$icon}{ | |
@include prodicon($icon,80px,false); | |
} | |
} |
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
[class^='prodicon'] { | |
width: 80px; | |
height: 80px; | |
display: inline-block; | |
background-image: url("../images/productfeature-icons.svg"); | |
background-size: 80px 656px; | |
} | |
.prodicon-posturalzonedsupport { | |
background-position: 0 0px; | |
} | |
.prodicon-reducedpressurepoints { | |
background-position: 0 -82px; | |
} | |
.prodicon-healthysleepenvironment { | |
background-position: 0 -164px; | |
} | |
.prodicon-increasedbloodflow { | |
background-position: 0 -246px; | |
} | |
.prodicon-fullsleepsurface { | |
background-position: 0 -328px; | |
} | |
.prodicon-aquacool { | |
background-position: 0 -410px; | |
} | |
.prodicon-greaterflexibility { | |
background-position: 0 -492px; | |
} | |
.prodicon-reducedpartnerdisturbance { | |
background-position: 0 -574px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment