0

This work in simple html css but how to use style and give --i value in react

<span style="--i:3;" className="this">
          p
        </span>

CSS this is how i used this --i in css

 span {
      animation: animate 1s ease-in-out infinite;
      animation-delay: calc(0.1s * var(--i));
    }
    @keyframes animate {
      0% {
        transform: translateY(0px);
      }
      20% {
        transform: translateY(-20px);
      }
      40%,
      100% {
        transform: translateY(0px);
      }
    }
1

1 Answer 1

0

In react, for your HTML, use this syntax :

<span style={{ '--i': 3 }} className="this">
     p
</span>
Sign up to request clarification or add additional context in comments.

1 Comment

I visited late but thanks :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.