devnomic / marquee

A beautiful marquee component for React.
https://marquee-dev.vercel.app
MIT License
392 stars 9 forks source link

Dynamic speed #5

Open aitormendez opened 3 months ago

aitormendez commented 3 months ago

Trying to apply dynamic speed this way:

className={`[--duration:${speed}s]`}

This results in a very slow and always the same scroll speed, regardless of the speed value.

Hardcoding, it works:

className={`[--duration:10s]`}
console.log(`[--duration:${speed}s]`) // returns the right value: [--duration:5s]

Any ideas?

devnomic commented 2 months ago

Hi sorry for late reply, As far as i know this are tailwindcss limitation, you can't use dynamic value like that without configuring it in the config.

https://tailwindcss.com/docs/content-configuration#dynamic-class-names