DenoDDeno
Powered by
richardR
Denoβ€’3y agoβ€’
11 replies
richard

TailwindCSS: Class-Strings build with variables

Since TailwindCSS does not support classes with variables (like I used before with twind), how would you color 10 elements with a Tailwind class but the color is retrieved from a list?
For example:
dark:bg-${color}-200
dark:bg-${color}-200
but the color is different for every button. I would use much more classes like text-color etc. so it was the easiest to do it with a variable that changes with every element.
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Sorting tailwindcss class names with prettier plugin?
vicaryVvicary / help
3y ago
Help with FFI strings
ventgreyVventgrey / help
2y ago
Seamlessly include Tailwindcss
CaramastiferCCaramastifer / help
3y ago