Last active
August 29, 2015 14:27
-
-
Save finteractive/cdf31c8df6b4069b397f to your computer and use it in GitHub Desktop.
Leveraging Sass mixins for cleaner code - (Generated by SassMeister.com)
This file contains hidden or 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
// ---- | |
// 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; | |
// } | |
This file contains hidden or 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
/* | |
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