Skip to content

Conversation

@MrPunyapal
Copy link
Contributor

@MrPunyapal MrPunyapal commented Dec 1, 2025

Quick note: we can't rely on default.css alone for dark-mode because the Markdown renderer sends the theme through CssToInlineStyles which inlines normal rules into style="" attributes — media queries like @media (prefers-color-scheme: dark) cannot be inlined and therefore must be present as stylesheet rules in the final <head> to work. For this PR I placed the @media block in layout.blade.php so it ends up in the email head and can override the inlined light-mode styles (using !important).
Alternative (preferred long-term): keep the single default.css as source-of-truth and modify Illuminate\Mail\Markdown to extract @media blocks and expose them (e.g. Markdown::getHead()), then emit that in the layout head — this preserves one CSS file while ensuring media queries reach the final HTML.
image
image
image

@github-actions
Copy link

github-actions bot commented Dec 1, 2025

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@MrPunyapal MrPunyapal force-pushed the feat/dark-mode-support-for-mail branch from 0483c89 to 331b242 Compare December 1, 2025 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant