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:
co-authored by
Claude Sonnet 5
parent
04271bf227
commit
925d9a4439
@@ -10,7 +10,7 @@ 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
|
||||
* "Inputs, selection and data" block of components.css.
|
||||
* "Inputs, selection and data" block of all.css.
|
||||
*
|
||||
* `pagination` is not in this dataset: its four views live in `resources/views/pagination/**`, not
|
||||
* `resources/views/components/`, so the two checks that read a single `resources/views/components/
|
||||
@@ -47,10 +47,9 @@ dataset('input components', inputComponents());
|
||||
/**
|
||||
* The checks that read a stylesheet alone also run on the one no view renders by itself:
|
||||
* selection.css, what the checkbox, radio and switch share (its own file header names them), which
|
||||
* each of their stylesheets imports. Nothing renders it directly and components.css never imports
|
||||
* it either — only checkbox.css, radio.css and toggle.css do — so without this its shape and token
|
||||
* rules would go unchecked, the way navigation-item.css did before NavigationStylesheetsTest.php
|
||||
* picked it up.
|
||||
* each of their stylesheets imports too. Nothing renders it directly, so without this its shape
|
||||
* and token rules would go unchecked, the way navigation-item.css did before
|
||||
* NavigationStylesheetsTest.php picked it up.
|
||||
*/
|
||||
dataset('input stylesheets', [...inputComponents(), 'selection']);
|
||||
|
||||
@@ -155,12 +154,8 @@ it('takes its values from the tokens and its breakpoints in px', function (strin
|
||||
assertTokensAndPxBreakpoints(ComponentStylesheet::read($name), "{$name}.css");
|
||||
})->with('input stylesheets');
|
||||
|
||||
it('is imported from the inputs, selection and data block of components.css', function (string $name) {
|
||||
$components = File::get(__DIR__.'/../../../resources/css/components.css');
|
||||
$block = substr($components, (int) strpos($components, '/* Inputs, selection and data */'));
|
||||
$block = substr($block, 0, (int) strpos($block, '/* Containment */'));
|
||||
|
||||
expect($block)->toContain("@import './components/{$name}.css';");
|
||||
it('is imported from the inputs, selection and data block of all.css', function (string $name) {
|
||||
expect(allCssBlock('Inputs, selection and data'))->toContain("@import './components/{$name}.css';");
|
||||
})->with('input components');
|
||||
|
||||
// ---- pagination: its views live outside resources/views/components/ --------------------------
|
||||
@@ -183,12 +178,8 @@ it('takes pagination\'s values from the tokens and its breakpoints in px', funct
|
||||
assertTokensAndPxBreakpoints(ComponentStylesheet::read('pagination'), 'pagination.css');
|
||||
});
|
||||
|
||||
it('is imported from the inputs, selection and data block of components.css for pagination', function () {
|
||||
$components = File::get(__DIR__.'/../../../resources/css/components.css');
|
||||
$block = substr($components, (int) strpos($components, '/* Inputs, selection and data */'));
|
||||
$block = substr($block, 0, (int) strpos($block, '/* Containment */'));
|
||||
|
||||
expect($block)->toContain("@import './components/pagination.css';");
|
||||
it('is imported from the inputs, selection and data block of all.css for pagination', function () {
|
||||
expect(allCssBlock('Inputs, selection and data'))->toContain("@import './components/pagination.css';");
|
||||
});
|
||||
|
||||
dataset('pagination views', [
|
||||
|
||||
Reference in New Issue
Block a user