Skip to content

Instantly share code, notes, and snippets.

@robertmagnusson
Created February 11, 2014 15:07
Show Gist options
  • Save robertmagnusson/8936567 to your computer and use it in GitHub Desktop.
Save robertmagnusson/8936567 to your computer and use it in GitHub Desktop.
Border-radius mixin
@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;
}
.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