Fold layout.css and components.css into all.css

Plan step 37: all.css replaces the two interim import lists with one
entry for an application that wants everything — the foundation, every
layout stylesheet and every component stylesheet, grouped under the
same block comments components.css used, plus a Layout block. It also
directly imports the three files nothing imported by name before
(layout/spacing.css, layout/visibility.css, components/selection.css),
so every file under components/ and layout/ is now one @import away.

Every test that read a block of components.css or layout.css now reads
the matching block of all.css through one shared helper (allCssBlock(),
in tests/Pest.php so it loads for any test run) instead of repeating
the same substr() search in each file. StylesheetsTest.php's shape,
Tailwind-free and breakpoint checks, previously run twice (once for
the foundation, once for the layout tree), now run once over the whole
tree all.css reaches, since every component and layout stylesheet is
plain CSS after step 36; a new test asserts all.css imports everything
under components/ and layout/ exactly once. The Workbench imports
all.css in place of layout.css and components.css.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
Andreas Reinhold / reini
2026-09-15 02:49:29 +02:00
co-authored by Claude Sonnet 5
parent 04271bf227
commit 925d9a4439
28 changed files with 230 additions and 191 deletions
@@ -10,13 +10,13 @@ use NoNameWeb\LivewireMaterial\Tests\Support\ViewClasses;
* classes (tests/Support/ViewClasses.php), and each has a stylesheet in
* `material.components` that imports the stylesheets of the components its view renders, writes
* its values from the tokens and its breakpoints as px range queries, and is imported from the
* "Actions and communication" block of components.css.
* "Actions and communication" block of all.css.
*
* `icon` and `shape` are the two foundation components (`<x-icon>`, `<x-shape>`) — no group's view
* renders them exclusively, so they were in no group's dataset at all. They follow the same shape,
* token and view-class rules as every other component, so they run with this group's checks too;
* only "is imported from the actions and communication block" needs to read the two of them from
* components.css's first block ("Foundation components") instead, since that is where they sit.
* all.css's first block ("Foundation components") instead, since that is where they sit.
*/
dataset('action components', [
'icon',
@@ -95,16 +95,8 @@ it('takes its values from the tokens and its breakpoints in px', function (strin
}
})->with('action components');
it('is imported from the actions and communication block of components.css, or icon and shape from the foundation block before it', function (string $name) {
$components = File::get(__DIR__.'/../../../resources/css/components.css');
if (in_array($name, ['icon', 'shape'], true)) {
$block = substr($components, (int) strpos($components, '/* Foundation components */'));
$block = substr($block, 0, (int) strpos($block, '/* Actions and communication */'));
} else {
$block = substr($components, (int) strpos($components, '/* Actions and communication */'));
$block = substr($block, 0, (int) strpos($block, '/* Inputs, selection and data */'));
}
it('is imported from the actions and communication block of all.css, or icon and shape from the foundation block before it', function (string $name) {
$block = allCssBlock(in_array($name, ['icon', 'shape'], true) ? 'Foundation components' : 'Actions and communication');
expect($block)->toContain("@import './components/{$name}.css';");
})->with('action components');