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

Tailwind css dark mode classes not picked up when passed as props. #277

Open
federicomarcantognini opened this issue Dec 12, 2023 · 2 comments
Labels
bug Something isn't working style Anything CSS related

Comments

@federicomarcantognini
Copy link

federicomarcantognini commented Dec 12, 2023

It looks as Tailwind CSS dark mode styles cannot do anything when passed as props. For instance:

<MultiSelect 
        id="..."
        closeDropdownOnSelect = 'true'
        outerDivClass = "!dark:bg-gray-800 !bg-gray-100"
>
...
</MultiSelect>

the dark: does not affect the component CSS style. Also, each Tailwind CSS style passed as props needs to be !important otherwise no effect.

Am I missing something?

@federicomarcantognini federicomarcantognini added the bug Something isn't working label Dec 12, 2023
@federicomarcantognini federicomarcantognini changed the title Tailwind css dark mode not picking up classes? Tailwind css dark mode classes not picked up when passed as props. Dec 12, 2023
@janosh janosh added the style Anything CSS related label Jan 15, 2024
@janosh
Copy link
Owner

janosh commented Jan 15, 2024

See sveltejs/svelte#6859 and various previous issues in this repo (e.g. #257) on why a fix is not straightforward.

@enzon19
Copy link

enzon19 commented Feb 10, 2024

You are using it wrong... It's dark:!bg-gray-800 !bg-gray-100. This works fine for me

See more:
https://tailwindcss.com/docs/configuration#important-modifier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working style Anything CSS related
Projects
None yet
Development

No branches or pull requests

3 participants