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

Commit 9ad6c77

Browse files
mgcreapetebacondarwin
authored andcommitted
docs($animate): describe how to avoid conflicts with 3rd party CSS frameworks
Closes #8569 Closes #9722
1 parent cfe7b0e commit 9ad6c77

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

src/ngAnimate/animate.js

+25-1
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@
208208
* when a CSS class containing a transition is applied to an element:
209209
*
210210
* ```css
211+
* /* this works as expected */
211212
* .fade {
212-
* /* this works as expected */
213213
* transition:1s linear all;
214214
* opacity:0;
215215
* }
@@ -219,6 +219,30 @@
219219
* Also, try not to mix the two class-based animation flavors together since the CSS code may become
220220
* overly complex.
221221
*
222+
*
223+
* ### Preventing Collisions With Third Party Libraries
224+
*
225+
* Some third-party frameworks place animation duration defaults across many element or className
226+
* selectors in order to make their code small and reuseable. This can lead to issues with ngAnimate, which
227+
* is expecting actual animations on these elements and has to wait for their completion.
228+
*
229+
* You can prevent this unwanted behavior by using a prefix on all your animation classes:
230+
*
231+
* ```css
232+
* /* prefixed with animate- */
233+
* .animate-fade-add.animate-fade-add-active {
234+
* transition:1s linear all;
235+
* opacity:0;
236+
* }
237+
* ```
238+
*
239+
* You then configure `$animate` to enforce this prefix:
240+
*
241+
* ```js
242+
* $animateProvider.classNamePrefix(/animate-/);
243+
* ```
244+
* </div>
245+
*
222246
* ### CSS Staggering Animations
223247
* A Staggering animation is a collection of animations that are issued with a slight delay in between each successive operation resulting in a
224248
* curtain-like effect. The ngAnimate module (versions >=1.2) supports staggering animations and the stagger effect can be

0 commit comments

Comments
 (0)