flowbite-svelte
flowbite-svelte copied to clipboard
Select: "sm" font size does not match input "sm" font size
Describe the bug
Select and Input with size "sm" have different font sizes on desktop and mobile.
It seems size "sm" adds an extra class "sm:text-xs" to the Input that a Select with size "sm" does not get. It also seems on mobile the font-size for Inputs with size "sm" is whatever the body size is, there is no set size. But on the Select there is a size of "text-sm"
<Input size="sm" />
<Select size="sm" />
So I have to remedy this by applying the sm class to the select but even then the Select is still around 4px less high then the Input:
<Select size="sm" class="text-inherit sm:text-xs" />
Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-gtfzw3?file=src%2Froutes%2F%2Bpage.svelte
Flowbite version and System Info
"flowbite": "^1.8.1",
"flowbite-svelte": "^0.44.17",
Start a new pull request in StackBlitz Codeflow.
I got over flighting with StackBlitz and trying to open a PR.
In the Select we need to change the sizes to this to solve the problem. I have tested the below:
const sizes = {
sm: 'sm:text-xs p-2',
md: 'text-sm p-2.5',
lg: 'sm:text-base py-3 px-4'
};
With Inputs it also seems that "size=sm" has font-size 16px on mobile but "size=md" has font-size 14px... which doesnt make sense if you think about it.