Ensure checkbox always has a size class
This commit is contained in:
parent
50247bd066
commit
0c5a34dacb
|
@ -8,16 +8,18 @@
|
|||
export let id = null
|
||||
export let text = null
|
||||
export let disabled = false
|
||||
export let size = null
|
||||
export let size
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
const onChange = event => {
|
||||
dispatch("change", event.target.checked)
|
||||
}
|
||||
|
||||
$: sizeClass = `spectrum-Checkbox--size${size || "M"}`
|
||||
</script>
|
||||
|
||||
<label
|
||||
class="spectrum-Checkbox spectrum-Checkbox--size{size} spectrum-Checkbox--emphasized"
|
||||
class="spectrum-Checkbox spectrum-Checkbox--emphasized {sizeClass}"
|
||||
class:is-invalid={!!error}
|
||||
>
|
||||
<input
|
||||
|
|
Loading…
Reference in New Issue