Pare down the showcase's unlayered sizing classes
Plan step 38 (last batch): only two of the previous batch's three call sites actually need a plain unlayered class for their demo width — <x-input> forwards `style` to the raw <input>, not the field wrapper that is sized, and <x-datepicker> forwards neither, only `class`, `wire:key` and `x-model` — so .showcase-w-sm and .showcase-w-xs stay. <x-slider> does forward `style` to its root, so its vertical demo's shared height is one now instead of the .showcase-slider-vertical class. .showcase-w-narrow stays a class on purpose rather than an inline style: fields.blade.php's "Narrower" input demonstrates an application's own unlayered rule beating the package's layered default, and an inline style would win regardless of layers, proving nothing. The header explains all three. StylesheetsTest gains showcase.css's own shape check — the same rule every package stylesheet passes (header, layer statement, plain imports, no Tailwind directive, breakpoints only at M3's four) — with its three documented unlayered exceptions as the one allowed gap. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
42009f3b0c
commit
067626c52e
+18
-14
@@ -27,11 +27,7 @@
|
||||
* indicator, a bounded box for the FAB menu, a narrow chip row that forces its own scroll
|
||||
* affordance, a scrolling table wrapper, the legend above a checkbox grid, a bordered demo card,
|
||||
* 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 (`<x-input>`, `<x-datepicker>`,
|
||||
* `<x-slider>`) forward only `class` and `style` to the element that needs sizing, never a data
|
||||
* 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.
|
||||
* needs beyond the fixed `md-ink-*` set.
|
||||
*
|
||||
* Batch 4 (the last: containment, carousel, bars, navigation, pages) adds the standard side
|
||||
* sheet demo's own breakpoint (a `<x-row>` beats its own `stack-below` alignment back to `stretch`
|
||||
@@ -42,6 +38,18 @@
|
||||
* own horizontal-scroll wrapper, `rail`, `rail-wide`) with their filler "page" and content panes.
|
||||
* Every per-item carousel colour stays the caller's own inline `style`, the same mechanism as the
|
||||
* colour swatch above.
|
||||
*
|
||||
* Of the three call sites batch 3 found, two still cannot take a `style` for the width their
|
||||
* demos need: `<x-input>` forwards `style` to the raw `<input>`, not the field wrapper that is
|
||||
* actually sized, and `<x-datepicker>` forwards neither — its root takes only `class`, `wire:key`
|
||||
* and `x-model`. `.showcase-w-sm`, `.showcase-w-xs` stay plain unlayered classes for that reason,
|
||||
* 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. `.showcase-w-narrow` stays
|
||||
* one too, but to make a point on purpose (fields.blade.php's "Narrower" input): a small unlayered
|
||||
* rule from an application's own stylesheet beats the package's own layered default, so it has to
|
||||
* be a real class, not an inline `style` (which would win trivially and prove nothing). `<x-slider>`
|
||||
* does forward `style` to its root, so its vertical demo's height became one
|
||||
* (resources/views/showcase/sections/sliders.blade.php), and `.showcase-slider-vertical` is gone.
|
||||
*/
|
||||
|
||||
@layer material.reset, material.tokens, material.base, material.layout, material.components, material.text, material.visibility;
|
||||
@@ -553,9 +561,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* A handful of call sites (<x-input>, <x-datepicker>, <x-slider>) 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. */
|
||||
/* Two call sites still cannot take a `style` for the width their demo needs — see the file
|
||||
header — so these stay plain unlayered classes. */
|
||||
.showcase-w-sm {
|
||||
width: 192px;
|
||||
}
|
||||
@@ -564,12 +571,9 @@
|
||||
width: 144px;
|
||||
}
|
||||
|
||||
/* Deliberately unlayered, to make the point fields.blade.php's hint names: an application's own
|
||||
rule beats the package's layered default even though both set the same property. An inline
|
||||
`style` would win regardless of layers, which would not demonstrate that. */
|
||||
.showcase-w-narrow {
|
||||
max-width: 320px;
|
||||
}
|
||||
|
||||
/* <x-slider> forwards only class, style and wire:key to its wrapper, which the label and hint
|
||||
share with the track — so the vertical demo's shared height is a class too. */
|
||||
.showcase-slider-vertical {
|
||||
height: 256px;
|
||||
}
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
'Vertical' => <<<'BLADE'
|
||||
{{-- M3 Expressive's second orientation. A vertical slider needs a height: it is on the wrapper, which the label and hint share. --}}
|
||||
<x-livewire-material::row gap="space500" wrap align="end">
|
||||
<x-slider label="Volume" orientation="vertical" value="40" class="showcase-slider-vertical" hint="Up and Down" />
|
||||
<x-slider label="Warmth" orientation="vertical" value="6" :max="10" ticks class="showcase-slider-vertical" />
|
||||
<x-slider label="Brightness" orientation="vertical" value="70" size="md" icon="light_mode" class="showcase-slider-vertical" />
|
||||
<x-slider label="Always labelled" orientation="vertical" value="55" value-label="always" color="tertiary" class="showcase-slider-vertical" />
|
||||
<x-slider label="Locked" orientation="vertical" value="25" disabled class="showcase-slider-vertical" />
|
||||
<x-slider label="Volume" orientation="vertical" value="40" style="height: 256px;" hint="Up and Down" />
|
||||
<x-slider label="Warmth" orientation="vertical" value="6" :max="10" ticks style="height: 256px;" />
|
||||
<x-slider label="Brightness" orientation="vertical" value="70" size="md" icon="light_mode" style="height: 256px;" />
|
||||
<x-slider label="Always labelled" orientation="vertical" value="55" value-label="always" color="tertiary" style="height: 256px;" />
|
||||
<x-slider label="Locked" orientation="vertical" value="25" disabled style="height: 256px;" />
|
||||
</x-livewire-material::row>
|
||||
BLADE,
|
||||
'Colours and value labels' => <<<'BLADE'
|
||||
|
||||
Reference in New Issue
Block a user