stages/email: minify email css template

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-11-22 23:30:51 +01:00
parent fb18a10e61
commit d3397c349f
3 changed files with 15 additions and 96 deletions

View File

@ -1,81 +1,56 @@
/* ------------------------------------- /* authentik Email CSS */
GLOBAL
A very basic CSS reset
------------------------------------- */
* { * {
margin: 0; margin: 0;
font-family: Helvetica, Arial, sans-serif; font-family: Helvetica, Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
} }
img { img {
max-width: 100%; max-width: 100%;
} }
body { body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: none; -webkit-text-size-adjust: none;
width: 100% !important; width: 100% !important;
height: 100%; height: 100%;
line-height: 1.6em; line-height: 1.6em;
/* 1.6em * 14px = 22.4px, use px to get airier line-height also in Thunderbird, and Yahoo!, Outlook.com, AOL webmail clients */
/*line-height: 22px;*/
} }
/* Let's make sure all tables have defaults */
table td { table td {
vertical-align: top; vertical-align: top;
} }
/* -------------------------------------
BODY & CONTAINER
------------------------------------- */
body { body {
background-color: #f6f6f6; background-color: #f6f6f6;
} }
.body-wrap { .body-wrap {
background-color: #f6f6f6; background-color: #f6f6f6;
width: 100%; width: 100%;
} }
.container { .container {
display: block !important; display: block !important;
max-width: 600px !important; max-width: 600px !important;
margin: 0 auto !important; margin: 0 auto !important;
/* makes it centered */
clear: both !important; clear: both !important;
} }
.content { .content {
max-width: 600px; max-width: 600px;
margin: 0 auto; margin: 0 auto;
display: block; display: block;
padding: 20px; padding: 20px;
} }
/* -------------------------------------
HEADER, FOOTER, MAIN
------------------------------------- */
.main { .main {
background-color: #fff; background-color: #fff;
border: 1px solid #e9e9e9; border: 1px solid #e9e9e9;
} }
.content-wrap { .content-wrap {
padding: 20px; padding: 20px;
} }
.content-block { .content-block {
padding: 0 0 20px; padding: 0 0 20px;
} }
.header { .header {
width: 100%; width: 100%;
margin-bottom: 20px; margin-bottom: 20px;
} }
.footer { .footer {
width: 100%; width: 100%;
clear: both; clear: both;
@ -86,10 +61,6 @@ body {
color: #999; color: #999;
font-size: 12px; font-size: 12px;
} }
/* -------------------------------------
TYPOGRAPHY
------------------------------------- */
h1, h2, h3 { h1, h2, h3 {
font-family: Helvetica, Arial, sans-serif; font-family: Helvetica, Arial, sans-serif;
color: #000; color: #000;
@ -97,31 +68,20 @@ h1, h2, h3 {
line-height: 1.2em; line-height: 1.2em;
font-weight: 400; font-weight: 400;
} }
h1 { h1 {
font-size: 32px; font-size: 32px;
font-weight: 500; font-weight: 500;
/* 1.2em * 32px = 38.4px, use px to get airier line-height also in Thunderbird, and Yahoo!, Outlook.com, AOL webmail clients */
/*line-height: 38px;*/
} }
h2 { h2 {
font-size: 24px; font-size: 24px;
/* 1.2em * 24px = 28.8px, use px to get airier line-height also in Thunderbird, and Yahoo!, Outlook.com, AOL webmail clients */
/*line-height: 29px;*/
} }
h3 { h3 {
font-size: 18px; font-size: 18px;
/* 1.2em * 18px = 21.6px, use px to get airier line-height also in Thunderbird, and Yahoo!, Outlook.com, AOL webmail clients */
/*line-height: 22px;*/
} }
h4 { h4 {
font-size: 14px; font-size: 14px;
font-weight: 600; font-weight: 600;
} }
p, ul, ol { p, ul, ol {
margin-bottom: 10px; margin-bottom: 10px;
font-weight: normal; font-weight: normal;
@ -130,15 +90,10 @@ p li, ul li, ol li {
margin-left: 5px; margin-left: 5px;
list-style-position: inside; list-style-position: inside;
} }
/* -------------------------------------
LINKS & BUTTONS
------------------------------------- */
a { a {
color: #348eda; color: #348eda;
text-decoration: underline; text-decoration: underline;
} }
.btn-primary { .btn-primary {
text-decoration: none; text-decoration: none;
color: #FFF; color: #FFF;
@ -146,50 +101,33 @@ a {
border: solid #348eda; border: solid #348eda;
border-width: 10px 20px; border-width: 10px 20px;
line-height: 2em; line-height: 2em;
/* 2em * 14px = 28px, use px to get airier line-height also in Thunderbird, and Yahoo!, Outlook.com, AOL webmail clients */
/*line-height: 28px;*/
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
display: inline-block; display: inline-block;
text-transform: capitalize; text-transform: capitalize;
} }
.btn-primary a { .btn-primary a {
color: #fff; color: #fff;
} }
/* -------------------------------------
OTHER STYLES THAT MIGHT BE USEFUL
------------------------------------- */
.last { .last {
margin-bottom: 0; margin-bottom: 0;
} }
.first { .first {
margin-top: 0; margin-top: 0;
} }
.align-center {
.aligncenter {
text-align: center; text-align: center;
} }
.align-right {
.alignright {
text-align: right; text-align: right;
} }
.align-left {
.alignleft {
text-align: left; text-align: left;
} }
.clear { .clear {
clear: both; clear: both;
} }
/* -------------------------------------
ALERTS
Change the class depending on warning email, good email or bad email
------------------------------------- */
.alert { .alert {
font-size: 16px; font-size: 16px;
color: #fff; color: #fff;
@ -215,72 +153,53 @@ a {
.alert-success { .alert-success {
background-color: #3E8635; background-color: #3E8635;
} }
.body {
/* -------------------------------------
INVOICE
Styles for the billing table
------------------------------------- */
.invoice {
margin: 40px auto; margin: 40px auto;
text-align: left; text-align: left;
width: 80%; width: 80%;
} }
.invoice td { .body td {
padding: 5px 0; padding: 5px 0;
} }
.invoice .invoice-items { .body .body-items {
width: 100%; width: 100%;
} }
.invoice .invoice-items td { .body .body-items td {
border-top: #eee 1px solid; border-top: #eee 1px solid;
} }
.invoice .invoice-items .total td { .body .body-items .total td {
border-top: 2px solid #333; border-top: 2px solid #333;
border-bottom: 2px solid #333; border-bottom: 2px solid #333;
font-weight: 700; font-weight: 700;
} }
/* -------------------------------------
RESPONSIVE AND MOBILE FRIENDLY STYLES
------------------------------------- */
@media only screen and (max-width: 640px) { @media only screen and (max-width: 640px) {
body { body {
padding: 0 !important; padding: 0 !important;
} }
h1, h2, h3, h4 { h1, h2, h3, h4 {
font-weight: 800 !important; font-weight: 800 !important;
margin: 20px 0 5px !important; margin: 20px 0 5px !important;
} }
h1 { h1 {
font-size: 22px !important; font-size: 22px !important;
} }
h2 { h2 {
font-size: 18px !important; font-size: 18px !important;
} }
h3 { h3 {
font-size: 16px !important; font-size: 16px !important;
} }
.container { .container {
padding: 0 !important; padding: 0 !important;
width: 100% !important; width: 100% !important;
} }
.content { .content {
padding: 0 !important; padding: 0 !important;
} }
.content-wrap { .content-wrap {
padding: 10px !important; padding: 10px !important;
} }
.body {
.invoice {
width: 100% !important; width: 100% !important;
} }
} }
/*# sourceMappingURL=styles.css.map */

View File

@ -21,7 +21,7 @@
<div class="footer"> <div class="footer">
<table width="100%"> <table width="100%">
<tr> <tr>
<td class="aligncenter content-block">Powered by <a href="https://goauthentik.io?utm_source=authentik&utm_medium=email">authentik</a>.</td> <td class="align-center content-block">Powered by <a href="https://goauthentik.io?utm_source=authentik&utm_medium=email">authentik</a>.</td>
</tr> </tr>
</table> </table>
</div> </div>

View File

@ -18,18 +18,18 @@
</tr> </tr>
{% if key_value %} {% if key_value %}
<tr> <tr>
<td class="content-block aligncenter"> <td class="content-block align-center">
<table class="invoice"> <table class="body">
<tr> <tr>
<td>{% trans "Additional Information" %}</td> <td>{% trans "Additional Information" %}</td>
</tr> </tr>
<tr> <tr>
<td> <td>
<table class="invoice-items" cellpadding="0" cellspacing="0"> <table class="body-items" cellpadding="0" cellspacing="0">
{% for key, value in key_value.items %} {% for key, value in key_value.items %}
<tr> <tr>
<td>{{ key }}</td> <td>{{ key }}</td>
<td class="alignright">{{ value }}</td> <td class="align-right">{{ value }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>