123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305 |
- // /**
- // * Copyright © Magento, Inc. All rights reserved.
- // * See COPYING.txt for license details.
- // */
- // The contents of this file will get split into two output files: email.less and email-inline.less.
- //
- // email.less
- // Styles contained in the .email-non-inline() and .media-width() mixins will be output in the email.less file
- // and will be included in a <style> tag in emails. Non-inline styles should be used for styles that can't be applied
- // as inline CSS, such as media queries.
- //
- // email-inline.less
- // Styles not included in the mixins mentioned above will be included in the email-inline.less file.
- // Since email client support for CSS in <style> tags is limited, the majority of styles should be added as "inline"
- // styles. CSS will be applied to transactional email HTML via the Emogrifier library, which only has support for
- // certain CSS selectors (source: https://github.com/jjriv/emogrifier#supported-css-selectors):
- //
- // Supported selectors (examples in parenthesis):
- // * ID (#logo)
- // * class (.logo)
- // * type (h1)
- // * descendant (.logo > a)
- // * child (.logo a)
- // * adjacent (.logo + .second-example)
- // * attribute presence (a[title])
- // * attribute value (a[title="example"])
- // * attribute only ([title="example"])
- //
- // Unsupported selectors (examples in parenthesis):
- // * first-child (div:first-child)
- // * last-child (div:last-child)
- // * nth-child (div:nth-child(3n+1))
- // * universal (*)
- // * pseudo (a:hover, a:active, a:focus, span:before, span:after, etc)
- //
- // Variables
- // _____________________________________________
- @font-size-unit-convert: false; // Prevents font-related measurements from being converted to the incompatible rem unit
- //
- // Resets
- // ---------------------------------------------
- // Generic resets
- body {
- margin: 0;
- padding: 0;
- }
- img {
- border: 0;
- height: auto;
- line-height: 100%;
- outline: none;
- text-decoration: none;
- }
- table {
- border-collapse: collapse;
- td {
- vertical-align: top;
- }
- }
- // Client-specific resets (from the Salted email template: https://github.com/rodriguezcommaj/salted)
- .email-non-inline() {
- // Prevent WebKit and Windows mobile from changing default text sizes
- body,
- table,
- td,
- a {
- -ms-text-size-adjust: 100%;
- -webkit-text-size-adjust: 100%;
- }
- // Allow smoother rendering of resized images in Internet Explorer (such as high-resolution logo)
- img {
- -ms-interpolation-mode: bicubic;
- }
- // Remove spacing between tables in Outlook 2007 and up
- table,
- td {
- mso-table-lspace: 0pt;
- mso-table-rspace: 0pt;
- }
- }
- //
- // Typography
- // ---------------------------------------------
- // See email-fonts.less for @font-face declarations
- .lib-typography-all();
- body {
- font-family: @font-family__base;
- font-weight: normal;
- text-align: left;
- }
- th,
- td {
- font-family: @font-family__base;
- }
- a {
- color: @link__color;
- text-decoration: @link__text-decoration;
- }
- .email-non-inline() {
- a:visited {
- color: @link__visited__color !important;
- text-decoration: @link__visited__text-decoration !important;
- }
- a:hover {
- color: @link__hover__color !important;
- text-decoration: @link__hover__text-decoration !important;
- }
- a:active {
- color: @link__active__color !important;
- text-decoration: @link__active__text-decoration !important;
- }
- // Remove link color on iOS
- .no-link a {
- color: @text__color !important;
- cursor: default !important;
- text-decoration: none !important;
- }
- }
- //
- // Layout
- // ---------------------------------------------
- html,
- body {
- background-color: @email__background-color;
- }
- .wrapper {
- margin: 0 auto;
- }
- .wrapper-inner {
- padding-bottom: @email-content__padding__l;
- width: 100%;
- }
- .main {
- margin: 0 auto;
- text-align: left; // Necessary to prevent all text from centering in Outlook 2003
- width: @email-body__width;
- }
- .header {
- padding: @email-body__padding @email-body__padding 0;
- }
- .main-content {
- background-color: @email-content__background-color;
- padding: @email-body__padding;
- }
- .footer {
- padding: 0 @email-body__padding @email-body__padding; // Reduce space between body of email and closing text
- }
- // Layout (Mobile)
- .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) {
- html,
- body {
- // Change background/foreground to same color
- background-color: @email-content__background-color;
- width: 100% !important;
- }
- .main {
- max-width: 100% !important;
- min-width: 240px;
- width: auto !important;
- }
- }
- //
- // Buttons
- // ---------------------------------------------
- .button {
- & > tr > td {
- padding-bottom: @indent__s;
- }
- .inner-wrapper {
- td {
- .lib-css(border-radius, @button__border-radius, 1);
- background-color: @button-primary__background;
- a {
- .lib-css(border-radius, @button__border-radius, 1);
- border: 1px solid @button-primary__background;
- color: @button-primary__color;
- display: inline-block;
- font-size: @button__font-size;
- padding: @button__padding;
- text-decoration: none;
- }
- }
- }
- }
- .email-non-inline() {
- .button {
- .inner-wrapper {
- td:hover {
- background-color: @button-primary__hover__background !important;
- }
- a:active,
- td:active {
- background-color: @button-primary__active__background !important;
- }
- }
- a:active,
- a:hover,
- a:visited {
- // Undo general link hover state
- border: 1px solid @button-primary__hover__background;
- color: @button-primary__hover__color !important;
- text-decoration: none !important;
- }
- }
- .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__xs) {
- .button {
- .inner-wrapper {
- width: 100% !important;
- td {
- a {
- font-size: @button__font-size + 2;
- }
- }
- }
- }
- }
- }
- //
- // Messages
- // ---------------------------------------------
- .message-info,
- .message-gift {
- width: @table__width;
- td {
- background-color: @message-email__background;
- border: 1px solid @message-email__border-color;
- color: @message-email__color;
- margin: 0;
- padding: @email-content__padding__base;
- a {
- color: @message-email-link__color;
- }
- h1,
- h2,
- h3,
- h4,
- h5,
- h6 {
- margin-top: 0;
- }
- }
- }
- .message-details {
- margin-bottom: @indent__s;
- b {
- font-weight: bold;
- }
- td {
- padding-bottom: @indent__xs;
- b {
- margin-right: @indent__s;
- }
- }
- }
|