diff --git a/resources/css/components/toggle.css b/resources/css/components/toggle.css index d5915561..d2943278 100644 --- a/resources/css/components/toggle.css +++ b/resources/css/components/toggle.css @@ -11,8 +11,10 @@ * state layer is a 40px circle around the handle. Its icons are 16px, on-primary-container when on. * Disabled, the track is on-surface at 12% and the handle on-surface at 38% (surface when on). * - * [data-md-switch] the track; `data-md-icons` = "both" or "selected" - * input, [data-md-switch-handle] (with [data-md-switch-on] and [data-md-switch-off] icons) + * [data-md-toggle] the root; `class` and `style` land here + * [data-md-selection-row] data-md-right puts the switch at the end of the row + * [data-md-switch] the track; `data-md-icons` = "both" or "selected" + * input, [data-md-switch-handle] (with [data-md-switch-on] and [data-md-switch-off] icons) */ @layer material.reset, material.tokens, material.base, material.layout, material.components, material.text, material.visibility; @@ -21,6 +23,10 @@ @import './icon.css'; @layer material.components { + [data-md-toggle] { + min-width: 0; + } + /* The positions below are the handle's centres less half its size, measured inside the track's 2px outline. */ [data-md-switch] { diff --git a/resources/views/components/toggle.blade.php b/resources/views/components/toggle.blade.php index 43c185e8..5631fc5d 100644 --- a/resources/views/components/toggle.blade.php +++ b/resources/views/components/toggle.blade.php @@ -7,8 +7,8 @@ cross when off; `icons="selected"` only the check. Every other attribute reaches the `` (resources/css/components/toggle.css). - Without a label the row is only the 52×32 track, so the track carries `touch-target` and catches - presses over M3's 48px minimum. --}} + Without a label the row is only the 52×32 track, so the track carries `md-touch-target` and + catches presses over M3's 48px minimum. `class` and `style` land on the root, `data-md-toggle`. --}} @props([ 'label' => null, @@ -23,35 +23,30 @@ $icons = $icons === 'selected' ? 'selected' : ($icons ? 'both' : null); @endphp -
only(['class', 'wire:key'])->class(['min-w-0']) }}> -