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

Modal background not transparent anymore, because of tailwind 2 removed classes in tailwind 4 #1557

Open
Ukalus opened this issue Mar 19, 2025 · 0 comments

Comments

@Ukalus
Copy link

Ukalus commented Mar 19, 2025

Describe the bug

bg-opacity- has been deprecated in Tailwind 3 and now completely removed in Tailwind 4.

could we update the Components to use opacity- instead?

workaround:

plugins: [
require("flowbite/plugin"),
plugin(function({ theme, matchUtilities }) {
const opacities = theme('opacity'); // Get the opacity theme values from Tailwind

  matchUtilities(
    {
      'bg-opacity': (value) => ({
        backgroundColor: `rgba(0, 0, 0, ${value})`, // Create the background color opacity utility
      }),
    },
    { values: opacities, type: 'value' } // Apply the values from the opacity theme
  );
}),

],

Reproduction

use Flowbite svelte with Tailwind 4

Flowbite version and System Info

"flowbite": "3.1.2",
"flowbite-svelte": "0.47.4",
"@tailwindcss/postcss": "4.0.14",
"svelte": "5.23.1",
"@sveltejs/kit": "2.19.2",
@Ukalus Ukalus changed the title Modal background not transparent anymore, because of tailwind 2 removed classes in tailwind 3 Modal background not transparent anymore, because of tailwind 2 removed classes in tailwind 4 Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant