Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 20e0c7f

Browse files
peebeebeepetebacondarwin
authored andcommitted
docs(ngAnimate): remove unnecessary transition prefixes
We can remove the vendor-prefixing from our docs, since all major browsers support these properties, without prefixes. Closes #14586
1 parent f34e341 commit 20e0c7f

File tree

1 file changed

+20
-41
lines changed

1 file changed

+20
-41
lines changed

docs/content/guide/animations.ngdoc

Lines changed: 20 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ triggered, will attempt to perform a CSS Transition, CSS Keyframe Animation or a
1212
placed on the given directive). Animations can be placed using vanilla CSS by following the naming conventions set in place by AngularJS
1313
or with JavaScript code when it's defined as a factory.
1414

15+
<div class="alert alert-info">
16+
Note that we have used non-prefixed CSS transition properties in our examples as the major browsers now support non-prefixed
17+
properties. If you intend to support older browsers or certain mobile browsers then you will need to include prefixed
18+
versions of the transition properties. Take a look at http://caniuse.com/#feat=css-transitions for what browsers require prefixes,
19+
and https://github.com/postcss/autoprefixer for a tool that can automatically generate the prefixes for you.
20+
</div>
21+
1522
Animations are not available unless you include the {@link ngAnimate `ngAnimate` module} as a dependency within your application.
1623

1724
Below is a quick example of animations being enabled for `ngShow` and `ngHide`:
@@ -29,18 +36,17 @@ Below is a quick example of animations being enabled for `ngShow` and `ngHide`:
2936
</file>
3037
<file name="animations.css">
3138
.sample-show-hide {
32-
padding:10px;
33-
border:1px solid black;
34-
background:white;
39+
padding: 10px;
40+
border: 1px solid black;
41+
background: white;
3542
}
3643

3744
.sample-show-hide {
38-
-webkit-transition:all linear 0.5s;
39-
transition:all linear 0.5s;
45+
transition: all linear 0.5s;
4046
}
4147

4248
.sample-show-hide.ng-hide {
43-
opacity:0;
49+
opacity: 0;
4450
}
4551
</file>
4652
</example>
@@ -80,11 +86,8 @@ occur when ngRepeat triggers them:
8086
class
8187
*/
8288
.repeated-item.ng-enter, .repeated-item.ng-move {
83-
-webkit-transition:0.5s linear all;
84-
-moz-transition:0.5s linear all;
85-
-o-transition:0.5s linear all;
86-
transition:0.5s linear all;
87-
opacity:0;
89+
transition: all 0.5s linear;
90+
opacity: 0;
8891
}
8992

9093
/*
@@ -95,7 +98,7 @@ occur when ngRepeat triggers them:
9598
*/
9699
.repeated-item.ng-enter.ng-enter-active,
97100
.repeated-item.ng-move.ng-move-active {
98-
opacity:1;
101+
opacity: 1;
99102
}
100103

101104
/*
@@ -104,35 +107,14 @@ occur when ngRepeat triggers them:
104107
that has the .repeated-item class
105108
*/
106109
.repeated-item.ng-leave {
107-
-webkit-animation:0.5s my_animation;
108-
-moz-animation:0.5s my_animation;
109-
-o-animation:0.5s my_animation;
110-
animation:0.5s my_animation;
110+
animation: 0.5s my_animation;
111111
}
112112

113113
@keyframes my_animation {
114114
from { opacity:1; }
115115
to { opacity:0; }
116116
}
117117

118-
/*
119-
Unfortunately each browser vendor requires
120-
its own definition of keyframe animation code...
121-
*/
122-
@-webkit-keyframes my_animation {
123-
from { opacity:1; }
124-
to { opacity:0; }
125-
}
126-
127-
@-moz-keyframes my_animation {
128-
from { opacity:1; }
129-
to { opacity:0; }
130-
}
131-
132-
@-o-keyframes my_animation {
133-
from { opacity:1; }
134-
to { opacity:0; }
135-
}
136118
```
137119

138120
The same approach to animation can be used using JavaScript code (**jQuery is used within to perform animations**):
@@ -217,10 +199,7 @@ The example below shows how to perform animations during class changes:
217199
</file>
218200
<file name="style.css">
219201
.css-class-add, .css-class-remove {
220-
-webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
221-
-moz-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
222-
-o-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
223-
transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
202+
transition: all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
224203
}
225204

226205
.css-class,
@@ -231,7 +210,7 @@ The example below shows how to perform animations during class changes:
231210

232211
.css-class-remove.css-class-remove-active {
233212
font-size:1.0em;
234-
color:black;
213+
color: black;
235214
}
236215
</file>
237216
</example>
@@ -317,8 +296,8 @@ app.config(function($animateProvider) {
317296
```css
318297
/&#42; prefixed with animate- &#42;/
319298
.animate-fade-add.animate-fade-add-active {
320-
transition:1s linear all;
321-
opacity:0;
299+
transition: all 1s linear;
300+
opacity: 0;
322301
}
323302
```
324303

0 commit comments

Comments
 (0)