You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flowbite docs for the <Fileupload> component show a "Choose File" button styled with a black background.
This might not suit everyone, so you might try to style this with a tailwind "file:bg-red-500" class, or similar. Disappointingly, you'll find this has no effect - the button remains stubbornly black.
Worse, you might also be unhappy with the 3rem height of the button. You'll find that you can style this with a Tailwind "h-[2rem]" or similar, but then you'll find that this loses the vertical alignment of the "Choose File" and "No File selected" text.
You might then try to use a native <input type="file">. You'll then be doubly disappointed because this will suffer from exactly the same problems.
This behaviour is not seen when the styling is applied in a Svelte/Tailwind project that doesn't use Flowbite-Svelte. It appears that the flowbite-svelte plugin triggers the issue.
Reproduction
`The HTML below in a project with Flowbite-Svelte installed sets the height of the input but doesn't vertically align its content and fails to set the background of its "Choose File" button to violet. The persistent black background is particularly annoying.
I've not been able to pin down exactly what triggers the problem in flowbite-svelte, but have found a workaround - just add the following (or similar) to your Svelte project's src/app.css file:
apparchsysad
changed the title
<Fileupload> styling seems to over-ride styling on native <input type="file> elements
It doesn't seem possible to set the color of the "button" element of a <Fileupload> component.
Jan 30, 2025
apparchsysad
changed the title
It doesn't seem possible to set the color of the "button" element of a <Fileupload> component.
flowbit-svelte is disabling file: pseudo-classes
Feb 1, 2025
apparchsysad
changed the title
flowbit-svelte is disabling file: pseudo-classes
flowbite-svelte is disabling Tailwind's file: pseudo-classes
Feb 1, 2025
apparchsysad
changed the title
flowbite-svelte is disabling Tailwind's file: pseudo-classes
flowbite-svelte disables Tailwind's file: pseudo-classes
Feb 1, 2025
Describe the bug
Flowbite docs for the
<Fileupload>
component show a "Choose File" button styled with a black background.This might not suit everyone, so you might try to style this with a tailwind "file:bg-red-500" class, or similar. Disappointingly, you'll find this has no effect - the button remains stubbornly black.
Worse, you might also be unhappy with the 3rem height of the button. You'll find that you can style this with a Tailwind "h-[2rem]" or similar, but then you'll find that this loses the vertical alignment of the "Choose File" and "No File selected" text.
You might then try to use a native
<input type="file">
. You'll then be doubly disappointed because this will suffer from exactly the same problems.This behaviour is not seen when the styling is applied in a Svelte/Tailwind project that doesn't use Flowbite-Svelte. It appears that the flowbite-svelte plugin triggers the issue.
Reproduction
`The HTML below in a project with Flowbite-Svelte installed sets the height of the input but doesn't vertically align its content and fails to set the background of its "Choose File" button to violet. The persistent black background is particularly annoying.
Flowbite version and System Info
The text was updated successfully, but these errors were encountered: