Take Tailwind out of the package, and its detection out of the guard
tests / feature (8.4) (push) Successful in 2m0s
tests / feature (8.5) (push) Successful in 2m0s
tests / browser (chrome, chromium) (push) Failing after 8m3s
tests / browser (firefox, firefox) (push) Failing after 12m58s
tests / browser (safari, webkit) (push) Failing after 13m8s

Tailwind left the stack in 2.0.0, but the package still carried about 330
mentions of it. What the guard's Tailwind detection protected — a class
that compiles to nothing — is now protected by a check that does not care
where a dead class came from.

DesignGuard: about 500 lines of Tailwind tables, scales, palettes and
"2.0.0 replacement" hints give way to one check — a class a view or PHP
file writes that neither the application's stylesheets nor the package's
own declare. It catches a utility of any framework, a typo and a class
whose rules were deleted alike, so it also found two classes ReStride
draws nothing with. A stylesheet has to be in reach for it: the `.css`
files among the scanned paths, or what the `missingStylesheets()` entry
imports. The class reader no longer mistakes an array index for a class
list (`$block['base']`), and it reads the array a class helper is given,
where it read nothing before.

The package's own three Tailwind self-guards go with it. Only their one
unique check stays, as a test of its own: every `matchMedia` width in
resources/js is an M3 breakpoint.

The pagination views are `material.blade.php` and
`simple-material.blade.php`; only Laravel's and Livewire's default theme
names ever made them `tailwind`. The provider sets `Paginator`'s default
views and switches `livewire.pagination_theme` to `material` when it is
still Livewire's own default, so no application can forget the config; a
theme an application chose, and a component's own `$paginationTheme` or
`paginationView()`, still win.

The rest is prose: the layer-order guidance for an application that still
builds Tailwind, the Tailwind wording in the README, the Boost guidelines
and the development skill, and about 25 "this used to be a Tailwind
utility" comments, along with every "plan step NN" pointer into a
gitignored folder. The reset keeps its credit, and NOTICE now carries it
too.

Feature suite 1159 passed, Chrome browser suite 299 passed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Andreas Reinhold / reini
2026-09-17 21:07:39 +02:00
co-authored by Claude Opus 5
parent 247c596c3a
commit fb7007c976
88 changed files with 649 additions and 1521 deletions
@@ -1,11 +1,10 @@
<?php
/**
* A caller's `class` and `style` land on a component's root, untouched and once (the Phase F rule
* in docs/plans/material-3-alignment-brief.md): an application's width or margin sizes the whole
* component, whichever element its other attributes reach. The field family, the pickers and the
* components that split their attributes between a root and an inner control are the ones that
* can get it wrong, so each is rendered here with both.
* A caller's `class` and `style` land on a component's root, untouched and once: an application's
* width or margin sizes the whole component, whichever element its other attributes reach. The
* field family, the pickers and the components that split their attributes between a root and an
* inner control are the ones that can get it wrong, so each is rendered here with both.
*/
it('lands a caller\'s class and style on the root, and only there', function (string $blade) {
$html = (string) $this->blade($blade);
@@ -5,16 +5,16 @@ use NoNameWeb\LivewireMaterial\Tests\Support\ComponentStylesheet;
use NoNameWeb\LivewireMaterial\Tests\Support\ViewClasses;
/**
* Every component and layout-shared stylesheet, rewritten without Tailwind (plan step 36): each
* view renders `data-md-*` attributes and no class list of its own beyond the interaction and text
* classes (tests/Support/ViewClasses.php), writes its values from the tokens and its breakpoints as
* px range queries, and is imported from its own block of all.css. This used to be four near-copies
* of the same checks, one per group (Action/Containment/Input/Navigation), plus a fifth in
* ErrorPagesTest.php for the error layout — folded into this one file (plan cleanup) because the
* checks never differed in substance, only in which names they ran over and, for the token check,
* which box-shadow shape a group's own values may take (see $boxShadow below). `icon` and `shape`
* (no group's view renders them exclusively) and `color` (its own ColorTest.php already covers it,
* the shared colour-role table every hue-taking component imports) keep their separate treatment.
* Every component and layout-shared stylesheet: each view renders `data-md-*` attributes and no
* class list of its own beyond the interaction and text classes (tests/Support/ViewClasses.php),
* writes its values from the tokens and its breakpoints as px range queries, and is imported from
* its own block of all.css. This used to be four near-copies of the same checks, one per group
* (Action/Containment/Input/Navigation), plus a fifth in ErrorPagesTest.php for the error layout —
* folded into this one file (plan cleanup) because the checks never differed in substance, only in
* which names they ran over and, for the token check, which box-shadow shape a group's own values
* may take (see $boxShadow below). `icon` and `shape` (no group's view renders them exclusively)
* and `color` (its own ColorTest.php already covers it, the shared colour-role table every
* hue-taking component imports) keep their separate treatment.
*
* Four names in the dataset are not a component view of their own: `selection` (what checkbox,
* radio and toggle share), `navigation-item` (what the bar and the rail's items share), `pagination`
@@ -103,9 +103,9 @@ dataset('scoped selectors', function (): Generator {
it('draws the component from a stylesheet shaped like every package stylesheet', function (string $name) {
$css = ComponentStylesheet::read($name);
// The header, the layer statement, the plain imports and freedom from Tailwind are
// StylesheetsTest's, checked over every file all.css reaches; only the block layer and the
// imports' existence are this dataset's own to check.
// The header, the layer statement and the plain imports are StylesheetsTest's, checked over
// every file all.css reaches; only the block layer and the imports' existence are this
// dataset's own to check.
expect($css->blocks())->each->toBe('@layer material.components');
foreach ($css->imports() as $import) {
@@ -173,10 +173,10 @@ it('scopes every element-wide selector to a data-md hook', function (string $nam
// ---- pagination: its views live outside resources/views/components/ --------------------------
dataset('pagination views', [
'pagination/laravel/tailwind',
'pagination/laravel/simple-tailwind',
'pagination/livewire/tailwind',
'pagination/livewire/simple-tailwind',
'pagination/laravel/material',
'pagination/laravel/simple-material',
'pagination/livewire/material',
'pagination/livewire/simple-material',
]);
it('imports the stylesheet of every component pagination\'s views render', function (string $view) {
@@ -103,7 +103,7 @@ it('hides on a scroll down and springs back on a scroll up', function () {
->toBe(['translate' => '0 100%'])
// Reads --material-bottom-bar back from <x-scaffold>: layout/scaffold.css publishes it in
// `material.layout`, which this rule's own `material.components` always outranks, so both
// sit in a layer now (the era of an unlayered Tailwind utility is gone).
// sit in a layer.
->and($css->declarations('[data-md-scaffold]:has([data-md-navigation-bar][data-md-hide-on-scroll][data-md-hidden])'))
->toBe(['--material-bottom-bar' => 'calc(var(--material-safe-bottom, env(safe-area-inset-bottom)) + var(--material-bottom-extra, 0px))']);
@@ -143,14 +143,14 @@ it('hides a collapsible or adaptive rail entirely when told to, and only those',
});
/**
* The Tailwind-era `rail-collapsed:` custom variant had seven branches for "this rail is drawn
* collapsed"; navigation-rail.css merges the three that carry no media query into one `:where()`
* (provably the same match set: an element matches `X:where(A, B, C)` exactly when it matches
* `X:where(A)` or `X:where(B)` or `X:where(C)`) and keeps the four media-gated ones separate, since
* CSS cannot merge different `@media` queries into one rule. This pins all five physical branches
* — and so every one of the seven original conditions — for the rail's own width, the property
* every branch sets, and for `--md-navigation-rail-value`, which each branch turns from `expanded`
* to `collapsed` so an application's style query answers exactly when the rail's own shape does.
* "This rail is drawn collapsed" has seven conditions in all; navigation-rail.css merges the three
* that carry no media query into one `:where()` (provably the same match set: an element matches
* `X:where(A, B, C)` exactly when it matches `X:where(A)` or `X:where(B)` or `X:where(C)`) and keeps
* the four media-gated ones separate, since CSS cannot merge different `@media` queries into one
* rule. This pins all five physical branches — and so every one of the seven original conditions —
* for the rail's own width, the property every branch sets, and for `--md-navigation-rail-value`,
* which each branch turns from `expanded` to `collapsed` so an application's style query answers
* exactly when the rail's own shape does.
*/
it('holds a closing rail on screen for its exit rather than transitioning display', function () {
$css = ComponentStylesheet::read('navigation-rail');
+1 -1
View File
@@ -24,7 +24,7 @@ it('draws a search bar whose combobox controls the view', function () {
->toContain('materialSearch(false,')
->not->toContain('data-md-search-results')
// Split so the string never reads as a literal class="..." attribute to the design guard's
// own scan of this file — Tailwind's `relative` utility, which the field used to carry.
// own scan of this file — `relative`, the utility class the field used to carry.
->not->toContain('class="'.'relative"');
// The state belongs to the combobox, never to the bare textbox ARIA gives it to.