From b2eefc97ecc8c2f9c6c429668771728be0ab77c4 Mon Sep 17 00:00:00 2001 From: colder Date: Wed, 1 Oct 2014 13:57:11 +0800 Subject: [PATCH] make checkbox animate quickly when not hover. it's not a perfect method. need improve. by the way. add 'Thumbs.db' and '.DS_Store' to .gitignore. --- .gitignore | 5 ++++- less/checkboxes.less | 11 +++++++++-- less/prefixer.less | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index f86fa8e1..62bf0fe9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ # https://git-scm.com/docs/gitignore # https://help.github.com/articles/ignoring-files -# Example .gitignore files: https://github.com/github/gitignore \ No newline at end of file +# Example .gitignore files: https://github.com/github/gitignore + +Thumbs.db +.DS_Store \ No newline at end of file diff --git a/less/checkboxes.less b/less/checkboxes.less index 32fb8f1a..9fc5aeab 100644 --- a/less/checkboxes.less +++ b/less/checkboxes.less @@ -66,10 +66,17 @@ // Ripple effect on click input[type=checkbox]:not(:checked) ~ .check:after { - .animation(rippleOff 500ms); + .animation(rippleOff 500ms linear forwards); } input[type=checkbox]:checked ~ .check:after { - .animation(rippleOn 500ms); + .animation(rippleOn 500ms linear forwards); + } + + // Make animate quickly when not hover + &:not(:hover) input[type=checkbox] ~ .check { + &:before, &:after { + .animation-duration(1ms); + } } // Style for disabled inputs diff --git a/less/prefixer.less b/less/prefixer.less index 39b3a943..e26f70b2 100644 --- a/less/prefixer.less +++ b/less/prefixer.less @@ -98,6 +98,7 @@ -moz-animation-duration: @duration; -ms-animation-duration: @duration; -o-animation-duration: @duration; + animation-duration: @duration; } .animation-fill-mode(@mode) { -webkit-animation-fill-mode: @mode;