WinterCore / react-text-transition

Animate your text changes
MIT License
601 stars 26 forks source link

Style #26

Closed MihaiWill closed 3 years ago

MihaiWill commented 3 years ago

Hi, when i add this those styles, it not render at it should:

 style={{
          fontSize: "48px",
          fontWeight: "800",
          background: "-webkit-linear-gradient(45deg, #09009f, #00ff95 80%)",
          WebkitBackgroundClip: "text",
          WebkitTextFillColor: "transparent",
        }}

How can i render it the right way?

WinterCore commented 3 years ago

Hello there.

So the thing is that when you use the style prop the styles get applied to the outer container, but the CSS property -webkit-background-clip has to be applied directly to the element that contains the text for it to work.

You can apply the styles using normal CSS. CodeSandBox Example

Let me know if you have any more questions.

MihaiWill commented 3 years ago

Awesome!! Thanks so much

On Mon, Mar 15, 2021, 05:24 WinterCore @.***> wrote:

Hello there.

So the thing is that when you use the style prop the styles get applied to the outer container, but the CSS property -webkit-background-clip has to be applied directly to the element that contains the text for it to work.

CodeSandBox Example https://codesandbox.io/s/dawn-hooks-bsg95

Let me know if you have any more questions.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/WinterCore/react-text-transition/issues/26#issuecomment-799063169, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKBL3XJIJSB4OSTT7JSYLLTDV4VZANCNFSM4ZFLIRHA .

ezorfa commented 2 years ago

Hi @WinterCore !

Could you please reshare the code sandbox as the link seems to be broken?