Open AlexandreKilian opened 5 years ago
Hi, if you add a property "className" to the renderConfig, the svg will add that class to it and you can set your own set of properties.
I think that if you combine viewBoxOnly: true
, className
and viewBoxSize
, you can get any responsive behavior you want.
The reason why it sets the width and height to 100% by default, is because it seems the most intuitive way for elements to behave when containers don't match the animation size.
While embedding a lottie-file with the JS library, I encountered an Issue… There's only an option to disregard width and height of the SVG element or set it to 100%…
here's the animation being applied
$el
being my Node for some reason, the option is disregared, but that's another issue… Why set the width and height to 100% by default? this could be acchieved with CSS from the outside… and if so, why not allow to set a maxWidth instead? For responsive purposes, this would allow using the animation at animation size and scale it down if the container doesn't allow it: