Automattic\WooCommerce\Internal\EmailEditor
WooContentProcessor::get_woo_content_styles
Get CSS styles specific to WooCommerce email content.
These styles target WooCommerce-specific HTML classes in the order details, totals, and other email content areas. They are needed because the WooCommerce email CSS selectors (prefixed with #body_content) do not match in the block email editor template structure.
Method of the class: WooContentProcessor{}
No Hooks.
Returns
String. CSS styles.
Usage
// private - for code of main (parent) class only $result = $this->get_woo_content_styles(): string;
Changelog
| Since 10.8.0 | Introduced. |
WooContentProcessor::get_woo_content_styles() WooContentProcessor::get woo content styles code WC 10.9.1
private function get_woo_content_styles(): string {
return '
.email-order-details td,
.email-order-details th {
padding: 8px 12px;
}
.email-order-details td:first-child,
.email-order-details th:first-child {
padding-left: 0;
}
.email-order-details td:last-child,
.email-order-details th:last-child {
padding-right: 0;
}
.order-item-data td {
border: 0;
padding: 0;
vertical-align: top;
}
.order-item-data img {
border-radius: 4px;
}
.order-totals th,
.order-totals td {
font-weight: 400;
padding-bottom: 5px;
padding-top: 5px;
}
.order-totals-total th {
font-weight: 700;
}
.order-totals-total td {
font-weight: 700;
font-size: 20px;
}
h2.email-order-detail-heading {
font-size: 20px;
font-weight: 700;
line-height: 1.6;
}
h2.email-order-detail-heading span {
font-size: 14px;
font-weight: 400;
color: #757575;
}
.email-order-item-meta {
font-size: 14px;
line-height: 1.4;
}
';
}