Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slim down mailer payloads by including less CSS #969

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

jagthedrummer
Copy link
Contributor

@jagthedrummer jagthedrummer commented Nov 22, 2024

Including both application.css and application.mailer.light.css is redundant, and application.css includes a lot of things that aren't needed in mailers.

If your mailers are depending on something in application.css you can bring it back by first ejecting the _mailer.html.erb partial into your application:

./bin/resolve bullet_train-themes-light/app/views/themes/light/layouts/_mailer.html.erb --eject

Then look for this line:

<%= stylesheet_link_tag 'application.mailer.light', media: 'all' %>

And add a link to the application stylesheet above it like this:

<%= stylesheet_link_tag 'application', media: 'all' %>
<%= stylesheet_link_tag 'application.mailer.light', media: 'all' %>

Fixes #293

Including both `application.css` and `application.mailer.light.css` is
redundant, and `application.css` includes a lot of things that aren't
needed in mailers.

Fixes #293
@jagthedrummer jagthedrummer merged commit f11b04f into main Nov 25, 2024
28 checks passed
@jagthedrummer jagthedrummer deleted the jeremy/slimmer-mailer-payloads branch November 25, 2024 18:39
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.

Including fontawesome pro results in huge mailer payloads
1 participant