feat(postcard): mail branding and the logo URL
- Brand, DefaultBrand and CompileBrandCSS: thirteen colours, each checked as a six-digit hex colour, compiled into CSS for plain elements and the built-in layouts and partials - once the branding row exists its compiled CSS replaces mail.brandCss; mail.css still follows, and the file version sent after a failing override keeps the Branding - layouts get logoUrl, built per send from storage.uploads.public_url or app.url through attach.AbsolutePublicURL; a logo that cannot be shown is left out with a rate-limited warning - Editor previews and validates a Branding draft (rule colour) Plan 35-01, task 5.
This commit is contained in:
201
modules/postcard/assets/brand.css.tmpl
Normal file
201
modules/postcard/assets/brand.css.tmpl
Normal file
@@ -0,0 +1,201 @@
|
||||
/* Base */
|
||||
body, body *:not(html):not(style):not(br):not(tr):not(code) {
|
||||
font-family: Avenir, Helvetica, sans-serif;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
background-color: {{ .BodyBg }};
|
||||
color: {{ .TextColor }};
|
||||
height: 100%;
|
||||
line-height: 1.4;
|
||||
margin: 0;
|
||||
width: 100% !important;
|
||||
word-break: break-word;
|
||||
-webkit-text-size-adjust: none;
|
||||
}
|
||||
p, ul, ol, blockquote {
|
||||
line-height: 1.4;
|
||||
text-align: left;
|
||||
}
|
||||
a {
|
||||
color: {{ .LinkColor }};
|
||||
}
|
||||
a img {
|
||||
border: none;
|
||||
}
|
||||
/* Typography */
|
||||
h1 {
|
||||
color: {{ .HeadingColor }};
|
||||
font-size: 19px;
|
||||
font-weight: bold;
|
||||
margin-top: 0;
|
||||
text-align: left;
|
||||
}
|
||||
h2 {
|
||||
color: {{ .HeadingColor }};
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin-top: 0;
|
||||
text-align: left;
|
||||
}
|
||||
h3 {
|
||||
color: {{ .HeadingColor }};
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
margin-top: 0;
|
||||
text-align: left;
|
||||
}
|
||||
p {
|
||||
color: {{ .TextColor }};
|
||||
font-size: 16px;
|
||||
line-height: 1.5em;
|
||||
margin-top: 0;
|
||||
text-align: left;
|
||||
}
|
||||
code {
|
||||
color: {{ .TextColor }};
|
||||
font-size: 16px;
|
||||
line-height: 1.5em;
|
||||
word-break: break-all;
|
||||
}
|
||||
p.sub {
|
||||
font-size: 12px;
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
.break-all, .break-all * {
|
||||
word-break: break-all;
|
||||
}
|
||||
/* Layout */
|
||||
.wrapper {
|
||||
background-color: {{ .BodyBg }};
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.content {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
}
|
||||
/* Header */
|
||||
.header {
|
||||
padding: 25px 0;
|
||||
text-align: center;
|
||||
}
|
||||
.header a, .header span {
|
||||
color: {{ .HeaderColor }};
|
||||
font-size: 19px;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
}
|
||||
/* Body */
|
||||
.body {
|
||||
background-color: {{ .ContentBg }};
|
||||
border-bottom: 1px solid {{ .TableBorderColor }};
|
||||
border-top: 1px solid {{ .TableBorderColor }};
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.inner-body {
|
||||
background-color: {{ .ContentBg }};
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
width: 570px;
|
||||
}
|
||||
.content-cell {
|
||||
padding: 35px;
|
||||
}
|
||||
.wrapper.layout-system .content-cell {
|
||||
padding: 35px 0;
|
||||
}
|
||||
/* Subcopy */
|
||||
.subcopy {
|
||||
border-top: 1px solid {{ .TableBorderColor }};
|
||||
margin-top: 25px;
|
||||
padding-top: 25px;
|
||||
}
|
||||
.subcopy p {
|
||||
font-size: 12px;
|
||||
}
|
||||
/* Footer */
|
||||
.footer {
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
width: 570px;
|
||||
}
|
||||
.footer p {
|
||||
color: {{ .FooterColor }};
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
/* Tables */
|
||||
.table table {
|
||||
border-collapse: collapse;
|
||||
margin: 30px auto;
|
||||
width: 100%;
|
||||
}
|
||||
.table th {
|
||||
border-bottom: 1px solid {{ .TableBorderColor }};
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
.table td {
|
||||
color: {{ .TextColor }};
|
||||
font-size: 15px;
|
||||
line-height: 18px;
|
||||
padding: 10px 0;
|
||||
}
|
||||
/* Buttons */
|
||||
.action {
|
||||
margin: 30px auto;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
.button {
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.16);
|
||||
color: {{ .ButtonTextColor }};
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
-webkit-text-size-adjust: none;
|
||||
}
|
||||
.button-primary {
|
||||
background-color: {{ .ButtonPrimaryBg }};
|
||||
border-top: 10px solid {{ .ButtonPrimaryBg }};
|
||||
border-right: 18px solid {{ .ButtonPrimaryBg }};
|
||||
border-bottom: 10px solid {{ .ButtonPrimaryBg }};
|
||||
border-left: 18px solid {{ .ButtonPrimaryBg }};
|
||||
}
|
||||
.button-positive {
|
||||
background-color: {{ .ButtonPositiveBg }};
|
||||
border-top: 10px solid {{ .ButtonPositiveBg }};
|
||||
border-right: 18px solid {{ .ButtonPositiveBg }};
|
||||
border-bottom: 10px solid {{ .ButtonPositiveBg }};
|
||||
border-left: 18px solid {{ .ButtonPositiveBg }};
|
||||
}
|
||||
.button-negative {
|
||||
background-color: {{ .ButtonNegativeBg }};
|
||||
border-top: 10px solid {{ .ButtonNegativeBg }};
|
||||
border-right: 18px solid {{ .ButtonNegativeBg }};
|
||||
border-bottom: 10px solid {{ .ButtonNegativeBg }};
|
||||
border-left: 18px solid {{ .ButtonNegativeBg }};
|
||||
}
|
||||
/* Panels */
|
||||
.panel {
|
||||
margin: 0 0 21px;
|
||||
}
|
||||
.panel-content {
|
||||
background-color: {{ .PanelBg }};
|
||||
padding: 16px;
|
||||
}
|
||||
.panel-item {
|
||||
padding: 0;
|
||||
}
|
||||
.panel-item p:last-of-type {
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
Reference in New Issue
Block a user