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

bg-blue/50 + bg-opacity-100 doesn't change opacity #463

Closed
hmaesta opened this issue Aug 22, 2024 · 3 comments
Closed

bg-blue/50 + bg-opacity-100 doesn't change opacity #463

hmaesta opened this issue Aug 22, 2024 · 3 comments
Labels
context-v2 Related to tailwind-merge v2

Comments

@hmaesta
Copy link

hmaesta commented Aug 22, 2024

I understand that these classes generate different outputs.

  • bg-blue/50 generates { background-color: rgb(0 0 255 / 0.5) }, which ignores the Tailwind variable --tw-bg-opacity
  • While bg-opacity-100 generates { --tw-bg-opacity: 1 }

However, this limitation is not documented.

Should it be documented? Or is this a bug?

@github-actions github-actions bot added the context-v2 Related to tailwind-merge v2 label Aug 22, 2024
@dcastil
Copy link
Owner

dcastil commented Aug 29, 2024

Hey @hmaesta! 👋

This is a limitation of Tailwind CSS but not tailwind-merge. tailwind-merge only decides how different classes in strings are merged together, but doesn't alter the resulting CSS.

Or am I misunderstanding what you mean? 🤔

@hmaesta
Copy link
Author

hmaesta commented Aug 29, 2024

This is a limitation of Tailwind CSS

That's what I thought, but I just wanted to be sure. I was hoping tailwind-merge could find a way around that limitation somehow. 😅

Thanks for the response.

@dcastil
Copy link
Owner

dcastil commented Aug 29, 2024

Yeah tailwind-merge can't change the CSS produced by Tailwind, only Tailwind CSS can do that. I suggest to open an issue in the https://github.com/tailwindlabs/tailwindcss repo.

@hmaesta hmaesta closed this as completed Aug 29, 2024
@hmaesta hmaesta closed this as not planned Won't fix, can't repro, duplicate, stale Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
context-v2 Related to tailwind-merge v2
Projects
None yet
Development

No branches or pull requests

2 participants