Skip to content

Commit 09ceaec

Browse files
committed
fix opacity loop to work with css var
1 parent 22a3dca commit 09ceaec

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tailwindcss-motion",
3-
"version": "0.4.2-beta",
3+
"version": "0.4.3-beta",
44
"description": "Tailwind Motion is a Tailwind CSS Plugin made by Rombo. It’s a simple, yet powerful, animation library for Tailwind CSS.",
55
"keywords": [
66
"tailwindcss",

src/baseAnimations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ export function addBaseAnimations(matchUtilities, theme) {
350350
{
351351
"motion-opacity-loop": (value, { modifier }) => ({
352352
// we need to subtract 1 because of animation composition
353-
"--motion-loop-opacity": `${Number(value) - 1}`,
353+
"--motion-loop-opacity": `calc(${value} - 1)`,
354354
"--motion-opacity-loop-animation": opacityLoopAnimation(
355355
modifier || "mirror"
356356
),

web/src/pages/index.astro

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
<body
77
class="bg-black flex justify-center items-center text-white text-9xl h-screen"
88
>
9-
<h1 class="motion-opacity-loop-0 motion-scale-loop-50">Rombo</h1>
9+
<h1
10+
class="motion-opacity-loop-[--ey] motion-scale-loop-[--motion-loop-scale]"
11+
style={{ "--ey": "0", "--motion-loop-scale": "0.9" }}
12+
>
13+
Rombo
14+
</h1>
1015
</body>
1116
</html>

0 commit comments

Comments
 (0)