themesberg / flowbite-svelte

Official Svelte components built for Flowbite and Tailwind CSS
https://flowbite-svelte.com
MIT License
2.22k stars 272 forks source link

Checkbox "class" property applies to label, not checkbox #1231

Open howesteve opened 9 months ago

howesteve commented 9 months ago

Describe the bug

The <Checkbox> component is not customizable as the other components. Using <Checkbox class="xxx"> will affect it's label, not the checkbox itself. For instance, if I want to change the checkbox's ring or color to a custom color (I'm aware of the "color" property, I mean a custom color), I can't. This is not on pair as with other components. Due to the same css limitation, I can't also change the checkmark symbol.

I'm suggesting class should apply the checkbox mark itself, and a secondary labelClass should affect the label.

However... this change, which seems a logical one to me, could be a breaking one. Maybe it's better to implement a checkboxClass that applies to the checkbox mark instead, so current behavior is kept. That could prevent the breaking changes, but would remain inconsistent with the behavior of the rest of the lib.

Reproduction

-

Flowbite version and System Info

0.44.22 (latest)
stackblitz[bot] commented 9 months ago

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.