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

Broke button styles #62

Open
fyastreb opened this issue Aug 11, 2022 · 20 comments
Open

Broke button styles #62

fyastreb opened this issue Aug 11, 2022 · 20 comments

Comments

@fyastreb
Copy link

Laravel Nova 4.12.14

'Toggle Switch Field' has been installed and buttons on every Resource Create Page are broken (styles):

image

'Toggle Switch Field' has been removed and buttons is OK

image

Could you fix it?

@scramatte
Copy link

scramatte commented Aug 16, 2022

Hello,

Same issue here, it's quite annoying. Could you fix it ?

Regards

@davidpiesse
Copy link
Owner

Looks like a tailwind conflict.... Do you know what CSS / tw class is being a problem?

@scramatte
Copy link

These are button css class
ml-auto shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 ml-auto cursor-pointer rounded text-sm font-bold focus:outline-none focus:ring ring-primary-200 dark:ring-gray-600 inline-flex items-center justify-center h-9 px-3 ml-auto shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 ml-auto

This are toggle css class
tw-bg-green-500 tw-relative tw-inline-flex tw-h-6 tw-w-12 tw-items-center tw-rounded-full tw-shrink-0 tw-cursor-pointer tw-border-2 tw-border-transparent tw-transition-colors tw-duration-200 tw-ease-in-out tw-focus:tw-outline-none tw-focus-visible:tw-ring-2 tw-focus-visible:tw-ring-white tw-focus-visible:tw-ring-opacity-75

All your class are prefixed by tw- I really don't know what can be the conflict.
This is probably something with button default background color.

@davidpiesse
Copy link
Owner

laravel/nova-issues#4394

It is an opacity thing...
You may need to remove the opacity settings from your default colors.

ala

'colors' => [
    "400" => "251,154,164",
    "500" => "238,43,71",
    "600" => "245,103,118",
]

@scramatte
Copy link

Hi,

Fix doesn't work for me. Have you test it on your side?
Regards

@davidpiesse
Copy link
Owner

I set my nova color defaults in the config file and it worked!

@scramatte
Copy link

Which version of nova 4 are you using?
I've made php artisan config:clear and php artisan optimize and nothing ...
What I've missed?

@davidpiesse
Copy link
Owner

Have you rebuilt your nova js and CSS?

@scramatte
Copy link

scramatte commented Aug 20, 2022 via email

@davidpiesse
Copy link
Owner

php artisan nova:publish should help out. Its in the Nova 4 install instructions. It doesn't seem to be necessary, but it may help

@jodhaakbar
Copy link

still issue on nova 4.13.0

@davidpiesse
Copy link
Owner

I have just pushed another commit onto the v4 branch that should fix this.
When adding in the tw extras it for some reason sets the button bg back to transparent...

button,
[type='button'],
[type='reset'],
[type='submit'] {
  -webkit-appearance: button; /* 1 */
  background-color: transparent; /* 2 */
  background-image: none; /* 2 */
}

@kitro
Copy link

kitro commented Sep 23, 2022

Same issue still ocurred with v4

@davidpiesse
Copy link
Owner

@kitro Just want to double check you are using the v4 branch and not the main branch?

@kitro
Copy link

kitro commented Sep 23, 2022

@davidpiesse The issue is fixed in dev-master 👍
just in my project, there is another package Visanduma/nova-two-factor#8 has the same issue it's also fixed.
Thank you,

@davidpiesse
Copy link
Owner

I have implemented another fix for the CSS.
Please check the v4 branch now.

@kitro
Copy link

kitro commented Sep 23, 2022

It works 👍
The SHA tested is 3b21f7979a692faacb32ec51d065b2a6f74a36bf
image
Thanks,

@matthewhutchings
Copy link

matthewhutchings commented Oct 30, 2022

Getting the same issue using:

Nova v4.16.1
davidpiesse/nova-toggle (4.0)
"tailwindcss": "^3.1.0",

@RibesAlexandre
Copy link

Hi,

I got the same issue with dev-master branch and Nova 4.18

@gemanzo
Copy link

gemanzo commented Mar 3, 2023

Fixed, thank you!

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

8 participants