Created
May 25, 2014 22:47
-
-
Save fredericmarx/eb99692e8236d2030d1d to your computer and use it in GitHub Desktop.
Circle Mixin – Having a little fun with Sass 3.3 Maps and Random
This file contains hidden or 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
@mixin circle($radius: 100px, $bg: grey, $color: white) { | |
width: $radius; | |
height: $radius; | |
text-align: center; | |
line-height: $radius; | |
background-color: $bg; | |
color: $color; | |
overflow: hidden; | |
@include border-radius(50%); | |
.circle-content { | |
line-height: $line-height-base; | |
display: inline-block; | |
vertical-align: middle; | |
width: 100%; | |
padding: 10%; | |
font-size: $font-size-small; | |
h1, | |
h2, | |
h3, | |
h4, | |
h5, | |
p { | |
margin: 0; | |
} | |
} | |
} | |
$circle-sizes: ( | |
xs: 50px, | |
sm: 100px, | |
md: 150px, | |
lg: 250px, | |
xl: 350px | |
); | |
@each $key, $value in $circle-sizes { | |
.circle-#{$key} { | |
@include circle($value); | |
.circle-content { | |
@include transform( rotate( random(30) - 10 + deg ) ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment