Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic css clasees to color button did not work #253

Open
gitkinder opened this issue Mar 22, 2025 · 1 comment
Open

Dynamic css clasees to color button did not work #253

gitkinder opened this issue Mar 22, 2025 · 1 comment
Labels
help wanted Extra attention is needed question Further information is requested user-feedback

Comments

@gitkinder
Copy link

gitkinder commented Mar 22, 2025

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  
@nelsonic nelsonic added help wanted Extra attention is needed question Further information is requested user-feedback labels Mar 22, 2025
@nelsonic
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested user-feedback
Projects
None yet
Development

No branches or pull requests

2 participants