Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Cssinliner Extra

Cssinliner Extra Laravel Package

twig/cssinliner-extra

Twig extension adding the inline_css filter to inline CSS styles into HTML documents. Useful for rendering emails and templates with CSS applied directly to elements, improving compatibility with clients that strip or ignore external styles.

View on GitHub
Deep Wiki
Context7

A Twig extension to allow inlining CSS

Frequently asked questions about Cssinliner Extra
How do I install twig/cssinliner-extra in a Laravel project using Twig?
Run `composer require twig/cssinliner-extra` and ensure your Laravel Twig bridge is configured. The package extends Twig’s native capabilities, so no additional Laravel-specific setup is required beyond enabling Twig in your project.
Can I use this package with Laravel Blade templates?
No, this package is Twig-only. If your project relies on Blade for emails, you’ll need to either switch to Twig for email templates or explore alternatives like manual CSS inlining or dedicated email templating tools.
What Laravel versions does twig/cssinliner-extra support?
The package works with any Laravel version that supports Twig via the `laravelcollective/html` or `tightenco/ziggy` bridges. However, ensure your Twig version aligns with the package’s requirements, as it’s not actively maintained.
Does the inline_css filter handle media queries or complex CSS selectors?
No, the package silently drops unsupported selectors like `@media`, `:hover`, or combinators. For advanced email designs, you’ll need to simplify CSS or manually inline styles where complex rules are required.
Is there a way to pre-process CSS inlining for better performance?
Yes, the package supports build-time processing via Artisan commands (e.g., `php artisan email:inline-css`). This reduces runtime overhead, making it ideal for high-volume email campaigns when combined with Laravel queues or caching.
What are the security risks of using remote: true for external CSS?
Enabling `remote: true` introduces XSS vulnerabilities if external CSS sources aren’t trusted. Disable this option unless you’ve implemented strict input validation or use a controlled CDN for static assets.
How does this package compare to Laravel’s built-in CSS inlining tools?
Unlike Laravel’s Blade, this package is Twig-specific and offers deeper integration with Twig’s filter system. It’s better suited for projects already using Twig, while Blade lacks native CSS inlining support for emails.
Will this package break if I update Twig or Laravel?
Potentially, as the package is abandoned and lacks recent updates. Test thoroughly after major version changes, and consider forking or replacing it if compatibility issues arise.
Can I use this for dynamic email templates in Laravel Notifications?
Yes, but you’ll need to ensure your notification templates use Twig. Process the HTML output with the `inline_css` filter before sending, either manually or via a custom Artisan command.
Are there alternatives for Laravel email CSS inlining?
For Blade users, consider manual inlining or tools like `php-html-mail` or `league/html-to-markdown`. Twig users might explore `twig/extra` or fork this package for maintenance. Always weigh trade-offs like compatibility and performance.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor
spatie/laravel-javascript-views