Astra_Dynamic_CSS::load_cart_static_css()
Load static card(EDD/Woo) CSS.
Description
Return
(string) static css for Woocommerce and EDD card.
Source
File: inc/class-astra-dynamic-css.php
public static function load_cart_static_css() { $cart_static_css = ' .ast-site-header-cart .cart-container, .ast-edd-site-header-cart .ast-edd-cart-container { transition: all 0.2s linear; } .ast-site-header-cart .ast-woo-header-cart-info-wrap, .ast-edd-site-header-cart .ast-edd-header-cart-info-wrap { padding: 0 2px; font-weight: 600; line-height: 2.7; display: inline-block; } .ast-site-header-cart i.astra-icon { font-size: 20px; font-size: 1.3em; font-style: normal; font-weight: normal; position: relative; padding: 0 2px; } .ast-site-header-cart i.astra-icon.no-cart-total:after, .ast-header-break-point.ast-header-custom-item-outside .ast-edd-header-cart-info-wrap, .ast-header-break-point.ast-header-custom-item-outside .ast-woo-header-cart-info-wrap { display: none; } .ast-site-header-cart.ast-menu-cart-fill i.astra-icon, .ast-edd-site-header-cart.ast-edd-menu-cart-fill span.astra-icon { font-size: 1.1em; } .astra-cart-drawer { position: fixed; display: block; visibility: hidden; overflow: auto; -webkit-overflow-scrolling: touch; z-index: 9999; background-color: #fff; transition: all 0.5s ease; transform: translate3d(0, 0, 0); } .astra-cart-drawer.open-right { width: 80%; height: 100%; left: 100%; top: 0px; transform: translate3d(0%, 0, 0); } .astra-cart-drawer.active { transform: translate3d(-100%, 0, 0); visibility: visible; } .astra-cart-drawer .astra-cart-drawer-header { text-align: center; text-transform: uppercase; font-weight: 400; border-bottom: 1px solid #f0f0f0; padding: 0 0 0.675rem; } .astra-cart-drawer .astra-cart-drawer-close .ast-close-svg { width: 22px; height: 22px; } .astra-cart-drawer .astra-cart-drawer-title { padding-top: 5px; } .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart { padding: 1em 1.5em; } .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart a.remove { width: 20px; height: 20px; line-height: 16px; } .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart__total { padding: 1em 1.5em; margin: 0; text-align: center; } .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart__buttons { padding: 10px; text-align: center; } .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart__buttons .button.checkout { margin-right: 0; } .astra-cart-drawer .astra-cart-drawer-content .edd-cart-item { padding: .5em 2.6em .5em 1.5em; } .astra-cart-drawer .astra-cart-drawer-content .edd-cart-item .edd-remove-from-cart::after { width: 20px; height: 20px; line-height: 16px; } .astra-cart-drawer .astra-cart-drawer-content .edd-cart-number-of-items { padding: 1em 1.5em 1em 1.5em; margin-bottom: 0; text-align: center; } .astra-cart-drawer .astra-cart-drawer-content .edd_total { padding: .5em 1.5em; margin: 0; text-align: center; } .astra-cart-drawer .astra-cart-drawer-content .cart_item.edd_checkout { padding: 1em 1.5em 0; text-align: center; margin-top: 0; } .astra-cart-drawer .woocommerce-mini-cart__empty-message, .astra-cart-drawer .cart_item.empty { text-align: center; margin-top: 10px; } body.admin-bar .astra-cart-drawer { padding-top: 32px; } body.admin-bar .astra-cart-drawer .astra-cart-drawer-close { top: 32px; } @media (max-width: 782px) { body.admin-bar .astra-cart-drawer { padding-top: 46px; } body.admin-bar .astra-cart-drawer .astra-cart-drawer-close { top: 46px; } } .ast-mobile-cart-active body.ast-hfb-header { overflow: hidden; } .ast-mobile-cart-active .astra-mobile-cart-overlay { opacity: 1; cursor: pointer; visibility: visible; z-index: 999; } @media (max-width: 545px) { .astra-cart-drawer.active { width: 100%; } } '; if ( is_rtl() ) { $cart_static_css .= ' .ast-site-header-cart i.astra-icon:after { content: attr(data-cart-total); position: absolute; font-style: normal; top: -10px; left: -12px; font-weight: bold; box-shadow: 1px 1px 3px 0px rgba(0, 0, 0, 0.3); font-size: 11px; padding-right: 0px; padding-left: 2px; line-height: 17px; letter-spacing: -.5px; height: 18px; min-width: 18px; border-radius: 99px; text-align: center; z-index: 3; } li.woocommerce-custom-menu-item .ast-site-header-cart i.astra-icon:after, li.edd-custom-menu-item .ast-edd-site-header-cart span.astra-icon:after { padding-right: 2px; } .astra-cart-drawer .astra-cart-drawer-close { position: absolute; top: 0; left: 0; margin: 0; padding: .6em 1em .4em; color: #ababab; background-color: transparent; } .astra-mobile-cart-overlay { background-color: rgba(0, 0, 0, 0.4); position: fixed; top: 0; left: 0; bottom: 0; right: 0; visibility: hidden; opacity: 0; transition: opacity 0.2s ease-in-out; } .astra-cart-drawer .astra-cart-drawer-content .edd-cart-item .edd-remove-from-cart { left: 1.2em; } .ast-header-break-point.ast-woocommerce-cart-menu.ast-hfb-header .ast-cart-menu-wrap, .ast-header-break-point.ast-hfb-header .ast-cart-menu-wrap, .ast-header-break-point .ast-edd-site-header-cart-wrap .ast-edd-cart-menu-wrap { width: 2em; height: 2em; font-size: 1.4em; line-height: 2; vertical-align: middle; text-align: left; }'; } else { $cart_static_css .= ' .ast-site-header-cart i.astra-icon:after { content: attr(data-cart-total); position: absolute; font-style: normal; top: -10px; right: -12px; font-weight: bold; box-shadow: 1px 1px 3px 0px rgba(0, 0, 0, 0.3); font-size: 11px; padding-left: 0px; padding-right: 2px; line-height: 17px; letter-spacing: -.5px; height: 18px; min-width: 18px; border-radius: 99px; text-align: center; z-index: 3; } li.woocommerce-custom-menu-item .ast-site-header-cart i.astra-icon:after, li.edd-custom-menu-item .ast-edd-site-header-cart span.astra-icon:after { padding-left: 2px; } .astra-cart-drawer .astra-cart-drawer-close { position: absolute; top: 0; right: 0; margin: 0; padding: .6em 1em .4em; color: #ababab; background-color: transparent; } .astra-mobile-cart-overlay { background-color: rgba(0, 0, 0, 0.4); position: fixed; top: 0; right: 0; bottom: 0; left: 0; visibility: hidden; opacity: 0; transition: opacity 0.2s ease-in-out; } .astra-cart-drawer .astra-cart-drawer-content .edd-cart-item .edd-remove-from-cart { right: 1.2em; } .ast-header-break-point.ast-woocommerce-cart-menu.ast-hfb-header .ast-cart-menu-wrap, .ast-header-break-point.ast-hfb-header .ast-cart-menu-wrap, .ast-header-break-point .ast-edd-site-header-cart-wrap .ast-edd-cart-menu-wrap { width: 2em; height: 2em; font-size: 1.4em; line-height: 2; vertical-align: middle; text-align: right; }'; } $cart_static_css .= ' .ast-site-header-cart.ast-menu-cart-outline .ast-cart-menu-wrap, .ast-site-header-cart.ast-menu-cart-fill .ast-cart-menu-wrap, .ast-edd-site-header-cart.ast-edd-menu-cart-outline .ast-edd-cart-menu-wrap, .ast-edd-site-header-cart.ast-edd-menu-cart-fill .ast-edd-cart-menu-wrap { line-height: 1.8; }'; // This CSS requires in case of :before Astra icons. But in case of SVGs this loads twice that's why removed this from static & loading conditionally. if ( false === Astra_Icons::is_svg_icons() ) { $cart_static_css .= ' .ast-site-header-cart .cart-container *, .ast-edd-site-header-cart .ast-edd-cart-container * { transition: all 0s linear; } '; } return $cart_static_css; }
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |