Skip to content

Commit 08ea559

Browse files
committed
Update README.md
1 parent 9839c11 commit 08ea559

1 file changed

Lines changed: 38 additions & 7 deletions

File tree

README.md

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Animate.less
33

44
*CSS animation pack for Less.*
55

6-
`animate.less` is a collection of cross-browser CSS animations that you can plug right into your Less pre-processor for use in your projects. Thanks to the power of [Less](http://lesscss.org/), you can now create seriously complex animations, even without using any JavaScript or jQuery magic.
6+
`animate.less` is a collection of cross-browser CSS animations that you can plug right into your Less pre-processor for use in your projects. Thanks to the power of [Less](http://lesscss.org/), you can now create seriously complex animations, even without using any JavaScript or jQuery magic. More on this later.
77

88
##What is Less?
99
Less is a CSS pre-processor, meaning that it extends the CSS language, adding features that allow variables, mixins, functions and many other techniques that allow you to make CSS that is more maintainable, themable and extendable.
@@ -27,12 +27,6 @@ $('#yourElement').addClass('animated bounceOutLeft');
2727

2828
You can also detect when an animation ends:
2929

30-
<!--
31-
Before you make changes to this file, you should know that $('#yourElement').one() is *NOT A TYPO*
32-
33-
http://api.jquery.com/one/
34-
-->
35-
3630
```javascript
3731
$('#yourElement').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', doSomething);
3832
```
@@ -51,6 +45,43 @@ You can change the duration of your animations, add a delay or change the number
5145

5246
*Note: be sure to replace "vendor" in the CSS with the applicable vendor prefixes (webkit, moz, etc)*
5347

48+
##Script-less Animations
49+
One of the advantages of using Less is that you can create functions, which are basically [Mixins](http://lesscss.org/features/#features-overview-feature-mixins) containing nested rules and other function calls. Animate.less contains a set of mixins that make manipulating your animations easier. For example, the above jQuery example can be written as:
50+
51+
```less
52+
#yourElement {
53+
.animated();
54+
.bounceOutLeft();
55+
}
56+
```
57+
58+
Which will output:
59+
60+
```css
61+
#yourElement {
62+
-webkit-animation-duration: 1s;
63+
-moz-animation-duration: 1s;
64+
-ms-animation-duration: 1s;
65+
-o-animation-duration: 1s;
66+
animation-duration: 1s;
67+
-webkit-animation-fill-mode: both;
68+
-moz-animation-fill-mode: both;
69+
-ms-animation-fill-mode: both;
70+
-o-animation-fill-mode: both;
71+
animation-fill-mode: both;
72+
-webkit-animation-name: bounceOutLeft;
73+
-moz-animation-name: bounceOutLeft;
74+
-ms-animation-name: bounceOutLeft;
75+
-o-animation-name: bounceOutLeft;
76+
animation-name: bounceOutLeft;
77+
}
78+
```
79+
80+
And there you have it! The animation has been achieved without using any jQuery. Of course, this is only tiny fraction of what can be achieved with Animate.less. Please head on over to [AnimateForLess.com](http://animateforless.com) for a full demo and to join the duscussion.
81+
82+
##Documentation
83+
Coming soon. I promise!
84+
5485
## License
5586
Animate.less is licensed under the MIT license. (http://opensource.org/licenses/MIT)
5687

0 commit comments

Comments
 (0)