Weave 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
Inlinestyle

Inlinestyle Laravel Package

inlinestyle/inlinestyle

A Laravel package for inlining CSS into HTML, helping email templates render consistently across clients. It converts stylesheets into style attributes with a simple API, so Mailables and Blade views keep their design without relying on external CSS support.

View on GitHub
Deep Wiki
Context7

Transform embedded and external stylesheets to style attributes on the HTML tags.

Frequently asked questions about Inlinestyle
What is inlinestyle/inlinestyle used for in Laravel?
It converts embedded and external stylesheets into inline style attributes on HTML tags. In Laravel it is typically used after Blade or Mailable rendering and before sending so email templates render more consistently across clients. It is a generic PHP utility rather than a Laravel-native package.
How do I install inlinestyle/inlinestyle with Composer?
Install it with composer require inlinestyle/inlinestyle and then use its API as documented in the README. Do not assume Laravel auto-discovery, a service provider, or a config file. Verify the PHP version constraint and ext-dom requirement in Composer before adopting it.
Does inlinestyle/inlinestyle include a Laravel service provider or config file?
Based on the technical assessment, expect no service provider, config file, or Laravel framework conventions. You will need to instantiate it manually or wrap it behind your own adapter. A small internal InlineCssProcessor interface helps avoid coupling application code directly to the package.
Which PHP versions and extensions does inlinestyle/inlinestyle require?
The provided context does not list exact supported PHP versions, so check the package composer.json and test against your Laravel runtime. Confirm ext-dom support because DOM parsing is central to CSS inlining. Also test UTF-8 handling and queue worker runtime if you process mail asynchronously.
Can I use inlinestyle/inlinestyle with Laravel Mailables and Blade views?
Yes, the intended fit is as a post-processing step: render the Blade view or Mailable HTML, inline the CSS, sanitize or normalize the output, then hand it to Laravel's mailer. Keep it out of domain logic and request-critical web paths. Run a proof of concept on one real email template before wider adoption.
Does it support media queries, pseudo-selectors, !important, and vendor prefixes?
The assessment flags risks around incomplete CSS selector support and incorrect handling of !important, media queries, pseudo-selectors, and vendor prefixes. Treat advanced CSS support as limited until proven against your actual templates. Test Outlook, Gmail, Apple Mail, and mobile clients, and keep a fallback renderer for unsupported cases.
Does inlinestyle/inlinestyle handle full HTML documents, fragments, HTML5, and UTF-8?
The context says to verify whether the package accepts full documents or fragments and whether it preserves HTML5, UTF-8, and malformed markup correctly. Do not assume behavior without testing your real email templates. Golden-file rendering tests are a practical way to catch encoding and DOM parsing regressions.
Is it safe to inline untrusted HTML or CSS with this package?
The package carries moderate technical risk if you process untrusted HTML or CSS, so assess injection and XXE hardening before exposing it to user content. Sanitize and normalize input and output, and avoid passing arbitrary user HTML without controls. Fail closed or fall back to a known renderer when validation fails.
Is inlinestyle/inlinestyle actively maintained and production ready?
Ecosystem signal is weak: the assessment cites about 140 stars, zero listed dependents, and a low opportunity score. That suggests limited validation and stale-maintenance risk, even though the feature scope is narrow. Pin the Composer version, monitor upstream activity, keep a fork or vendor option, and run a contained pilot.
What alternatives or fallback should I use if CSS inlining fails?
Wrap the package behind an internal adapter and add a fallback to a maintained CSS inliner, a hosted rendering service, or a vendored fork. Add golden-file tests and output validation so silent CSS omissions or malformed HTML do not reach production mail. Roll out template by template with canary comparison and document exit criteria.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections