Skip to content

Instantly share code, notes, and snippets.

@ryanve
Created November 22, 2016 19:27
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 ryanve/5dcb6975d52755d4e502545c971ce3cc to your computer and use it in GitHub Desktop.
Save ryanve/5dcb6975d52755d4e502545c971ce3cc to your computer and use it in GitHub Desktop.
Sass border-radius mixin
@mixin border-radius($corner: null) {
#{if($corner, border-#{$corner}-radius, border-radius)}: $border-radius;
}
@ryanve
Copy link
Author

ryanve commented Nov 22, 2016

where $border-radius is defined from a variables file

$border-radius: 4px;

@ryanve
Copy link
Author

ryanve commented Nov 22, 2016

.example {
    @include border-radius(top-left);
    @include border-radius(top-right);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment