From 91f49be6d7f4771d24602f217ac6bccfb05386c5 Mon Sep 17 00:00:00 2001 From: Andreas Reinhold Date: Mon, 14 Sep 2026 05:52:26 +0200 Subject: [PATCH] Draw a button's spinner in the button's own ink MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The loading indicator inside a filled or tonal button was painted in text-primary on a primary container — 1:1 contrast. M3 asks an indicator embedded in another component to take that component's label colour, so the button now passes text-current, which loading.blade.php reads as a caller colour and leaves alone. Plan step 11, actions.md ACT-01. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9 --- resources/views/components/button.blade.php | 6 ++++-- tests/Feature/Components/ButtonTest.php | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/resources/views/components/button.blade.php b/resources/views/components/button.blade.php index dd8d75c5..0a35e9c0 100644 --- a/resources/views/components/button.blade.php +++ b/resources/views/components/button.blade.php @@ -24,7 +24,9 @@ Behaviour kept from maryUI: `link` renders an anchor with `wire:navigate` (unless `external` or `no-wire-navigate`); `disabled` works on a link too, as `aria-disabled`; `spinner` shows the loading indicator while the button's own `wire:click` runs (or the action named by a - string); `responsive` hides the label below `expanded` (840px, where M3 lets buttons reposition); + string), drawn in the button's own ink — M3 asks an indicator embedded in another component + to take that component's label colour, so it stays visible on a filled or tonal container; + `responsive` hides the label below `expanded` (840px, where M3 lets buttons reposition); `tooltip`, `tooltip-left`, `tooltip-right` and `tooltip-bottom` attach a plain tooltip. `fab` is a page's create action: an extended FAB pinned in the thumb zone on a compact window (below `medium`, 600px), a filled button from @@ -206,7 +208,7 @@ <{{ $tag }} {{ $attributes }}> @if ($spinnerTarget) - + @endif diff --git a/tests/Feature/Components/ButtonTest.php b/tests/Feature/Components/ButtonTest.php index 4de5bb2b..9a7543d5 100644 --- a/tests/Feature/Components/ButtonTest.php +++ b/tests/Feature/Components/ButtonTest.php @@ -120,10 +120,12 @@ it('disables a button, and a link as far as a link can be', function () { ->assertSee('tabindex="-1"', false); }); -it('shows the loading indicator while its own action runs', function () { +it('shows the loading indicator while its own action runs, in the button\'s own ink', function () { $this->blade('') ->assertSee('wire:loading.attr="disabled"', false) - ->assertSee('wire:target="save"', false); + ->assertSee('wire:target="save"', false) + ->assertSee('size-5 text-current', false) + ->assertDontSee('text-primary"', false); $this->blade('') ->assertSee('wire:target="upload"', false);