An over-engineering audit of the whole tree, applied in five reviewed batches. Behaviour stays the same except where UPGRADE.md says otherwise. PHP: the showcase and error-page stylesheets are prebuilt into resources/dist by bin/stylesheets.mjs, through Vite's own postcss-import (first occurrence kept, the order an application's build gives), instead of Stylesheets::bundle() inlining imports on every request; only the import walk DesignGuard needs stays. SchemeStylesheet::withProfiles() replaces three copies of the scheme-plus-profiles loop, material:scheme leaves spec and contrast checks to the node script that already made them, and the error page's scheme cache, the hashed view namespace, the translations path with no lang/ folder and DesignGuard's 1.x-name hints are gone. JS: the androidx shape port progress.js and both bin scripts each carried lives once in resources/js/shapes.js (the generated SVGs are unchanged); util.js holds ringIndex(), ms(), reopenGuard() and remember(), which were written out several times; listeners are released through AbortController; tooltip.js's hoverPopover() serves the rich tooltip too. CSS: every rule for an element inside the navigation rail queries `--md-navigation-rail-value` instead of repeating the seven collapsed conditions under five media branches; badge, alert, progress, slider and button read one non-inheriting colour-role table (components/color.css); the dialog chrome, the submenu's popover chrome, the chip's state layer and touch target, and the visually-hidden inputs use the shared rules they copied; foundation/tokens.css is folded into foundation.css. Views: Support\Field and Support\Link replace the error-key, bound-value and link-attribute blocks copied into the fields and link components; the timepicker period group, the menu filter and the showcase head are partials; the datepicker's steppers and entry fields are loops; component docblocks no longer restate SKILL.md. Tests and tooling: one dataset-driven ComponentStylesheetsTest replaces four per-group files, DesignGuardTest and the layout-component tests use datasets, browser tests share one ready() helper, CSS parsing lives in ComponentStylesheet alone. docs/audits and the finding IDs citing it are removed, as are pestphp/pest-plugin-laravel, the unused composer scripts and check:font; the lint job runs in the feature job, which now installs node packages so the prebuilt-stylesheet staleness test runs in CI. Feature suite 1177 passed, Chrome browser suite 299 passed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
148 lines
5.6 KiB
CSS
148 lines
5.6 KiB
CSS
/*
|
|
* `errors::minimal`: the layout the package's 403/404/419/429/500/503 pages and the framework's
|
|
* own 401/402 (which extend this layout, `src/Support/ErrorPage.php`'s docblock) render through.
|
|
* A page's own `@section`s fill `title`, `code`, `headline`, `message`, `shape` and `actions`
|
|
* (`resources/views/error-pages/errors/minimal.blade.php`'s header) — none of that is this file's
|
|
* concern, only the geometry and colour of the parts that show them:
|
|
*
|
|
* body:has(> [data-md-error-page])
|
|
* [data-md-error-page]
|
|
* [data-md-error-art]
|
|
* [data-md-error-shape] an <x-shape>, turning once a minute unless reduced motion asks
|
|
* otherwise (its `svg` fills the art box and is coloured here,
|
|
* since <x-shape size> only takes a fixed px, not "fill parent")
|
|
* [data-md-error-code] the status, in display type over the shape
|
|
* [data-md-error-headline] what happened
|
|
* [data-md-error-message] one sentence on what to do, only when `headline` is its own
|
|
* section (otherwise `message` doubles as the headline)
|
|
* [data-md-error-actions]
|
|
*
|
|
* The page carries this file itself: `src/Support/ErrorPage.php` inlines it, with its imports, into
|
|
* every error page (`Stylesheets::bundle()`) — beside the application's Vite tags when there is a
|
|
* build (`layoutStyles()`), inside the whole fallback stylesheet when there is none
|
|
* (`fallbackStyles()`, plan step 40) — so an application imports nothing for its error pages
|
|
* (plan step 46). The body is still matched only when it holds the layout
|
|
* (`body:has(> [data-md-error-page])`): an application that imports `all.css` has this file in
|
|
* its bundle beside every other page, where a bare `body` rule would restyle them all.
|
|
*
|
|
* The page's font is the foundation's, `--md-ref-typeface-brand` on `html` (foundation/base.css),
|
|
* as the old `font-sans` was; only the fallback, which has no `@font-face`, uses a system stack.
|
|
*
|
|
* Colours from the roles (`docs/reference/m3/styles.md` § Typography, "Accessibility
|
|
* requirements": surface/on-surface); the display code over its primary-container shape is a
|
|
* correct on-primary-container/primary-container contrast pairing; 24px page gutters and the
|
|
* 600px growth of the art and headline follow the same spacing rules as every other M3 surface in
|
|
* the library. `--md-sys-typescale-emphasized-display-lg` is the code's weight and roundedness;
|
|
* the shape's 60s linear turn has no motion token (`--md-sys-motion-*` pairs a duration with a
|
|
* spring for a state change, not an ambient loop) and stays a literal, gated behind
|
|
* `prefers-reduced-motion: no-preference` like every other ambient animation in the library.
|
|
*/
|
|
|
|
@layer material.reset, material.tokens, material.base, material.layout, material.components, material.text, material.visibility;
|
|
|
|
@import './button.css';
|
|
@import './shape.css';
|
|
|
|
@layer material.components {
|
|
body:has(> [data-md-error-page]) {
|
|
margin: 0;
|
|
min-height: 100dvh;
|
|
background-color: var(--md-sys-color-surface);
|
|
color: var(--md-sys-color-on-surface);
|
|
}
|
|
|
|
[data-md-error-page] {
|
|
display: flex;
|
|
min-height: 100dvh;
|
|
max-width: 576px;
|
|
margin-inline: auto;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding-inline: var(--md-sys-measurement-space300);
|
|
padding-block: var(--md-sys-measurement-space600);
|
|
text-align: center;
|
|
}
|
|
|
|
[data-md-error-art] {
|
|
position: relative;
|
|
display: grid;
|
|
flex-shrink: 0;
|
|
place-items: center;
|
|
width: 192px;
|
|
height: 192px;
|
|
}
|
|
|
|
@media (width >= 600px) {
|
|
[data-md-error-art] {
|
|
width: 240px;
|
|
height: 240px;
|
|
}
|
|
}
|
|
|
|
[data-md-error-shape] {
|
|
position: absolute;
|
|
inset: 0;
|
|
}
|
|
|
|
[data-md-error-shape] svg {
|
|
width: 100%;
|
|
height: 100%;
|
|
color: var(--md-sys-color-primary-container);
|
|
}
|
|
|
|
@media (prefers-reduced-motion: no-preference) {
|
|
[data-md-error-shape] {
|
|
animation: material-error-turn 60s linear infinite;
|
|
}
|
|
}
|
|
|
|
@keyframes material-error-turn {
|
|
to {
|
|
transform: rotate(1turn);
|
|
}
|
|
}
|
|
|
|
[data-md-error-code] {
|
|
position: relative;
|
|
margin: 0;
|
|
color: var(--md-sys-color-on-primary-container);
|
|
font: var(--md-sys-typescale-emphasized-display-lg);
|
|
letter-spacing: var(--md-sys-typescale-emphasized-display-lg-tracking);
|
|
font-variation-settings: 'ROND' 100;
|
|
font-variant-numeric: tabular-nums;
|
|
}
|
|
|
|
[data-md-error-headline] {
|
|
margin: var(--md-sys-measurement-space500) 0 0;
|
|
font: var(--md-sys-typescale-headline-md);
|
|
letter-spacing: var(--md-sys-typescale-headline-md-tracking);
|
|
text-wrap: balance;
|
|
}
|
|
|
|
@media (width >= 600px) {
|
|
[data-md-error-headline] {
|
|
font: var(--md-sys-typescale-headline-lg);
|
|
letter-spacing: var(--md-sys-typescale-headline-lg-tracking);
|
|
}
|
|
}
|
|
|
|
[data-md-error-message] {
|
|
margin: 12px 0 0;
|
|
max-width: 448px;
|
|
color: var(--md-sys-color-on-surface-variant);
|
|
font: var(--md-sys-typescale-body-lg);
|
|
letter-spacing: var(--md-sys-typescale-body-lg-tracking);
|
|
text-wrap: balance;
|
|
}
|
|
|
|
[data-md-error-actions] {
|
|
display: flex;
|
|
margin-top: var(--md-sys-measurement-space500);
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 12px;
|
|
}
|
|
}
|