phoenix-liveview-counter-tutorial icon indicating copy to clipboard operation
phoenix-liveview-counter-tutorial copied to clipboard

Dynamic css clasees to color button did not work

Open gitkinder opened this issue 8 months ago • 1 comments

Adding these classes to the safelist in assets/tailwind.config.js makes them work. I could not find another way to get it work. This is also covered in https://elixirforum.com/t/using-generated-class-names-in-tailwind-under-phoenix-1-7/57995

  safelist: [
    "bg-red-500",
    "hover:bg-red-600",
    "bg-green-500",
    "hover:bg-green-600"
  ],

Version info:

phoenix              1.7.20   
phoenix_html         4.2.1   
phoenix_live_reload  1.5.3  
phoenix_live_view    1.0.7 
tailwind             0.3.1  

gitkinder avatar Mar 22 '25 09:03 gitkinder

@gitkinder thanks for opening this issue. Not something we've experienced before. But hopefully it will help others who encounter the same issue. 👌

nelsonic avatar Mar 22 '25 10:03 nelsonic