Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelwills/2952565 to your computer and use it in GitHub Desktop.
Save michaelwills/2952565 to your computer and use it in GitHub Desktop.
SASS cross browser rounded corner mixins
$default_rounded_amount: 5px
// Round corner at position by amount.
@mixin round-corner($position, $amount: $default_rounded_amount)
border-#{$position}-radius: $amount
-webkit-border-#{$position}-radius: $amount
@mixin round-corner-mozilla($position, $amount: $default_rounded_amount)
-moz-border-radius-#{$position}: $amount
// Round left corners by amount
@mixin round-left-corners($amount: $default_rounded_amount)
@include round-corner("top-left", $amount)
@include round-corner("bottom-left", $amount)
@include round-corner-mozilla("topleft", $amount)
@include round-corner-mozilla("bottomleft", $amount)
// Round right corners by amount
@mixin round-right-corners($amount: $default_rounded_amount)
@include round-corner("top-right", $amount)
@include round-corner("bottom-right", $amount)
@include round-corner-mozilla("topright", $amount)
@include round-corner-mozilla("bottomright", $amount)
// Round top corners by amount
@mixin round-top-corners($amount: 5px)
@include round-corner("top-left", $amount)
@include round-corner("top-right", $amount)
@include round-corner-mozilla("topleft", $amount)
@include round-corner-mozilla("topright", $amount)
// Round bottom corners by amount
@mixin round-bottom-corners($amount: $default_rounded_amount)
@include round-corner("bottom-left", $amount)
@include round-corner("bottom-right", $amount)
@include round-corner-mozilla("bottomleft", $amount)
@include round-corner-mozilla("bottomright", $amount)
// Round all corners by amount
@mixin round-corners($amount: $default_rounded_amount)
border-radius: $amount
-moz-border-radius: $amount
-webkit-border-radius: $amount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment