From c87fc8ca411d368e0832605d7b47c91475328fd3 Mon Sep 17 00:00:00 2001 From: Andreas Reinhold / reini Date: Tue, 15 Sep 2026 04:47:59 +0200 Subject: [PATCH] Rewrite the showcase's Communication section without Tailwind Plan step 38: the badge/icon wrapper spans move to style="position: relative; display: inline-flex", the exact pattern 's own header documents; Alerts, Stats and the two empty states move onto / in place of w-full and a Tailwind grid, so a caller no longer sizes each child by hand. The "plain" badge (no colour of its own, by design) and the illustration's two decorative fills move to data-md-showcase-* hooks, as does the tooltip demo span's focus-ring corner; the shortcut kbds now use the data-md-showcase-kbd hook the frame batch already drew. No demo content removed; #communication, the toast/snackbar hooks and the rich-tooltip triggers (Press for details, About expiry) the Chromium CommunicationTest selectors read are unchanged. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9 --- resources/css/showcase.css | 24 +++++ .../showcase/sections/communication.blade.php | 100 ++++++++++-------- 2 files changed, 77 insertions(+), 47 deletions(-) diff --git a/resources/css/showcase.css b/resources/css/showcase.css index 046bb8a6..36520739 100644 --- a/resources/css/showcase.css +++ b/resources/css/showcase.css @@ -359,4 +359,28 @@ [data-md-showcase-icon-color='secondary'] [data-md-icon] { color: var(--md-sys-color-secondary); } + + /* Communication: the "plain" badge's own colours (that variant draws none, by design, so the + caller paints it), a focus ring's corner on a plain span standing in for a control, and the + illustration's two decorative colours beyond currentColor. */ + [data-md-showcase-badge-plain] { + background-color: var(--md-sys-color-primary-fixed); + color: var(--md-sys-color-on-primary-fixed); + } + + [data-md-showcase-focus-demo] { + border-radius: var(--md-sys-shape-corner-xs); + } + + [data-md-showcase-illustration='container'] { + fill: var(--md-sys-color-primary-container); + } + + [data-md-showcase-illustration='accent'] { + fill: var(--md-sys-color-tertiary); + } + + [data-md-showcase-illustration='on-accent'] { + fill: var(--md-sys-color-on-tertiary); + } } diff --git a/resources/views/showcase/sections/communication.blade.php b/resources/views/showcase/sections/communication.blade.php index 3059f2b5..e5c4a31a 100644 --- a/resources/views/showcase/sections/communication.blade.php +++ b/resources/views/showcase/sections/communication.blade.php @@ -1,9 +1,9 @@ @php $examples = [ 'Badges' => <<<'BLADE' - - - + + + @@ -11,37 +11,37 @@ - - Pro - + + Pro + BLADE, 'Snackbars' => <<<'BLADE' -
+ -
+ BLADE, 'Two lines, and the keyboard shortcut that reaches them' => <<<'BLADE' -
-
+ + -
+ -

+

A description makes the snackbar 68px, M3's two-line height; below medium the action wraps under the text. - Press Alt + G to move the focus to a snackbar that has an action. + Press Alt + G to move the focus to a snackbar that has an action.

-
+ BLADE, 'Plain tooltips' => <<<'BLADE' - holiday-photos.zip + holiday-photos.zip BLADE, 'Rich tooltips' => <<<'BLADE' @@ -57,52 +57,58 @@ BLADE, 'Alerts' => <<<'BLADE' - - - - The connection dropped at 64%. - - - + + + + + The connection dropped at 64%. + + + + BLADE, 'Stats' => <<<'BLADE' -
+ -
+ BLADE, 'Empty state' => <<<'BLADE' - - - - - + + + + + + + BLADE, 'Empty state with an illustration' => <<<'BLADE' - - - - - - - - + + + + + + + + + + BLADE, ]; @endphp -
-

Communication

+ +

Communication

-

+

<x-badge>, <x-toast> (the snackbar host, fed by the Toasts concern or materialToast()), <x-tooltip>, <x-rich-tooltip>, <x-alert>, <x-stat> and <x-empty-state>.

@@ -110,4 +116,4 @@ @foreach ($examples as $title => $code) @endforeach -
+