LottieFiles / dotlottie-web

Official LottieFiles player for rendering Lottie and dotLottie animations in the web. Supports React, Vue, Svelte, SolidJS and Web Components.
https://developers.lottiefiles.com/docs/dotlottie-player/
MIT License
191 stars 11 forks source link

React - support for css styling #359

Closed VogelDevelopment closed 1 month ago

VogelDevelopment commented 2 months ago

Overview

In the @lottiefiles/dotlottie-react library we are forced to use canvas. I've set up my animations and css to dynamically change the styling of my animations (through after effects css class-support). The new library "@lottiefiles/dotlottie-react" doesn't support that functionality, thus I'm currently forced to continue working with "@dotlottie/react-player", where it works just fine, but is deprecated. Would be nice to have css-styling support with the new renderer as well (or the ability to use the old method).

Type

Motivation

I've set up my animations and css to dynamically change the styling of my animations (through after effects css class-support). The new library "@lottiefiles/dotlottie-react" doesn't support that functionality, thus I'm currently forced to continue working with "@dotlottie/react-player", where it works just fine, but is deprecated. Having meaningful animations is cool, being able to adjust them based on your style, or user preferences (or even just light/dark-mode) is essential for some applications.

...

Labels

theashraf commented 2 months ago

@fragkingler I don't think it's possible to dynamically theme the animation using CSS since dotLottie-web renders on a canvas. However, you may want to check out the dotLottie theming feature, which allows you to change the animation colors dynamically at runtime.

You can find an overview of dotLottie theming here: https://developers.lottiefiles.com/docs/tools/dotlottie-js/theming/