Skip to content
Browse files

Updated background mixins to support variable arguments

  • Loading branch information...
1 parent b906529 commit 15ced75042d1f01eb31487b6fe342e5d83e93147 Phil LaPier committed Sep 11, 2012
View
14 app/assets/stylesheets/css3/_background-image.scss
@@ -3,19 +3,7 @@
// gradients, or for stringing multiple gradients together.
//************************************************************************//
-@mixin background-image(
- $image-1 , $image-2: false,
- $image-3: false, $image-4: false,
- $image-5: false, $image-6: false,
- $image-7: false, $image-8: false,
- $image-9: false, $image-10: false
-) {
- $images: compact($image-1, $image-2,
- $image-3, $image-4,
- $image-5, $image-6,
- $image-7, $image-8,
- $image-9, $image-10);
-
+@mixin background-image($images...) {
background-image: add-prefix($images, webkit);
background-image: add-prefix($images, moz);
background-image: add-prefix($images, ms);
View
12 app/assets/stylesheets/css3/_background-size.scss
@@ -1,11 +1,3 @@
-@mixin background-size ($length-1,
- $length-2: false, $length-3: false,
- $length-4: false, $length-5: false,
- $length-6: false, $length-7: false,
- $length-8: false, $length-9: false)
- {
- $full: compact($length-1, $length-2, $length-3, $length-4,
- $length-5, $length-6, $length-7, $length-8, $length-9);
-
-@include prefixer(background-size, $full, webkit, moz, ms, o);
+@mixin background-size ($lengths...) {
+ @include prefixer(background-size, $lengths, webkit, moz, ms, o);
}
View
14 app/assets/stylesheets/css3/_background.scss
@@ -3,19 +3,7 @@
// notation.
//************************************************************************//
-@mixin background(
- $background-1 , $background-2: false,
- $background-3: false, $background-4: false,
- $background-5: false, $background-6: false,
- $background-7: false, $background-8: false,
- $background-9: false, $background-10: false,
- $fallback: false
-) {
- $backgrounds: compact($background-1, $background-2,
- $background-3, $background-4,
- $background-5, $background-6,
- $background-7, $background-8,
- $background-9, $background-10);
+@mixin background($backgrounds..., $fallback: false) {
$fallback-color: false;
@if (type-of($fallback) == color) or ($fallback == "transparent") {

0 comments on commit 15ced75

Please sign in to comment.
Something went wrong with that request. Please try again.