Skip to content

✨ TWEAK: improve delay expression #1508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion animate.compat.css

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions animate.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,31 @@
-webkit-animation-iteration-count: calc(var(--animate-repeat) * 3);
animation-iteration-count: calc(var(--animate-repeat) * 3);
}
.animate__animated.animate__delay-1s {
.animate__animated.animate__delay-1x {
-webkit-animation-delay: 1s;
animation-delay: 1s;
-webkit-animation-delay: var(--animate-delay);
animation-delay: var(--animate-delay);
}
.animate__animated.animate__delay-2s {
.animate__animated.animate__delay-2x {
-webkit-animation-delay: calc(1s * 2);
animation-delay: calc(1s * 2);
-webkit-animation-delay: calc(var(--animate-delay) * 2);
animation-delay: calc(var(--animate-delay) * 2);
}
.animate__animated.animate__delay-3s {
.animate__animated.animate__delay-3x {
-webkit-animation-delay: calc(1s * 3);
animation-delay: calc(1s * 3);
-webkit-animation-delay: calc(var(--animate-delay) * 3);
animation-delay: calc(var(--animate-delay) * 3);
}
.animate__animated.animate__delay-4s {
.animate__animated.animate__delay-4x {
-webkit-animation-delay: calc(1s * 4);
animation-delay: calc(1s * 4);
-webkit-animation-delay: calc(var(--animate-delay) * 4);
animation-delay: calc(var(--animate-delay) * 4);
}
.animate__animated.animate__delay-5s {
.animate__animated.animate__delay-5x {
-webkit-animation-delay: calc(1s * 5);
animation-delay: calc(1s * 5);
-webkit-animation-delay: calc(var(--animate-delay) * 5);
Expand Down
2 changes: 1 addition & 1 deletion animate.min.css

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docsSource/sections/02-utilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ Animate.css comes packed with a few utility classes to simplify its use.
You can add delays directly on the element's class attribute, just like this:

```html
<div class="animate__animated animate__bounce animate__delay-2s">Example</div>
<div class="animate__animated animate__bounce animate__delay-2x">Example</div>
```

Animate.css provides the following delays:

| Class name | Default delay time |
| ------------------- | ------------------ |
| `animate__delay-2s` | `2s` |
| `animate__delay-3s` | `3s` |
| `animate__delay-4s` | `4s` |
| `animate__delay-5s` | `5s` |
| `animate__delay-2x` | `2s` |
| `animate__delay-3x` | `3s` |
| `animate__delay-4x` | `4s` |
| `animate__delay-5x` | `5s` |

The provided delays are from 1 to 5 seconds. You can customize them setting the `--animate-delay` property to a longer or a shorter duration:

Expand Down
10 changes: 5 additions & 5 deletions source/_base.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@
animation-iteration-count: calc(var(--animate-repeat) * 3);
}

.animated.delay-1s {
.animated.delay-1x {
animation-delay: var(--animate-delay);
}

.animated.delay-2s {
.animated.delay-2x {
animation-delay: calc(var(--animate-delay) * 2);
}

.animated.delay-3s {
.animated.delay-3x {
animation-delay: calc(var(--animate-delay) * 3);
}

.animated.delay-4s {
.animated.delay-4x {
animation-delay: calc(var(--animate-delay) * 4);
}

.animated.delay-5s {
.animated.delay-5x {
animation-delay: calc(var(--animate-delay) * 5);
}

Expand Down
Loading