Fix iframe styling to be theme dependent

This commit is contained in:
iliajie
2023-06-17 19:23:39 +03:00
parent 8bd7c32c10
commit 3f1306e9cf
2 changed files with 19 additions and 12 deletions

View File

@@ -0,0 +1,13 @@
body:not([style]) {
font: 14px/1.231 arial, helvetica, clean, sans-serif;
}
p:not([style]) {
margin: 0;
}
blockquote:not([style]) {
margin: 0px 0px 0px 0.8ex;
border-left: 1px solid #ccc;
padding-left: 1ex;
}

View File

@@ -2847,18 +2847,12 @@ sub iframe_body
my ($body) = @_;
# Mail iframe inner styles
my $iframe_styles =
'<style>
html,body { overflow-y: hidden; }
p {
margin: 0;
}
blockquote:not([style]) {
margin: 0px 0px 0px 0.8ex;
border-left: 1px solid #ccc;
padding-left: 1ex;
}
</style>';
my $iframe_styles = <<EOF;
<style>
html, body { overflow-y: hidden; }
@{[&read_file_contents("$root_directory/$current_theme/unauthenticated/iframe-styles.css")]}
</style>
EOF
# Add inner styles to the email body
if ($body =~ /<\/body>/) {
$body =~ s/<\/body>/$iframe_styles<\/body>/;