Browse Source

Starting to add correct tranisitions to toggles.

pull/216/merge
connors 11 years ago
parent
commit
c27aa46a8a
  1. 17
      dist/ratchet.css
  2. 10
      lib/sass/toggles.scss

17
dist/ratchet.css vendored

@ -1012,6 +1012,12 @@ input[type="button"] {
background-color: #fff;
border: 2px solid #e6e6e6;
border-radius: 20px;
-webkit-box-shadow: inset 0 0 0 0 #e1e1e1;
box-shadow: inset 0 0 0 0 #e1e1e1;
-webkit-transition-property: box-shadow, border;
transition-property: box-shadow, border;
-webkit-transition-duration: 0.2s;
transition-duration: 0.2s;
}
.toggle .toggle-handle {
position: absolute;
@ -1025,16 +1031,17 @@ input[type="button"] {
border-radius: 100px;
-webkit-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.08);
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.08);
-webkit-transition-property: -webkit-transform, border;
transition-property: -webkit-transform, border;
-webkit-transition-duration: 0.1s;
transition-duration: 0.1s;
-webkit-transition-property: -webkit-transform, border, width;
transition-property: -webkit-transform, border, width;
-webkit-transition-duration: 0.2s;
transition-duration: 0.2s;
-webkit-transition-timing-function: ease-in-out;
transition-timing-function: ease-in-out;
}
.toggle.active {
background-color: #4cd964;
border: 2px solid #4cd964;
-webkit-box-shadow: inset 0 0 0 30px #4cd964;
box-shadow: inset 0 0 0 30px #4cd964;
}
.toggle.active .toggle-handle {
border-color: #4cd964;

10
lib/sass/toggles.scss

@ -9,6 +9,9 @@
background-color: #fff;
border: 2px solid #e6e6e6;
border-radius: 20px;
@include box-shadow(inset 0 0 0 0 #e1e1e1);
@include transition-property(box-shadow, border);
@include transition-duration(.2s);
// Sliding handle
.toggle-handle {
@ -22,15 +25,16 @@
border: 1px solid rgba(0, 0, 0, .1);
border-radius: 100px;
@include box-shadow(0 3px 3px rgba(0,0,0,.08));
@include transition-property(-webkit-transform, border);
@include transition-duration(.1s);
@include transition-property(-webkit-transform, border, width);
@include transition-duration(.2s);
@include transition-timing-function(ease-in-out);
}
// Active state for toggle
&.active {
background-color: $positive-color;
//background-color: $positive-color;
border: 2px solid $positive-color;
@include box-shadow(inset 0 0 0 30px $positive-color);
}
// Active state for toggle handle

Loading…
Cancel
Save