CSS Carousel won't work when transferring from React to Hubspot
SOLVE
Hello, I'd like to have module that is an autoplaying carousel with all the logos of my company's clients that I can use in multiple different places on our site. I have used this exact code with styled components in a React application for another one of our websites, and it works perfectly. However, it does not work when I test it in the Design Manager Preview. Here is the CSS in question:
I wish I could report that I've tried many solutions, but I don't really know what to do since this works perfectly on my other site. The only difference between my code on Hubspot and the other site is that I added the animation duration and iteration properties, instead of just having those under the animation property. Thanks in advance for your help.
CSS Carousel won't work when transferring from React to Hubspot
SOLVE
Hi @alyssamwilie, thank you for the response. What you have suggested are good practices for maintaining clean code, but what made this work for me, strangely enough, was deleting the "0% { transform: translateX(0) };" property from my keyframes animation. I don't know why this worked, but the errant commas "linear infinite" property do not seem to have affected the animation, as they are still there, but do I appreciate you and @BarryGrennan taking the time to respond.
CSS Carousel won't work when transferring from React to Hubspot
SOLVE
Hi @alyssamwilie, thank you for the response. What you have suggested are good practices for maintaining clean code, but what made this work for me, strangely enough, was deleting the "0% { transform: translateX(0) };" property from my keyframes animation. I don't know why this worked, but the errant commas "linear infinite" property do not seem to have affected the animation, as they are still there, but do I appreciate you and @BarryGrennan taking the time to respond.
Nov 14, 20221:32 AM - edited Nov 14, 20221:36 AM
Recognized Expert | Elite Partner
CSS Carousel won't work when transferring from React to Hubspot
SOLVE
The errant semi colon I was talking about was the one at the end of "0% { transform: translateX(0) };" so, yes, I suppose deleting the whole line will also do the trick. The iteration count was a separate thing unrelated to the semi colon.
If this answer solved your question, please mark it as the solution.