From 0eb03430082b20916bd91352474b7e3c9e78edc9 Mon Sep 17 00:00:00 2001 From: Andreas Reinhold / reini Date: Tue, 15 Sep 2026 04:53:58 +0200 Subject: [PATCH] Rewrite the showcase's Text fields and selection section without Tailwind MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plan step 38: every two-column layout moves onto with columns; the checkbox group's card, its legend and the two search demos' bespoke geometry (an avatar chip, the compact search-icon-button bar) move to data-md-showcase-* hooks. The two small demo controls and the "Narrower" field's override move to .showcase-w-sm/-xs/-narrow — plain, unlayered classes, since and forward only class and style to the element that needs sizing, never a data attribute. "Narrower"'s hint is reworded from "A max-w-* class" to "An unlayered rule from the call site wins", since that is now the mechanism being shown. FieldsTest's Chromium selectors run against an isolated fieldProbe fixture, not this page, so nothing there is at risk; #fields and every id (showcase-error, showcase-error-filled, showcase-audience, showcase-radio-theme) is unchanged. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9 --- resources/css/showcase.css | 62 +++++++- .../views/showcase/sections/fields.blade.php | 138 +++++++++--------- 2 files changed, 129 insertions(+), 71 deletions(-) diff --git a/resources/css/showcase.css b/resources/css/showcase.css index 54206ed5..2d206739 100644 --- a/resources/css/showcase.css +++ b/resources/css/showcase.css @@ -29,8 +29,9 @@ * a small circular avatar and a compact search bar, and the two ink colours a menu item's `icon-class` * needs beyond the fixed `md-ink-*` set. A handful of call sites (``, ``, * ``) forward only `class` and `style` to the element that needs sizing, never a data - * attribute, so those few rules below are `.md-showcase-*` classes rather than - * `data-md-showcase-*` hooks — the same "caller's class" mechanism any application would reach for. + * attribute, so a few widths below are plain `.showcase-*` classes instead of `data-md-showcase-*` + * hooks — the same "caller's class" mechanism any application would reach for, deliberately not + * named `md-*` since they are not part of the fixed set text.css declares. */ @layer material.reset, material.tokens, material.base, material.layout, material.components, material.text, material.visibility; @@ -397,4 +398,61 @@ width: 100%; max-width: 384px; } + + /* Text fields: the legend above a checkbox grid, a bordered demo card at two widths (a form, + a checkbox group), a small circular avatar for a search bar's trailing slot, and the + compact search-icon-button bar M3 uses as a secondary entry point. */ + [data-md-showcase-legend] { + margin-bottom: var(--md-sys-measurement-space200); + } + + [data-md-showcase-demo-card] { + width: 100%; + } + + [data-md-showcase-demo-card][data-md-showcase-size='md'] { + max-width: 576px; + } + + [data-md-showcase-demo-card][data-md-showcase-size='lg'] { + max-width: 672px; + } + + [data-md-showcase-avatar] { + display: grid; + place-items: center; + width: var(--md-sys-measurement-space400); + height: var(--md-sys-measurement-space400); + border-radius: var(--md-sys-shape-corner-full); + background-color: var(--md-sys-color-primary-container); + color: var(--md-sys-color-on-primary-container); + } + + [data-md-showcase-search-bar] { + display: flex; + align-items: center; + gap: var(--md-sys-measurement-space100); + border-radius: var(--md-sys-shape-corner-full); + background-color: var(--md-sys-color-surface-container-high); + padding: var(--md-sys-measurement-space50) var(--md-sys-measurement-space100); + } + + [data-md-showcase-search-bar-title] { + flex: 1 1 auto; + } +} + +/* A handful of call sites (, , ) forward only `class` and + `style` to the element that needs sizing, so these few widths are the caller's own classes + rather than data-md-showcase-* hooks — see the file header. */ +.showcase-w-sm { + width: 192px; +} + +.showcase-w-xs { + width: 144px; +} + +.showcase-w-narrow { + max-width: 320px; } diff --git a/resources/views/showcase/sections/fields.blade.php b/resources/views/showcase/sections/fields.blade.php index de789876..cf258a95 100644 --- a/resources/views/showcase/sections/fields.blade.php +++ b/resources/views/showcase/sections/fields.blade.php @@ -1,153 +1,153 @@ @php $examples = [ 'Outlined and filled text fields' => <<<'BLADE' -
-
+ + -
+ -
+ -
-
+ + BLADE, 'Errors, required and sizes' => <<<'BLADE' -
-
+ + -
+ -
+ -
- - -
-
-
+ + + + + + BLADE, 'Width at medium and above' => <<<'BLADE' -
+ {{-- M3: never let a text field span the full width of a large screen. From medium it stops at 40rem. --}} - + -
+ BLADE, 'Character counter' => <<<'BLADE' -
-
+ + -
+ -
+ BLADE, 'Textarea and select' => <<<'BLADE' -
-
+ + -
+ -
+ -
-
+ + BLADE, 'Checkboxes' => <<<'BLADE' -
-
+ + -
-
+ + -
-
+ + -
-
+ + BLADE, 'A checkbox group at expanded' => <<<'BLADE' {{-- M3: from expanded (840px), gather related checkboxes into a contained region instead of one long column. --}} - +
- Tell me about + Tell me about -
+ -
+
BLADE, 'Radio buttons' => <<<'BLADE' -
+ -
+ BLADE, 'Switches' => <<<'BLADE' -
-
+ + -
-
+ + -
-
+ + -
-
+ + BLADE, 'Choices' => <<<'BLADE' -
-
+ + -
+ -
+ -
-
+ + BLADE, 'Search' => <<<'BLADE' -
+
@@ -156,7 +156,7 @@ - AR + AR
@@ -167,10 +167,10 @@ Type to search your settings.
- + BLADE, 'Search entry points and suggestions' => <<<'BLADE' -
+
@@ -189,9 +189,9 @@
{{-- M3's search icon button: search as a secondary action, expanding into the full-screen view. --}} -
+
- Shares + Shares @@ -201,10 +201,10 @@ No shares match.
-
+
BLADE, 'A form' => <<<'BLADE' - + @@ -221,10 +221,10 @@ ]; @endphp -
-

Text fields and selection

+ +

Text fields and selection

-

+

<x-input>, <x-password>, <x-textarea>, <x-select>, <x-file> (all on <x-field>, outlined or filled), <x-checkbox>, <x-radio>, <x-toggle>, <x-choices>, <x-search> and <x-form>.

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