filament icon indicating copy to clipboard operation
filament copied to clipboard

Preflight of Tailwind take precedence on background-color of input field

Open happytodev opened this issue 3 years ago • 5 comments

Package

filament/forms

Package Version

v2.15.28

Laravel Version

v9.26.1

Livewire Version

v2.10.7

PHP Version

PHP 8.1

Problem description

I have something weird with Tailwind. First of all, all my classes are correctly generated and accessible. In a button, I affect a background color. But, the preflight of Tailwind :

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

takes precedence on my bg-red-300 for example.

If I uncheck background-color: transparent;, it works.

You can find the code in this repository https://github.com/happytodev/filament-tailwind-color-picker

Adam (@awcodes) already knows about this bug as we discussed about it on Discord.

Expected behavior

I expect that the bg-{color}-{level} applies on the input field as background color and not the bg-transparent instead

Steps to reproduce

The quickest way is to install filament demo.

Then composer require happytodev/filament-tailwind-color-picker

The version of plugin is v0.1.3

After that edit postResource.php to add a Tailwind Color Picker field :

use HappyToDev\FilamentTailwindColorPicker\Forms\Components\TailwindColorPicker;
...
                                    
        TailwindColorPicker::make('textColor')
                ->setScope('text-'),
                

Load the admin and edit a post. Select a color for the field, normally the color picker button must change the background color.

With this bug it did not.

Reproduction repository

https://github.com/happytodev/filament-tailwind-color-picker

Relevant log output

No response

happytodev avatar Aug 27 '22 18:08 happytodev

Sorry, we had to roll this back, since it was causing too many issues. We will address this with v3 again,

pxlrbt avatar Aug 30 '22 11:08 pxlrbt

No worries. I understand.

awcodes avatar Aug 30 '22 11:08 awcodes

Should we leave this issue open or close it, @pxlrbt?

zepfietje avatar Aug 30 '22 12:08 zepfietje

It's still an issue, so I'd say leave it open, until we fix it with V3.

pxlrbt avatar Aug 30 '22 12:08 pxlrbt

maybe add a v3 label?

saade avatar Aug 31 '22 15:08 saade

I think this will automatically be resolved in v3 with the new asset manager.

For v2 it was fixed but reverted because it broke a lot of plugins and it was easier to revert than make all the plugins update accordingly.

awcodes avatar Nov 02 '22 23:11 awcodes

Alright cool! Thanks.

danharrin avatar Nov 02 '22 23:11 danharrin