svelteuidev / svelteui

SvelteUI Monorepo
https://svelteui.dev
MIT License
1.27k stars 63 forks source link

[@svelteui/core]: add Switch innerLabelSize property #440

Closed xon52 closed 11 months ago

xon52 commented 1 year ago

Description

While using inner labels (onLabel and offLabel) for the Switch component, I noticed that text was often moved further out of frame the longer it was, and that the size of font was unsuitable for emojies:

image image

To fix this I added a new property to override onLabel and offLabel sizes called innerLabelSize. I also changed the onLabel CSS from transform: translateX(-200%) to left: 10% which mirrors the offLabel CSS of right: 10%.

image image

Would love some feedback as my first contribution to this repo. Not too fussed if it's not suitable; it fixes my issue and thought I would share.

Before submitting the PR, please make sure you do the following

BeeMargarida commented 11 months ago

Sorry for taking so long to answer, this got buried in my notification box! I'll review this today!