diff --git a/src/components/switch/bl-switch.css b/src/components/switch/bl-switch.css index 4f3464cb..8d821082 100644 --- a/src/components/switch/bl-switch.css +++ b/src/components/switch/bl-switch.css @@ -1,6 +1,7 @@ :host { display: inline-block; cursor: pointer; + vertical-align: middle; } span { @@ -40,6 +41,32 @@ span { width: var(--thumb-width); } +label { + display: flex; + gap: var(--bl-size-2xs); + color: var(--bl-color-neutral-darker); + font: var(--bl-font-title-3); + cursor: pointer; + user-select: none; + line-height: normal; + align-items: center; + margin-block: 0; +} + +.label { + overflow-wrap: anywhere; +} + +:host([disabled]) .label { + color: var(--bl-color-neutral-light); + border: 1px solid var(--bl-color-neutral-lighter); +} + +:host([checked]) .label, +:host(:hover) .label { + color: var(--bl-color-primary); +} + :host([checked]) .switch { --switch-color: var(--bl-switch-color-on, var(--bl-switch-color, var(--bl-color-primary))); } diff --git a/src/components/switch/bl-switch.stories.mdx b/src/components/switch/bl-switch.stories.mdx index bc984b17..1cc5bacf 100644 --- a/src/components/switch/bl-switch.stories.mdx +++ b/src/components/switch/bl-switch.stories.mdx @@ -26,14 +26,11 @@ export const SwitchTemplate = (args) => html` `; export const SwitchWithLabel = (args) => html` -