eschmar/css-inliner-bundle
A Symfony Twig extension that inlines CSS into HTML emails using CssToInlineStyles. Wrap content in the cssinline tag and it converts style blocks into inline styles, then strips the originals—ideal for email templates.
{% cssinline %}) and a bundle class registered in AppKernel. There is no Laravel service provider, no Blade directive, no config publishing. Any Laravel decision here is really a decision about the underlying library (tijsverkoyen/CssToInlineStyles), not this repo.<style> blocks. Inlining CSS onto elements is table stakes for consistent email rendering. This bundle is a thin convenience layer for that step inside Twig templates.CssToInlineStyles (independent maintenance, real usage), not on this wrapper (6 stars, 0 dependents, last release March 2020).@font-face, pseudo-selectors, or client-specific hacks — those still require a <style> block for clients that honour it, plus a fallback strategy. Do not let stakeholders read "CSS inliner" as "email design system."Consider it when:
Look elsewhere when:
CssToInlineStyles directly in a Mailable/Blade post-processing step, or a Laravel-native alternative.<style> block) or use a purpose-built email framework.<style> → style="". No asset handling, no CSS preprocessor, no per-client targeting.To executives (one paragraph): Styled transactional email is a customer-facing capability, and the technical blocker is that major inbox providers strip stylesheets. This package is a small, unmaintained Symfony-only helper that solves that one step — it is not a platform investment and not a strategic dependency. Recommendation: capture the capability on the roadmap, but do not adopt this repo as a dependency. Adopt the underlying inlining library directly (or vendor the ~30-line Twig tag under MIT), which removes the maintenance risk while keeping the delivery date.
To engineering (the ask): This is a convenience wrapper around CssToInlineStyles with one Twig tag and a bundle registration. It is straightforward, readable, and MIT-licensed — but it is a 2020 artifact scoped to Symfony 4/5. Two viable paths: (a) if we are on Symfony, vendor or fork the tag so we own the two files; (b) if we are on Laravel, skip the repo entirely and call the underlying library from our mail pipeline. Either way, confirm current PHP/Symfony compatibility and add an email-rendering regression test in Litmus or Email on Acid before we ship anything customer-facing.
Bottom line: the capability is worth having; this repository is not worth depending on.
How can I help you explore Laravel packages today?