Hold the mail theme to the standard contrast level

A mail client resolves no attribute, so the JSON's top level — the standard roles —
is what it wears, whatever levels the file carries beside them.
Plan: docs/plans/material-3-alignment.md, step 7 (core C2).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
Andreas Reinhold / reini
2026-09-14 05:40:35 +02:00
co-authored by Claude Fable 5.1
parent 7a17e58ee6
commit 6aa8a48084
+17
View File
@@ -86,6 +86,23 @@ function withPackageMailComponents(): void
app()->forgetInstance(Markdown::class);
}
it('stays on the standard contrast level, which is the one a mail client can show', function () {
File::put($this->temporary.'/material-scheme.json', json_encode([
'light' => ['primary' => '#123456', 'on-primary' => '#fefefe', 'surface-container' => '#eeeeee', 'surface-container-lowest' => '#fdfdfd'],
'dark' => ['primary' => '#abcdef'],
'contrast' => [
'standard' => 0,
'high' => ['light' => ['primary' => '#000000', 'on-primary' => '#ffffff'], 'dark' => ['primary' => '#ffffff']],
],
]));
config(['livewire-material.scheme' => $this->temporary.'/material-scheme.json']);
expect(inlineStyle((new ThemedProbeMail)->render(), 'button-primary'))
->toContain('background-color: #123456')
->not->toContain('background-color: #000000');
});
it('inlines the application\'s scheme onto the mail', function () {
File::put($this->temporary.'/material-scheme.json', json_encode([
'light' => ['primary' => '#123456', 'on-primary' => '#fefefe', 'surface-container' => '#eeeeee', 'surface-container-lowest' => '#fdfdfd'],