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

Dark mode - styles not correctly applied for me #212

Closed
gkimpson opened this issue Mar 17, 2024 · 7 comments
Closed

Dark mode - styles not correctly applied for me #212

gkimpson opened this issue Mar 17, 2024 · 7 comments

Comments

@gkimpson
Copy link

gkimpson commented Mar 17, 2024

I'm using this in Laravel 11.x and i'm having an issue with dark mode in regards to the CSS being incorrectly styled for some reason with the datepicker component (see screenshot below) - obviously my configuration is wrong somewhere just not quite sure what yet. I just wondered is there a codepen or similar thing setup with Bladewind UI to allow me to compare my Laravel blade template code with the proper way of setting Bladewind UI up?

I am using the latest version 2.5.2 and have done the steps to update Bladewind and have run the following commands

php artisan vendor:publish --provider="Mkocansey\Bladewind\BladewindServiceProvider" --tag=bladewind-public --force
php artisan vendor:publish --provider="Mkocansey\Bladewind\BladewindServiceProvider" --tag=bladewind-components --force
image

Note - this is not a bug I am just unsure what I'm doing wrong

below is how my blade template currently looks like
(Layout file)
https://gist.github.com/gkimpson/eea60de582f0d738a41a714bcaeb4baa

(File that uses datepicker)
https://gist.github.com/gkimpson/33012d1dc12aa44a9959f69ccd772915

@gkimpson
Copy link
Author

This appears to be related to TailwindCSS and the app.css file that Laravel generates overriding styles - will look more into it

@gkimpson
Copy link
Author

Ok I have appeared to semi-fix this now..
I'll test this a bit more and give more info later not sure if it will assist as it is possible

image image

@mkocansey
Copy link
Owner

mkocansey commented Mar 17, 2024

Hey @gkimpson, glad you got this working somehow.
A good place to start will be your tailwind.config.js file.

BladewindUI uses the value you have defined for the theme > extend > colors > dark key.
The example config below sets dark as colors.slate. Hope this helps

    theme: {
        extend: {
            colors: {
                primary: colors.blue,
                secondary: colors.slate,
                green: colors.emerald,
                dark: colors.slate,
                success: colors.emerald,
                error: colors.red,
                warning: colors.amber,
                info: colors.blue
            }
        },

@mkocansey
Copy link
Owner

mkocansey commented Mar 17, 2024

Also, there is unfortunately no codepen but I'd advise to clone (or browse the source of) the BladewindUI documentation website since it always uses the latest version of the library.

@gkimpson
Copy link
Author

Thanks for the heads-up Michael! i'll check the config now much appreciated!!!

@gkimpson
Copy link
Author

Thanks!!! What a legend, thanks Michael I was missing the extended colors in my tailwind config file - all looking good thanks again

@mkocansey
Copy link
Owner

Awesome awesome

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

2 participants