Created
August 21, 2012 05:40
-
-
Save jmblog/3412221 to your computer and use it in GitHub Desktop.
Sass mixin for CSS Heart Shape
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
// border-radius(), transform() and transform-origin() mixins are from Compass. | |
// http://compass-style.org/ | |
@mixin heart($width: 50px, $color: hotpink) { | |
$half: ($width / 2); | |
$height: ($half * 1.6); | |
display: inline-block; | |
position: relative; | |
width: $width; | |
height: $height; | |
&::before, | |
&::after { | |
position: absolute; | |
content: ""; | |
left: $half; | |
top: 0; | |
width: $half; | |
height: $height; | |
background: $color; | |
@include border-radius($half $half 0 0); | |
@include transform(rotate(-45deg)); | |
@include transform-origin(0, 100%); | |
} | |
&::after { | |
left: 0; | |
@include transform(rotate(45deg)); | |
@include transform-origin(100%, 100%); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment