Created
February 11, 2014 15:07
-
-
Save robertmagnusson/8936567 to your computer and use it in GitHub Desktop.
Border-radius mixin
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
@mixin border-radius($radius) { | |
-webkit-border-radius: $radius; | |
border-radius: $radius; | |
background-clip: padding-box; /* stops bg color from leaking outside the border: */ | |
} | |
// Single side border-radius | |
@mixin border-top-radius($radius) { | |
-webkit-border-top-right-radius: $radius; | |
border-top-right-radius: $radius; | |
-webkit-border-top-left-radius: $radius; | |
border-top-left-radius: $radius; | |
background-clip: padding-box; | |
} | |
@mixin border-right-radius($radius) { | |
-webkit-border-bottom-right-radius: $radius; | |
border-bottom-right-radius: $radius; | |
-webkit-border-top-right-radius: $radius; | |
border-top-right-radius: $radius; | |
background-clip: padding-box; | |
} | |
@mixin border-bottom-radius($radius) { | |
-webkit-border-bottom-right-radius: $radius; | |
border-bottom-right-radius: $radius; | |
-webkit-border-bottom-left-radius: $radius; | |
border-bottom-left-radius: $radius; | |
background-clip: padding-box; | |
} | |
@mixin border-left-radius($radius) { | |
-webkit-border-bottom-left-radius: $radius; | |
border-bottom-left-radius: $radius; | |
-webkit-border-top-left-radius: $radius; | |
border-top-left-radius: $radius; | |
background-clip: padding-box; | |
} |
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
.button { | |
@include border-radius(5px); | |
} | |
.submit-button { | |
@include border-top-radius(10px); | |
@include border-right-radius(8px); | |
@include border-bottom-radius(10px); | |
@include border-left-radius (6px); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment