Nenhuma Descrição

email-styles.php 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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 4.0.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_color = wc_hex_is_light( $base ) ? $base : $base_text;
  28. if ( wc_hex_is_light( $body ) ) {
  29. $link_color = 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. $text_lighter_40 = wc_hex_lighter( $text, 40 );
  37. // !important; is a gmail hack to prevent styles being stripped if it doesn't like something.
  38. // body{padding: 0;} ensures proper scale/positioning of the email in the iOS native email app.
  39. ?>
  40. body {
  41. padding: 0;
  42. }
  43. #wrapper {
  44. background-color: <?php echo esc_attr( $bg ); ?>;
  45. margin: 0;
  46. padding: 70px 0;
  47. -webkit-text-size-adjust: none !important;
  48. width: 100%;
  49. }
  50. #template_container {
  51. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important;
  52. background-color: <?php echo esc_attr( $body ); ?>;
  53. border: 1px solid <?php echo esc_attr( $bg_darker_10 ); ?>;
  54. border-radius: 3px !important;
  55. }
  56. #template_header {
  57. background-color: <?php echo esc_attr( $base ); ?>;
  58. border-radius: 3px 3px 0 0 !important;
  59. color: <?php echo esc_attr( $base_text ); ?>;
  60. border-bottom: 0;
  61. font-weight: bold;
  62. line-height: 100%;
  63. vertical-align: middle;
  64. font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  65. }
  66. #template_header h1,
  67. #template_header h1 a {
  68. color: <?php echo esc_attr( $base_text ); ?>;
  69. background-color: inherit;
  70. }
  71. #template_header_image img {
  72. margin-left: 0;
  73. margin-right: 0;
  74. }
  75. #template_footer td {
  76. padding: 0;
  77. border-radius: 6px;
  78. }
  79. #template_footer #credit {
  80. border: 0;
  81. color: <?php echo esc_attr( $text_lighter_40 ); ?>;
  82. font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  83. font-size: 12px;
  84. line-height: 150%;
  85. text-align: center;
  86. padding: 24px 0;
  87. }
  88. #template_footer #credit p {
  89. margin: 0 0 16px;
  90. }
  91. #body_content {
  92. background-color: <?php echo esc_attr( $body ); ?>;
  93. }
  94. #body_content table td {
  95. padding: 48px 48px 32px;
  96. }
  97. #body_content table td td {
  98. padding: 12px;
  99. }
  100. #body_content table td th {
  101. padding: 12px;
  102. }
  103. #body_content td ul.wc-item-meta {
  104. font-size: small;
  105. margin: 1em 0 0;
  106. padding: 0;
  107. list-style: none;
  108. }
  109. #body_content td ul.wc-item-meta li {
  110. margin: 0.5em 0 0;
  111. padding: 0;
  112. }
  113. #body_content td ul.wc-item-meta li p {
  114. margin: 0;
  115. }
  116. #body_content p {
  117. margin: 0 0 16px;
  118. }
  119. #body_content_inner {
  120. color: <?php echo esc_attr( $text_lighter_20 ); ?>;
  121. font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  122. font-size: 14px;
  123. line-height: 150%;
  124. text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>;
  125. }
  126. .td {
  127. color: <?php echo esc_attr( $text_lighter_20 ); ?>;
  128. border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>;
  129. vertical-align: middle;
  130. }
  131. .address {
  132. padding: 12px;
  133. color: <?php echo esc_attr( $text_lighter_20 ); ?>;
  134. border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>;
  135. }
  136. .text {
  137. color: <?php echo esc_attr( $text ); ?>;
  138. font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  139. }
  140. .link {
  141. color: <?php echo esc_attr( $link_color ); ?>;
  142. }
  143. #header_wrapper {
  144. padding: 36px 48px;
  145. display: block;
  146. }
  147. h1 {
  148. color: <?php echo esc_attr( $base ); ?>;
  149. font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  150. font-size: 30px;
  151. font-weight: 300;
  152. line-height: 150%;
  153. margin: 0;
  154. text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>;
  155. text-shadow: 0 1px 0 <?php echo esc_attr( $base_lighter_20 ); ?>;
  156. }
  157. h2 {
  158. color: <?php echo esc_attr( $base ); ?>;
  159. display: block;
  160. font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  161. font-size: 18px;
  162. font-weight: bold;
  163. line-height: 130%;
  164. margin: 0 0 18px;
  165. text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>;
  166. }
  167. h3 {
  168. color: <?php echo esc_attr( $base ); ?>;
  169. display: block;
  170. font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  171. font-size: 16px;
  172. font-weight: bold;
  173. line-height: 130%;
  174. margin: 16px 0 8px;
  175. text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>;
  176. }
  177. a {
  178. color: <?php echo esc_attr( $link_color ); ?>;
  179. font-weight: normal;
  180. text-decoration: underline;
  181. }
  182. img {
  183. border: none;
  184. display: inline-block;
  185. font-size: 14px;
  186. font-weight: bold;
  187. height: auto;
  188. outline: none;
  189. text-decoration: none;
  190. text-transform: capitalize;
  191. vertical-align: middle;
  192. margin-<?php echo is_rtl() ? 'left' : 'right'; ?>: 10px;
  193. max-width: 100%;
  194. height: auto;
  195. }
  196. <?php