Skip to content

Insert Snippet: support inserting contents of a CSS file as style block #238

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

Closed
RealRaven2000 opened this issue Apr 26, 2023 · 2 comments
Closed
Assignees

Comments

@RealRaven2000
Copy link
Owner

When inserting a smart snippet into the email, it would be great if we could insert a css file within a style block - not just a HTML file / fragment. This would make it easier to inject styles into a written email "after the fact".

Once a style sheet is loaded the code should be injected into a new

<style> .. </style>

block. This is the same way as the %style()% command works when it is called from within a html template.

@RealRaven2000 RealRaven2000 self-assigned this Apr 26, 2023
@RealRaven2000
Copy link
Owner Author

RealRaven2000 commented Apr 28, 2023

Test version below. This will insert the <style> block as expected plus a comment above that lists the name of the CSS file (without path)

smartTemplate-fx-3.17pre33.zip

to install this version, download the zip file and drag it into Thunderbird Add-ons Manager (don't extract contents to install).

You can then insert a CSS block via fragments and selecting "style sheets" from the file selection dialog.

image

it's not 100% perfect yet, Thunderbird seems to mess up a little when this is inserted into an empty paragraph, but it definitely inserts the style block. As example that "does something" here is a css file to insert as Fragment (css file inside archive as Github doesn't support css attachments):

smartbox.zip

Code inserted:

<!-- smartbox.css -->
          <style>
            #smartTemplate4-template {
  margin-left: 1em; 
  max-width: 1100px; 
  padding: 0.2em 1em; 
  border: 1px solid rgba(120,120,120,0.5); 
  border-radius: 0.5em;
  box-shadow: 5px 5px 5px rgba(80,80,80,0.2);
}
</style>

@RealRaven2000
Copy link
Owner Author

Implemented in v3.17 released 04/May/2023

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

No branches or pull requests

1 participant