From 8837b0a3470be2448a1913694bcf27f907a95dca Mon Sep 17 00:00:00 2001 From: "German M. Bravo" Date: Fri, 22 Apr 2011 12:37:39 -0500 Subject: [PATCH] Transitions accepting multiple transitions separated by commas --- .../stylesheets/compass/css3/_transition.scss | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/frameworks/compass/stylesheets/compass/css3/_transition.scss b/frameworks/compass/stylesheets/compass/css3/_transition.scss index 60487bcc..405a3c26 100644 --- a/frameworks/compass/stylesheets/compass/css3/_transition.scss +++ b/frameworks/compass/stylesheets/compass/css3/_transition.scss @@ -72,7 +72,7 @@ $default-transition-delay: false !default; // Transition all-in-one shorthand -@mixin transition( +@mixin single-transition( $properties: $default-transition-property, $duration: $default-transition-duration, $function: $default-transition-function, @@ -83,3 +83,37 @@ $default-transition-delay: false !default; @if $function { @include transition-timing-function($function); } @if $delay { @include transition-delay($delay); } } + +@mixin transition( + $transition-1 : default, + $transition-2 : false, + $transition-3 : false, + $transition-4 : false, + $transition-5 : false, + $transition-6 : false, + $transition-7 : false, + $transition-8 : false, + $transition-9 : false, + $transition-10: false +) { + $legacy: (type-of($transition-1) == string and type-of(if($transition-2, $transition-2, 0)) == number and type-of(if($transition-3, $transition-3, '')) == string and type-of(if($transition-4, $transition-4, 0)) == number and ($transition-2 or $transition-3 or $transition-4)); + @if $legacy { + @warn "Passing separate arguments for a single transition to transition is deprecated. " + + "Pass the values as a single space-separated list, or use the single-transition mixin."; + @include single-transition( + if($transition-1, $transition-1, $default-transition-property), + if($transition-2, $transition-2, $default-transition-duration), + if($transition-3, $transition-3, $default-transition-funciton), + if($transition-4, $transition-4, $default-transition-delay) + ); + } + @else { + @if $transition-1 == default { + $transition-1 : -compass-space-list(compact($default-transition-property, $default-transition-duration, $default-transition-function, $default-transition-delay)); + } + $transition : compact($transition-1, $transition-2, $transition-3, $transition-4, $transition-5, $transition-6, $transition-7, $transition-8, $transition-9, $transition-10); + @include experimental(transition, $transition, + -moz, -webkit, -o, not -ms, not -khtml, official + ); + } +}