nova-toggle icon indicating copy to clipboard operation
nova-toggle copied to clipboard

Broke button styles

Open fyastreb opened this issue 1 year ago • 20 comments

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?

fyastreb avatar Aug 11 '22 20:08 fyastreb

Hello,

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

Regards

scramatte avatar Aug 16 '22 14:08 scramatte

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

davidpiesse avatar Aug 16 '22 18:08 davidpiesse

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.

scramatte avatar Aug 16 '22 21:08 scramatte

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",
]

davidpiesse avatar Aug 17 '22 07:08 davidpiesse

Hi,

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

scramatte avatar Aug 18 '22 18:08 scramatte

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

davidpiesse avatar Aug 18 '22 18:08 davidpiesse

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?

scramatte avatar Aug 20 '22 09:08 scramatte

Have you rebuilt your nova js and CSS?

davidpiesse avatar Aug 20 '22 14:08 davidpiesse

No, I don’t know how to achieve this …

scramatte avatar Aug 20 '22 14:08 scramatte

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

davidpiesse avatar Aug 20 '22 17:08 davidpiesse

still issue on nova 4.13.0

jodhaakbar avatar Sep 06 '22 03:09 jodhaakbar

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 */
}

davidpiesse avatar Sep 06 '22 08:09 davidpiesse

Same issue still ocurred with v4

kitro avatar Sep 23 '22 11:09 kitro

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

davidpiesse avatar Sep 23 '22 12:09 davidpiesse

@davidpiesse The issue is fixed in dev-master :+1: just in my project, there is another package https://github.com/Visanduma/nova-two-factor/issues/8 has the same issue it's also fixed. Thank you,

kitro avatar Sep 23 '22 15:09 kitro

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

davidpiesse avatar Sep 23 '22 16:09 davidpiesse

It works :+1: The SHA tested is 3b21f7979a692faacb32ec51d065b2a6f74a36bf image Thanks,

kitro avatar Sep 23 '22 18:09 kitro

Getting the same issue using:

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

matthewhutchings avatar Oct 30 '22 10:10 matthewhutchings