Skip to content

Instantly share code, notes, and snippets.

@alenia
Last active December 14, 2015 11:39
Show Gist options
  • Save alenia/5080383 to your computer and use it in GitHub Desktop.
Save alenia/5080383 to your computer and use it in GitHub Desktop.
Two ways of making cylinders in SASS for webkit
@mixin cylinder($width,$height,$proportion: .4)
position: relative
width: $width
height: $height
&:before, &:after
// only using chrome for now, so not adding in moz
-webkit-transform: scaley($proportion)
width: $width
height: $width
border-radius: $width
display: block
content: ' '
position: absolute
&:before
top: -1 * $width/2
&:after
top: $height - $width/2
@mixin cylinder2($width,$height,$proportion: .4)
position: relative
width: $width
height: $height
&:before, &:after
// only using chrome for now, so not adding in moz
-webkit-border-radius: $width/2 $proportion * $width/2
width: $width
height: $proportion * $width
display: block
content: ' '
position: absolute
&:before
top: -1 * $proportion * $width/2
&:after
top: $height - $proportion * $width/2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment