Skip to content

Instantly share code, notes, and snippets.

@finteractive
Last active August 29, 2015 14:27
Show Gist options
  • Save finteractive/cdf31c8df6b4069b397f to your computer and use it in GitHub Desktop.
Save finteractive/cdf31c8df6b4069b397f to your computer and use it in GitHub Desktop.
Leveraging Sass mixins for cleaner code - (Generated by SassMeister.com)
// ----
// libsass (v3.2.5)
// ----
/*
Source: http://thesassway.com/intermediate/leveraging-sass-mixins-for-cleaner-code
Topic: Leveraging Sass mixins for cleaner code
*/
/* Simple Mixin */
@mixin border-radius($radius) {
-moz-border-radius: $radius;
-webkit-border-radius: $radius;
-ms-border-radius: $radius;
border-radius: $radius;
}
a.button {
@include border-radius(10px);
background: black;
color: white;
padding: 10px 20px;
}
/* Adding default values */
// @mixin border-radius($radius: 5px) {
// -moz-border-radius: $radius;
// -webkit-border-radius: $radius;
// -ms-border-radius: $radius;
// border-radius: $radius;
// }
// a.button2 {
// @include border-radius();
// background: black;
// color: white;
// padding: 10px 20px;
// }
/* Keyword Arguments */
// @mixin border-radius($radius: 5px, $moz: true, $webkit: true, $ms: true) {
// @if $moz { -moz-border-radius: $radius; }
// @if $webkit { -webkit-border-radius: $radius; }
// @if $ms { -ms-border-radius: $radius; }
// border-radius: $radius;
// }
// a.button-good-browsers {
// @include border-radius($radius: 8px, $ms: false);
// background: black;
// color: white;
// padding: 10px 20px;
// }
// a.button-good-browsers {
// @include border-radius($moz: false, $webkit: false);
// background: black;
// color: white;
// padding: 10px 20px;
// }
/*
Source: http://thesassway.com/intermediate/leveraging-sass-mixins-for-cleaner-code
Topic: Leveraging Sass mixins for cleaner code
*/
/* Simple Mixin */
a.button {
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
-ms-border-radius: 10px;
border-radius: 10px;
background: black;
color: white;
padding: 10px 20px;
}
/* Adding default values */
/* Keyword Arguments */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment