Rewrite the collapse without Tailwind

Plan step 36 (containment group): <x-collapse>'s Tailwind-era
resources/css/components/collapse.css (the height animation, C-24)
becomes the plain stylesheet, keyed on data-md-collapse and
data-md-variant; the summary renders the shared md-state-layer and
md-focus-ring classes instead of copying their rules. Leaves
tailwind.css for the Containment block of components.css.

Icon-to-title and title-to-chevron gaps stay 12px (not an M3 number;
collapse isn't an M3 component), written as the average of the two
adjacent spacing steps since the scale has no exact token for it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
Andreas Reinhold / reini
2026-09-14 20:26:52 +02:00
co-authored by Claude Sonnet 5
parent c887bcd054
commit 76abdd6242
6 changed files with 109 additions and 39 deletions
+7 -6
View File
@@ -10,24 +10,25 @@ it('discloses on the native details element, kept open through a morph', functio
->toContain('<details')
->toContain('wire:ignore.self')
->toContain(' open ')
->toContain('rounded-corner-lg bg-surface-container')
->toContain('data-collapse')
->toContain('[interpolate-size:allow-keywords]')
->toContain('data-md-collapse')
->toContain('data-md-variant="filled"')
->toContain('data-md-collapse-icon')
->toContain('data-md-collapse-chevron')
->toContain('How long do links last?')
->toContain('Until the expiry.')
->toContain('group-open/collapse:rotate-180');
->toContain('class="md-state-layer md-focus-ring"');
});
it('has no Alpine on it without a binding', function () {
$html = (string) $this->blade('<x-collapse title="Advanced" open>Body</x-collapse>');
expect($html)
->toMatch('/<details\s+wire:ignore.self\s+data-collapse\s+open\s+class="group\/collapse/')
->toMatch('/<details\s+wire:ignore.self\s+data-md-collapse\s+data-md-variant="plain"\s+open\s+/')
->not->toContain('x-data')
->not->toContain('x-modelable')
->not->toContain('x-on:toggle')
->and((string) $this->blade('<x-collapse title="Advanced">Body</x-collapse>'))
->toMatch('/<details\s+wire:ignore.self\s+data-collapse\s+class="group\/collapse/');
->toMatch('/<details\s+wire:ignore.self\s+data-md-collapse\s+data-md-variant="plain"\s+/');
});
it('binds its open state through x-model, drawing the open prop until Alpine starts', function () {
@@ -17,6 +17,7 @@ use NoNameWeb\LivewireMaterial\Tests\Support\ViewClasses;
*/
dataset('containment components', [
'divider',
'collapse',
]);
/**