@php $groups = [ 'Primary' => ['primary', 'on-primary', 'primary-container', 'on-primary-container', 'inverse-primary', 'primary-fixed', 'primary-fixed-dim', 'on-primary-fixed', 'on-primary-fixed-variant'], 'Secondary' => ['secondary', 'on-secondary', 'secondary-container', 'on-secondary-container', 'secondary-fixed', 'secondary-fixed-dim', 'on-secondary-fixed', 'on-secondary-fixed-variant'], 'Tertiary' => ['tertiary', 'on-tertiary', 'tertiary-container', 'on-tertiary-container', 'tertiary-fixed', 'tertiary-fixed-dim', 'on-tertiary-fixed', 'on-tertiary-fixed-variant'], 'Error' => ['error', 'on-error', 'error-container', 'on-error-container', 'inverse-error'], 'Success' => ['success', 'on-success', 'success-container', 'on-success-container', 'inverse-success'], 'Warning' => ['warning', 'on-warning', 'warning-container', 'on-warning-container', 'inverse-warning'], 'Info' => ['info', 'on-info', 'info-container', 'on-info-container', 'inverse-info'], 'Surface' => ['surface', 'surface-dim', 'surface-bright', 'surface-container-lowest', 'surface-container-low', 'surface-container', 'surface-container-high', 'surface-container-highest', 'on-surface', 'on-surface-variant', 'inverse-surface', 'inverse-on-surface', 'outline', 'outline-variant'], ]; // The roles a contrast level moves most: the page keeps its surface, the ink and the // outlines carry the level. $levels = ['standard' => 'Standard', 'medium' => 'Medium · 3:1', 'high' => 'High · 7:1']; $levelRoles = ['primary', 'on-primary', 'primary-container', 'on-primary-container', 'on-surface-variant', 'outline', 'error', 'success', 'warning', 'info']; $profile = \NoNameWeb\LivewireMaterial\Support\Scheme::profile(); $examples = [ 'Colour profiles' => <<<'BLADE'
BLADE, 'Contrast level' => <<<'BLADE' BLADE, ]; @endphp

Colour

Every role as a --md-sys-color-* token, generated by php artisan material:scheme. Both themes side by side, whatever the page is showing.

When to use which: primary is the one key action on a screen; secondary-container is the quiet fill (tonal buttons, selected navigation and chips); tertiary is a rare accent; error, success, warning and info mean state — the -container for a tinted panel, the role itself for its text and icon. Pair a role only with its on- partner. Ink is on-surface, lower emphasis on-surface-variant, decoration outline; never an opacity, because 38% means disabled. Every role changes with the contrast level below, which is why only roles are allowed.

With colour profiles in livewire-material.profiles, the command generates each one under <html data-scheme>, and <x-scheme-picker> chooses between them. Without profiles the picker draws nothing.

Every scheme is generated at M3's three contrast levels — standard, medium (3:1) and high (7:1) — and the head script writes the visitor's to <html data-contrast>, following the operating system until they choose. The page keeps its surface; the ink, the outlines and the containers carry the level.

@foreach ($examples as $title => $code) @endforeach @foreach ($levels as $level => $title) {{-- data-scheme beside data-contrast: a profile's level blocks key on both attributes together, as they do on . --}}

{{ $title }}

@foreach (['light', 'dark'] as $theme)

{{ ucfirst($theme) }}

@foreach ($levelRoles as $role) {{ $role }} @endforeach
@endforeach
@endforeach
@foreach (['light', 'dark'] as $theme)

{{ ucfirst($theme) }}

@foreach ($groups as $group => $roles)

{{ $group }}

@foreach ($roles as $role) {{ $role }} @endforeach
@endforeach
@endforeach