plain
3 years ago
admin-cancelled-order.php
5 years ago
admin-failed-order.php
5 years ago
admin-new-order.php
5 years ago
customer-completed-order.php
5 years ago
customer-invoice.php
4 years ago
customer-new-account.php
4 years ago
customer-note.php
5 years ago
customer-on-hold-order.php
3 years ago
customer-processing-order.php
5 years ago
customer-refunded-order.php
5 years ago
customer-reset-password.php
5 years ago
email-addresses.php
4 years ago
email-customer-details.php
5 years ago
email-downloads.php
5 years ago
email-footer.php
3 years ago
email-header.php
3 years ago
email-mobile-messaging.php
3 years ago
email-order-details.php
5 years ago
email-order-items.php
5 years ago
email-styles.php
3 years ago
email-styles.php
254 lines
| 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 7.4.0 |
| 16 | */ |
| 17 | |
| 18 | if ( ! defined( 'ABSPATH' ) ) { |
| 19 | exit; |
| 20 | } |
| 21 | |
| 22 | // Load colors. |
| 23 | $bg = get_option( 'woocommerce_email_background_color' ); |
| 24 | $body = get_option( 'woocommerce_email_body_background_color' ); |
| 25 | $base = get_option( 'woocommerce_email_base_color' ); |
| 26 | $base_text = wc_light_or_dark( $base, '#202020', '#ffffff' ); |
| 27 | $text = get_option( 'woocommerce_email_text_color' ); |
| 28 | |
| 29 | // Pick a contrasting color for links. |
| 30 | $link_color = wc_hex_is_light( $base ) ? $base : $base_text; |
| 31 | |
| 32 | if ( wc_hex_is_light( $body ) ) { |
| 33 | $link_color = wc_hex_is_light( $base ) ? $base_text : $base; |
| 34 | } |
| 35 | |
| 36 | $bg_darker_10 = wc_hex_darker( $bg, 10 ); |
| 37 | $body_darker_10 = wc_hex_darker( $body, 10 ); |
| 38 | $base_lighter_20 = wc_hex_lighter( $base, 20 ); |
| 39 | $base_lighter_40 = wc_hex_lighter( $base, 40 ); |
| 40 | $text_lighter_20 = wc_hex_lighter( $text, 20 ); |
| 41 | $text_lighter_40 = wc_hex_lighter( $text, 40 ); |
| 42 | |
| 43 | // !important; is a gmail hack to prevent styles being stripped if it doesn't like something. |
| 44 | // body{padding: 0;} ensures proper scale/positioning of the email in the iOS native email app. |
| 45 | ?> |
| 46 | body { |
| 47 | background-color: <?php echo esc_attr( $bg ); ?>; |
| 48 | padding: 0; |
| 49 | text-align: center; |
| 50 | } |
| 51 | |
| 52 | #outer_wrapper { |
| 53 | background-color: <?php echo esc_attr( $bg ); ?>; |
| 54 | } |
| 55 | |
| 56 | #wrapper { |
| 57 | margin: 0 auto; |
| 58 | padding: 70px 0; |
| 59 | -webkit-text-size-adjust: none !important; |
| 60 | width: 100%; |
| 61 | max-width: 600px; |
| 62 | } |
| 63 | |
| 64 | #template_container { |
| 65 | box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important; |
| 66 | background-color: <?php echo esc_attr( $body ); ?>; |
| 67 | border: 1px solid <?php echo esc_attr( $bg_darker_10 ); ?>; |
| 68 | border-radius: 3px !important; |
| 69 | } |
| 70 | |
| 71 | #template_header { |
| 72 | background-color: <?php echo esc_attr( $base ); ?>; |
| 73 | border-radius: 3px 3px 0 0 !important; |
| 74 | color: <?php echo esc_attr( $base_text ); ?>; |
| 75 | border-bottom: 0; |
| 76 | font-weight: bold; |
| 77 | line-height: 100%; |
| 78 | vertical-align: middle; |
| 79 | font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; |
| 80 | } |
| 81 | |
| 82 | #template_header h1, |
| 83 | #template_header h1 a { |
| 84 | color: <?php echo esc_attr( $base_text ); ?>; |
| 85 | background-color: inherit; |
| 86 | } |
| 87 | |
| 88 | #template_header_image img { |
| 89 | margin-left: 0; |
| 90 | margin-right: 0; |
| 91 | } |
| 92 | |
| 93 | #template_footer td { |
| 94 | padding: 0; |
| 95 | border-radius: 6px; |
| 96 | } |
| 97 | |
| 98 | #template_footer #credit { |
| 99 | border: 0; |
| 100 | color: <?php echo esc_attr( $text_lighter_40 ); ?>; |
| 101 | font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; |
| 102 | font-size: 12px; |
| 103 | line-height: 150%; |
| 104 | text-align: center; |
| 105 | padding: 24px 0; |
| 106 | } |
| 107 | |
| 108 | #template_footer #credit p { |
| 109 | margin: 0 0 16px; |
| 110 | } |
| 111 | |
| 112 | #body_content { |
| 113 | background-color: <?php echo esc_attr( $body ); ?>; |
| 114 | } |
| 115 | |
| 116 | #body_content table td { |
| 117 | padding: 48px 48px 32px; |
| 118 | } |
| 119 | |
| 120 | #body_content table td td { |
| 121 | padding: 12px; |
| 122 | } |
| 123 | |
| 124 | #body_content table td th { |
| 125 | padding: 12px; |
| 126 | } |
| 127 | |
| 128 | #body_content td ul.wc-item-meta { |
| 129 | font-size: small; |
| 130 | margin: 1em 0 0; |
| 131 | padding: 0; |
| 132 | list-style: none; |
| 133 | } |
| 134 | |
| 135 | #body_content td ul.wc-item-meta li { |
| 136 | margin: 0.5em 0 0; |
| 137 | padding: 0; |
| 138 | } |
| 139 | |
| 140 | #body_content td ul.wc-item-meta li p { |
| 141 | margin: 0; |
| 142 | } |
| 143 | |
| 144 | #body_content p { |
| 145 | margin: 0 0 16px; |
| 146 | } |
| 147 | |
| 148 | #body_content_inner { |
| 149 | color: <?php echo esc_attr( $text_lighter_20 ); ?>; |
| 150 | font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; |
| 151 | font-size: 14px; |
| 152 | line-height: 150%; |
| 153 | text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>; |
| 154 | } |
| 155 | |
| 156 | .td { |
| 157 | color: <?php echo esc_attr( $text_lighter_20 ); ?>; |
| 158 | border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>; |
| 159 | vertical-align: middle; |
| 160 | } |
| 161 | |
| 162 | .address { |
| 163 | padding: 12px; |
| 164 | color: <?php echo esc_attr( $text_lighter_20 ); ?>; |
| 165 | border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>; |
| 166 | } |
| 167 | |
| 168 | .text { |
| 169 | color: <?php echo esc_attr( $text ); ?>; |
| 170 | font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; |
| 171 | } |
| 172 | |
| 173 | .link { |
| 174 | color: <?php echo esc_attr( $link_color ); ?>; |
| 175 | } |
| 176 | |
| 177 | #header_wrapper { |
| 178 | padding: 36px 48px; |
| 179 | display: block; |
| 180 | } |
| 181 | |
| 182 | h1 { |
| 183 | color: <?php echo esc_attr( $base ); ?>; |
| 184 | font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; |
| 185 | font-size: 30px; |
| 186 | font-weight: 300; |
| 187 | line-height: 150%; |
| 188 | margin: 0; |
| 189 | text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>; |
| 190 | text-shadow: 0 1px 0 <?php echo esc_attr( $base_lighter_20 ); ?>; |
| 191 | } |
| 192 | |
| 193 | h2 { |
| 194 | color: <?php echo esc_attr( $base ); ?>; |
| 195 | display: block; |
| 196 | font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; |
| 197 | font-size: 18px; |
| 198 | font-weight: bold; |
| 199 | line-height: 130%; |
| 200 | margin: 0 0 18px; |
| 201 | text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>; |
| 202 | } |
| 203 | |
| 204 | h3 { |
| 205 | color: <?php echo esc_attr( $base ); ?>; |
| 206 | display: block; |
| 207 | font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; |
| 208 | font-size: 16px; |
| 209 | font-weight: bold; |
| 210 | line-height: 130%; |
| 211 | margin: 16px 0 8px; |
| 212 | text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>; |
| 213 | } |
| 214 | |
| 215 | a { |
| 216 | color: <?php echo esc_attr( $link_color ); ?>; |
| 217 | font-weight: normal; |
| 218 | text-decoration: underline; |
| 219 | } |
| 220 | |
| 221 | img { |
| 222 | border: none; |
| 223 | display: inline-block; |
| 224 | font-size: 14px; |
| 225 | font-weight: bold; |
| 226 | height: auto; |
| 227 | outline: none; |
| 228 | text-decoration: none; |
| 229 | text-transform: capitalize; |
| 230 | vertical-align: middle; |
| 231 | margin-<?php echo is_rtl() ? 'left' : 'right'; ?>: 10px; |
| 232 | max-width: 100%; |
| 233 | } |
| 234 | |
| 235 | /** |
| 236 | * Media queries are not supported by all email clients, however they do work on modern mobile |
| 237 | * Gmail clients and can help us achieve better consistency there. |
| 238 | */ |
| 239 | @media screen and (max-width: 600px) { |
| 240 | #header_wrapper { |
| 241 | padding: 27px 36px !important; |
| 242 | font-size: 24px; |
| 243 | } |
| 244 | |
| 245 | #body_content table > tbody > tr > td { |
| 246 | padding: 10px !important; |
| 247 | } |
| 248 | |
| 249 | #body_content_inner { |
| 250 | font-size: 10px !important; |
| 251 | } |
| 252 | } |
| 253 | <?php |
| 254 |