Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Add email styles support #153

Merged
merged 33 commits into from
May 23, 2019
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c7d8d00
#32702: (WIP) add email styles similar to magenta blank theme
Aug 24, 2017
67c9d50
#32702: split content of email-base and email-extend for normal versi…
Aug 25, 2017
f27b71a
#32702: add missing !default to magento ui variable
Aug 29, 2017
c8502ae
#32702: disable linter for some rules relate to email clients
Sep 1, 2017
4f27bee
#32702: add email files for ignore list as they often include some ha…
Sep 1, 2017
ffb5a4a
Merge branch 'develop' into feature/32702
Igloczek Sep 21, 2017
286ad8f
#32702: change comments in sass files to reference scss files instead…
Oct 10, 2017
408391e
#32702: remove TODO comment, make module-specific styles for emails b…
Oct 10, 2017
564f7ed
Merge branch 'feature/32702' of https://github.com/SnowdogApps/magent…
Oct 10, 2017
ecf10e6
#32702: clean email sass files from uncessesary comments
Oct 10, 2017
3547300
#32702: clean email sass files from uncessesary comments
Oct 10, 2017
4076404
Merge remote-tracking branch 'origin/feature/32702' into feature/32702
Oct 10, 2017
141f74e
#32702: add disable sass lint rules per line, remove block sass-lint …
Oct 13, 2017
9483ebc
#32702: add proper disabling linters comments for sass-lint and style…
Oct 13, 2017
7c954a6
Merge branch 'develop' into feature/32702
Oct 13, 2017
479a3a2
Merge branch 'develop'
Nov 13, 2017
ba79372
#32702: remove globals and email partials from lib.scss to make struc…
Dec 4, 2017
61e64ec
#32702: remove global imports from variables partial, move icons belo…
Dec 4, 2017
58f432f
#32702: revert back email sass files from Magento_Bundle module remov…
Dec 4, 2017
45751f7
Merge branch 'develop' into feature/32702
Januszpl Dec 11, 2017
eaedf9c
Merge branch 'develop' into feature/32702
Igloczek Mar 27, 2018
2547c42
Merge branch 'develop' into feature/32702
Januszpl Jul 30, 2018
332e3cc
Merge branch 'develop' into feature/32702
Januszpl Nov 20, 2018
63c19f3
Merge branch 'develop' into feature/32702
Januszpl Dec 7, 2018
3a76c2f
Revert "#32702: remove global imports from variables partial, move ic…
Dec 4, 2017
1dffccc
Revert "#32702: remove globals and email partials from lib.scss to ma…
Dec 4, 2017
19dbcb0
#32702: fix error with wrong variable name and reorder imports to get…
Dec 9, 2018
43c922a
#32702: formatting
Dec 9, 2018
cc73105
Merge branch 'develop' into feature/32702
May 22, 2019
a4e6a40
#32702: move inline email styles from modules to newly created email-…
May 22, 2019
c0623bf
#32702: add missing changes from Magento 2.3.0 blank theme
May 22, 2019
18d6a50
#32702: add missing changes from Magento 2.3.0 blank theme update
May 23, 2019
baa9616
Merge branch 'develop' into feature/32702
May 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .test/.stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
email.css
email-inline.css
31 changes: 31 additions & 0 deletions Magento_Bundle/styles/_email.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// Bundle Module Styles
// ---------------------------------------------

//
// Bundle Items
// ---------------------------------------------

.email-items {
.bundle-option-label {
> td {
padding: 0 $email-content__padding__base 0 $email-content__padding__l;
}
}

.bundle-option-value {
> td {
padding: 0 $email-content__padding__base $email-content__padding__base;

&.item-info {
padding: 0 $email-content__padding__base $email-content__padding__base $email-content__padding__xl;
}
}
}

tr.bundle-option-value + tr {
> td.item-extra {
padding-top: $email-content__padding__base;
}
}
}
4 changes: 2 additions & 2 deletions Magento_Rma/styles/_email.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Shrink table size on small screens to fit as much as possible without requiring horizontal scrolling
.rma-items td,
.rma-items th {
font-size: $font-size__s !important;
padding: 5px !important;
font-size: $font-size__s !important; // sass-lint:disable-line no-important
padding: 5px !important; // sass-lint:disable-line no-important
}
}
234 changes: 234 additions & 0 deletions Magento_Sales/styles/_email.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
//
// Sales Module Styles
// _____________________________________________

.email-summary {
h1 {
margin-bottom: $indent__xs;
}
}

@include max-screen($screen__xs) {
// Shrink order number in order email so it will fit on single line on small screens
.email-summary {
h1 {
// output 24px
font-size: ceil(1.7 * $font-size__base) !important; // sass-lint:disable-line no-important
}
}
}

//
// Order Summary
// ----------------------------------------------

.order-details {
width: 100%;

tr {
> .address-details,
> .method-info {
padding: $email-content__padding__base $email-content__padding__base $email-content__padding__base 0;
width: 50%;

h3 {
margin-top: 0;
}
}

// Prevent extra spacing on Payment & Shipping Method row
& + .method-info {
> td {
padding: 0 0 $email-content__padding__base;
}
}
}

.payment-method {
margin-bottom: $indent__s;

.title {
font-weight: $font-weight__regular;
}

.data.table {
> caption {
display: none;
}

th {
padding-right: $email-content__padding__base;
}
}
}
}

// Remove address and phone number link color on iOS
.address-details a {
@extend .no-link-a;
}

@include max-screen($screen__xs) {
// Stack columns
.order-details {
.address-details,
.method-info {
display: block;
padding: $email-content__padding__base 0 !important; // sass-lint:disable-line no-important
width: auto !important; // sass-lint:disable-line no-important

h3 {
margin-bottom: $indent__xs !important; // sass-lint:disable-line no-important
margin-top: 0 !important; // sass-lint:disable-line no-important
}
}
}
}

//
// Shipment Tracking
// ----------------------------------------------

.shipment-track {
@include lib-table($table__width, 0);

thead,
tbody {
> tr {
> th,
> td {
background-color: $color-gray95;
padding: $email-content__padding__base;
width: 50%;
}

& + tr {
th,
td {
padding-top: 0;
}
}
}
}
}

//
// Items Table
// ----------------------------------------------

.email-items {
@include lib-table($table__width, 0);
border: $table__border-width $table__border-style $table__border-color;

thead,
tfoot {
> tr {
> th,
> td {
background-color: $color-gray95;
}
}
}

> thead,
> tbody {
> tr {
> th {
padding: $email-content__padding__base;
}

> td {
padding: $email-content__padding__base;

&.message-gift {
border-top: none;
padding-top: 0;
}
}
}
}

> tbody,
> tfoot {
> tr {
> th,
> td {
border-top: $table__border-width $table__border-style $table__border-color;
}

& + tr {
> th,
> td {
border-top: 0;
}
}
}
}

p {
margin-bottom: 0;
}

.product-name {
font-weight: $font-weight__bold;
margin-bottom: $email-content__padding__s;
}

.has-extra .sku {
margin-bottom: $email-content__padding__base;
}

.item-info {
dl {
margin-bottom: 0;
padding-left: $email-content__padding__m;

dt,
dd {
margin-bottom: 0;
padding-bottom: 0;
}

dd {
padding-left: $email-content__padding__base;
}
}
}

.item-qty {
text-align: center;
}

.item-price {
text-align: right;
}

.item-extra {
padding-top: 0;
}

.order-totals {
> tr {
> th {
font-weight: $font-weight__regular;
}

> th,
> td {
padding: $email-content__padding__base;
text-align: right;
}

& + tr {
th,
td {
padding-top: 0;
}
}
}

.price {
white-space: nowrap;
}
}
}
19 changes: 19 additions & 0 deletions styles/email-fonts.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Fonts for Emails

@import 'vendor/magento-ui/lib'; // Global lib
@import 'vendor/magento-ui/variables/email'; // Global email variables
@import 'variables'; // Local theme variables
@import 'email/email-variables'; // Theme variables for emails

// Mixins
@import "mixins/media-queries";


// Output @font-face declarations

$media-common: true;

// Font stylesheet @import is wrapped in a media query in order to prevent it from causing problems in Outlook
@media screen {
@import 'blocks/typography';
}
13 changes: 13 additions & 0 deletions styles/email-inline.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// Styles for emails
// _____________________________________________

// See comments in source/_email-base.scss for explanation of email styles

@import 'vendor/magento-ui/lib'; // Global lib
@import 'vendor/magento-ui/variables/email'; // Global email variables
@import 'variables'; // Local theme variables
@import 'email/email-variables'; // Theme variables for emails

@import 'email/email-base-inline';
@import 'email/email-extend-inline';
25 changes: 25 additions & 0 deletions styles/email.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// Styles for emails
// _____________________________________________

// See comments in source/_email-base.scss for explanation of email styles

@import 'vendor/magento-ui/lib'; // Global lib
@import 'vendor/magento-ui/variables/email'; // Global email variables
@import 'variables'; // Local theme variables
@import 'email/email-variables'; // Theme variables for emails

// Mixins
@import "mixins/media-queries";

// Include all styles that have been indicated as non-inline styles
@import 'email/email-base';
@import 'email/email-extend';

// Module-specific styles for emails
@import '../Magento_Bundle/styles/email';
@import '../Magento_Rma/styles/email';
@import '../Magento_Sales/styles/email';

// It is impossible to apply media queries as inline styles, so all media queries must be output in this file
$media-target: 'all';
Loading