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

File input - button not rendering correctly #1023

Open
Dalidos opened this issue Jan 25, 2025 · 3 comments
Open

File input - button not rendering correctly #1023

Dalidos opened this issue Jan 25, 2025 · 3 comments

Comments

@Dalidos
Copy link

Dalidos commented Jan 25, 2025

Describe the bug
The file input button not rendering correctly

Image

and I fix the issue to force ::file-selector-button like this:

input[type="file"]::file-selector-button { font-size: 1rem; }

Image

  • Browser [chrome, firefox]
  • sveltejs/kit: 2
  • tailwindcss: 3.4.9
  • flowbite: 3.0.0
  • flowbite-svelte: 0.47.4
@PhilETaylor
Copy link

Are you sure you have not accidentally upgraded to Tailwind 4?
Mine were all working fine until I upgraded to Tailwind 4 this week, now I have had to manually override flowbite with the following

file:mr-4 file:py-1 file:px-2 file:-mt-1 file:-mb-1 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-black file:text-white p-2.5 block w-full text-sm text-gray-900 border border-gray-300 rounded-lg cursor-pointer bg-gray-50 dark:text-gray-400 focus:outline-none dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400

This gives a nice

Image

The file upload example at https://flowbite.com/docs/components/forms/#file-upload certainly doesnt work in Tailwind 4.

@rashhworld
Copy link

Are you sure you have not accidentally upgraded to Tailwind 4? Mine were all working fine until I upgraded to Tailwind 4 this week, now I have had to manually override flowbite with the following

file:mr-4 file:py-1 file:px-2 file:-mt-1 file:-mb-1 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-black file:text-white p-2.5 block w-full text-sm text-gray-900 border border-gray-300 rounded-lg cursor-pointer bg-gray-50 dark:text-gray-400 focus:outline-none dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400

This gives a nice

Image

The file upload example at https://flowbite.com/docs/components/forms/#file-upload certainly doesnt work in Tailwind 4.

is there any way to change the black color bg to any other colour?

@PhilETaylor
Copy link

PhilETaylor commented Jan 30, 2025

Change file:bg-black - simples.

Here is a share of the play, the first is the copy and paste from Flowbite, which as you can see doesnt work in Tailwind 4.0.1

and the second is mine, with the above classes, and made yellow as a PoC

https://play.tailwindcss.com/XpDC7iVYDL

Image

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

3 participants