email-styles.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <?php
  2. /**
  3. * Email Styles
  4. *
  5. * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-styles.php.
  6. *
  7. * HOWEVER, on occasion WooCommerce will need to update template files and you
  8. * (the theme developer) will need to copy the new files to your theme to
  9. * maintain compatibility. We try to do this as little as possible, but it does
  10. * happen. When this occurs the version of the template file will be bumped and
  11. * the readme will list any important changes.
  12. *
  13. * @see https://docs.woocommerce.com/document/template-structure/
  14. * @package WooCommerce/Templates/Emails
  15. * @version 3.3.0
  16. */
  17. if ( ! defined( 'ABSPATH' ) ) {
  18. exit;
  19. }
  20. // Load colors.
  21. $bg = get_option( 'woocommerce_email_background_color' );
  22. $body = get_option( 'woocommerce_email_body_background_color' );
  23. $base = get_option( 'woocommerce_email_base_color' );
  24. $base_text = wc_light_or_dark( $base, '#202020', '#ffffff' );
  25. $text = get_option( 'woocommerce_email_text_color' );
  26. // Pick a contrasting color for links.
  27. $link = wc_hex_is_light( $base ) ? $base : $base_text;
  28. if ( wc_hex_is_light( $body ) ) {
  29. $link = wc_hex_is_light( $base ) ? $base_text : $base;
  30. }
  31. $bg_darker_10 = wc_hex_darker( $bg, 10 );
  32. $body_darker_10 = wc_hex_darker( $body, 10 );
  33. $base_lighter_20 = wc_hex_lighter( $base, 20 );
  34. $base_lighter_40 = wc_hex_lighter( $base, 40 );
  35. $text_lighter_20 = wc_hex_lighter( $text, 20 );
  36. // !important; is a gmail hack to prevent styles being stripped if it doesn't like something.
  37. ?>
  38. #wrapper {
  39. background-color: <?php echo esc_attr( $bg ); ?>;
  40. margin: 0;
  41. padding: 70px 0 70px 0;
  42. -webkit-text-size-adjust: none !important;
  43. width: 100%;
  44. }
  45. #template_container {
  46. box-shadow: 0 1px 4px rgba(0,0,0,0.1) !important;
  47. background-color: <?php echo esc_attr( $body ); ?>;
  48. border: 1px solid <?php echo esc_attr( $bg_darker_10 ); ?>;
  49. border-radius: 3px !important;
  50. }
  51. #template_header {
  52. background-color: <?php echo esc_attr( $base ); ?>;
  53. border-radius: 3px 3px 0 0 !important;
  54. color: <?php echo esc_attr( $base_text ); ?>;
  55. border-bottom: 0;
  56. font-weight: bold;
  57. line-height: 100%;
  58. vertical-align: middle;
  59. font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  60. }
  61. #template_header h1,
  62. #template_header h1 a {
  63. color: <?php echo esc_attr( $base_text ); ?>;
  64. }
  65. #template_footer td {
  66. padding: 0;
  67. -webkit-border-radius: 6px;
  68. }
  69. #template_footer #credit {
  70. border:0;
  71. color: <?php echo esc_attr( $base_lighter_40 ); ?>;
  72. font-family: Arial;
  73. font-size:12px;
  74. line-height:125%;
  75. text-align:center;
  76. padding: 0 48px 48px 48px;
  77. }
  78. #body_content {
  79. background-color: <?php echo esc_attr( $body ); ?>;
  80. }
  81. #body_content table td {
  82. padding: 48px 48px 0;
  83. }
  84. #body_content table td td {
  85. padding: 12px;
  86. }
  87. #body_content table td th {
  88. padding: 12px;
  89. }
  90. #body_content td ul.wc-item-meta {
  91. font-size: small;
  92. margin: 1em 0 0;
  93. padding: 0;
  94. list-style: none;
  95. }
  96. #body_content td ul.wc-item-meta li {
  97. margin: 0.5em 0 0;
  98. padding: 0;
  99. }
  100. #body_content td ul.wc-item-meta li p {
  101. margin: 0;
  102. }
  103. #body_content p {
  104. margin: 0 0 16px;
  105. }
  106. #body_content_inner {
  107. color: <?php echo esc_attr( $text_lighter_20 ); ?>;
  108. font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  109. font-size: 14px;
  110. line-height: 150%;
  111. text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>;
  112. }
  113. .td {
  114. color: <?php echo esc_attr( $text_lighter_20 ); ?>;
  115. border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>;
  116. vertical-align: middle;
  117. }
  118. .address {
  119. padding:12px 12px 0;
  120. color: <?php echo esc_attr( $text_lighter_20 ); ?>;
  121. border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>;
  122. }
  123. .text {
  124. color: <?php echo esc_attr( $text ); ?>;
  125. font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  126. }
  127. .link {
  128. color: <?php echo esc_attr( $base ); ?>;
  129. }
  130. #header_wrapper {
  131. padding: 36px 48px;
  132. display: block;
  133. }
  134. h1 {
  135. color: <?php echo esc_attr( $base ); ?>;
  136. font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  137. font-size: 30px;
  138. font-weight: 300;
  139. line-height: 150%;
  140. margin: 0;
  141. text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>;
  142. text-shadow: 0 1px 0 <?php echo esc_attr( $base_lighter_20 ); ?>;
  143. }
  144. h2 {
  145. color: <?php echo esc_attr( $base ); ?>;
  146. display: block;
  147. font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  148. font-size: 18px;
  149. font-weight: bold;
  150. line-height: 130%;
  151. margin: 0 0 18px;
  152. text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>;
  153. }
  154. h3 {
  155. color: <?php echo esc_attr( $base ); ?>;
  156. display: block;
  157. font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  158. font-size: 16px;
  159. font-weight: bold;
  160. line-height: 130%;
  161. margin: 16px 0 8px;
  162. text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>;
  163. }
  164. a {
  165. color: <?php echo esc_attr( $link ); ?>;
  166. font-weight: normal;
  167. text-decoration: underline;
  168. }
  169. img {
  170. border: none;
  171. display: inline-block;
  172. font-size: 14px;
  173. font-weight: bold;
  174. height: auto;
  175. outline: none;
  176. text-decoration: none;
  177. text-transform: capitalize;
  178. vertical-align: middle;
  179. margin-<?php echo is_rtl() ? 'left' : 'right'; ?>: 10px;
  180. }
  181. <?php