Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'transition-shorthand'

  • Loading branch information...
commit 3342577b0846d17f9ac6375003d327f279e8e401 2 parents 4621347 + 526df84
Phil LaPier authored
Showing with 14 additions and 30 deletions.
  1. +14 −30 app/assets/stylesheets/css3/_transition.scss
View
44 app/assets/stylesheets/css3/_transition.scss
@@ -3,40 +3,24 @@
// @include transition ((opacity, width), (1.0s, 2.0s), ease-in, (0, 2s));
// @include transition ($property:(opacity, width), $delay: (1.5s, 2.5s));
-@mixin transition ($property: all, $duration: 0.15s, $timing-function: ease-out, $delay: 0) {
-
- // Detect # of args passed into each variable
- $length-of-property: length($property);
- $length-of-duration: length($duration);
- $length-of-timing-function: length($timing-function);
- $length-of-delay: length($delay);
-
- @if $length-of-property > 1 {
- @include transition-property(zip($property)); }
- @else {
- @include transition-property( $property);
- }
-
- @if $length-of-duration > 1 {
- @include transition-duration(zip($duration)); }
- @else {
- @include transition-duration( $duration);
- }
-
- @if $length-of-timing-function > 1 {
- @include transition-timing-function(zip($timing-function)); }
- @else {
- @include transition-timing-function( $timing-function);
- }
+@mixin transition ($prop-1: all 0.15s ease-out 0,
+ $prop-2: false, $prop-3: false,
+ $prop-4: false, $prop-5: false,
+ $prop-6: false, $prop-7: false,
+ $prop-8: false, $prop-9: false)
+ {
+ $full: compact($prop-1, $prop-2, $prop-3, $prop-4, $prop-5,
+ $prop-6, $prop-7, $prop-8, $prop-9);
- @if $length-of-delay > 1 {
- @include transition-delay(zip($delay)); }
- @else {
- @include transition-delay( $delay);
- }
+ -webkit-transition: $full;
+ -moz-transition: $full;
+ -ms-transition: $full;
+ -o-transition: $full;
+ transition: $full;
}
+
@mixin transition-property ($prop-1: all,
$prop-2: false, $prop-3: false,
$prop-4: false, $prop-5: false,
Please sign in to comment.
Something went wrong with that request. Please try again.