Skip to content
This repository
Browse code

Merge branch 'transition-shorthand'

  • Loading branch information...
commit 3342577b0846d17f9ac6375003d327f279e8e401 2 parents 4621347 + 526df84
authored March 16, 2012
44  app/assets/stylesheets/css3/_transition.scss
@@ -3,40 +3,24 @@
3 3
 //          @include transition ((opacity, width), (1.0s, 2.0s), ease-in, (0, 2s));
4 4
 //          @include transition ($property:(opacity, width), $delay: (1.5s, 2.5s));
5 5
 
6  
-@mixin transition ($property: all, $duration: 0.15s, $timing-function: ease-out, $delay: 0) {
7  
-
8  
-  // Detect # of args passed into each variable
9  
-  $length-of-property:        length($property);
10  
-  $length-of-duration:        length($duration);
11  
-  $length-of-timing-function: length($timing-function);
12  
-  $length-of-delay:           length($delay);
13  
-
14  
-  @if $length-of-property > 1 {
15  
-    @include transition-property(zip($property)); }
16  
-  @else {
17  
-    @include transition-property(    $property);
18  
-  }
19  
-
20  
-  @if $length-of-duration > 1 {
21  
-    @include transition-duration(zip($duration)); }
22  
-  @else {
23  
-    @include transition-duration(    $duration);
24  
-  }
25  
-
26  
-  @if $length-of-timing-function > 1 {
27  
-    @include transition-timing-function(zip($timing-function)); }
28  
-  @else {
29  
-    @include transition-timing-function(    $timing-function);
30  
-  }
  6
+@mixin transition ($prop-1: all 0.15s ease-out 0,
  7
+  $prop-2: false, $prop-3: false,
  8
+  $prop-4: false, $prop-5: false,
  9
+  $prop-6: false, $prop-7: false,
  10
+  $prop-8: false, $prop-9: false)
  11
+  {
  12
+    $full: compact($prop-1, $prop-2, $prop-3, $prop-4, $prop-5,
  13
+                   $prop-6, $prop-7, $prop-8, $prop-9);
31 14
 
32  
-  @if $length-of-delay > 1 {
33  
-    @include transition-delay(zip($delay)); }
34  
-  @else {
35  
-    @include transition-delay(    $delay);
36  
-  }
  15
+  -webkit-transition: $full;
  16
+     -moz-transition: $full;
  17
+      -ms-transition: $full;
  18
+       -o-transition: $full;
  19
+          transition: $full;
37 20
 }
38 21
 
39 22
 
  23
+
40 24
 @mixin transition-property ($prop-1: all,
41 25
   $prop-2: false, $prop-3: false,
42 26
   $prop-4: false, $prop-5: false,

0 notes on commit 3342577

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