summaryrefslogtreecommitdiff
path: root/inc/builder/type/header/account
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2021-07-21 14:54:07 -0500
committerZach van Rijn <me@zv.io>2021-07-21 14:54:07 -0500
commit9d4123cee1867ee7199b06bdc92d40611f547ecc (patch)
tree6d864e2725242863afed1f8ba12d9c7a9bc63a69 /inc/builder/type/header/account
downloadblog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.gz
blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.bz2
blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.xz
blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.zip
Initial unmodified import from Astra (Version: 3.6.5) @ /wp-content/themes/astra/.
Diffstat (limited to 'inc/builder/type/header/account')
-rw-r--r--inc/builder/type/header/account/assets/js/minified/customizer-preview.min.js1
-rw-r--r--inc/builder/type/header/account/assets/js/unminified/customizer-preview.js140
-rw-r--r--inc/builder/type/header/account/class-astra-header-account-component-loader.php53
-rw-r--r--inc/builder/type/header/account/class-astra-header-account-component.php151
-rw-r--r--inc/builder/type/header/account/dynamic-css/dynamic.css.php149
5 files changed, 494 insertions, 0 deletions
diff --git a/inc/builder/type/header/account/assets/js/minified/customizer-preview.min.js b/inc/builder/type/header/account/assets/js/minified/customizer-preview.min.js
new file mode 100644
index 0000000..2088bcb
--- /dev/null
+++ b/inc/builder/type/header/account/assets/js/minified/customizer-preview.min.js
@@ -0,0 +1 @@
+!function(){var o=astraBuilderPreview.tablet_break_point||768,i=astraBuilderPreview.mobile_break_point||544,e=".ast-header-account-wrap";wp.customize("astra-settings[header-account-icon-color]",function(t){t.bind(function(t){var a=e+" .ast-header-account-type-icon .ahfb-svg-iconset svg path:not( .ast-hf-account-unfill ), "+e+" .ast-header-account-type-icon .ahfb-svg-iconset svg circle, .ast-mobile-popup-content"+e+" .ast-header-account-type-icon .ahfb-svg-iconset svg path:not( .ast-hf-account-unfill ), .ast-mobile-popup-content "+e+" .ast-header-account-type-icon .ahfb-svg-iconset svg circle {";a+="fill: "+(t=t||"inherit")+";",a+="} ",astra_add_dynamic_css("header-account-icon-color",a)})}),astra_responsive_font_size("astra-settings[font-size-section-header-account]",e+" .ast-header-account-text"),astra_css("astra-settings[header-account-type-text-color]","color",e+" .ast-header-account-text, .ast-mobile-popup-content "+e+" .ast-header-account-text"),wp.customize("astra-settings[header-account-icon-size]",function(t){t.bind(function(t){var a;""==t.desktop&&""==t.tablet&&""==t.mobile||(a="",a+=e+" .ast-header-account-type-icon .ahfb-svg-iconset svg {",a+="height: "+t.desktop+"px;",a+="width: "+t.desktop+"px;",a+="} ",a+="@media (max-width: "+o+"px) {",a+=e+" .ast-header-account-type-icon .ahfb-svg-iconset svg {",a+="height: "+t.tablet+"px;",a+="width: "+t.tablet+"px;",a+="} ",a+="} ",a+="@media (max-width: "+i+"px) {",a+=e+" .ast-header-account-type-icon .ahfb-svg-iconset svg {",a+="height: "+t.mobile+"px;",a+="width: "+t.mobile+"px;",a+="} ",a+="} ",astra_add_dynamic_css("header-account-icon-size",a))})}),wp.customize("astra-settings[header-account-image-width]",function(t){t.bind(function(t){var a;""==t.desktop&&""==t.tablet&&""==t.mobile||(a="",a+=e+" .ast-header-account-type-avatar .avatar {",a+="width: "+t.desktop+"px;",a+="} ",a+="@media (max-width: "+o+"px) {",a+=e+" .ast-header-account-type-avatar .avatar {",a+="width: "+t.tablet+"px;",a+="} ",a+="} ",a+="@media (max-width: "+i+"px) {",a+=e+" .ast-header-account-type-avatar .avatar {",a+="width: "+t.mobile+"px;",a+="} ",a+="} ",astra_add_dynamic_css("header-account-image-width",a))})}),wp.customize("astra-settings[header-account-margin]",function(t){t.bind(function(t){var a,e;""==t.desktop.bottom&&""==t.desktop.top&&""==t.desktop.left&&""==t.desktop.right&&""==t.tablet.bottom&&""==t.tablet.top&&""==t.tablet.left&&""==t.tablet.right&&""==t.mobile.bottom&&""==t.mobile.top&&""==t.mobile.left&&""==t.mobile.right||(e="",e+=(a=".ast-header-account-wrap")+" {",e+="margin-left: "+t.desktop.left+t["desktop-unit"]+";",e+="margin-right: "+t.desktop.right+t["desktop-unit"]+";",e+="margin-top: "+t.desktop.top+t["desktop-unit"]+";",e+="margin-bottom: "+t.desktop.bottom+t["desktop-unit"]+";",e+="} ",e+="@media (max-width: "+o+"px) {",e+=a+" {",e+="margin-left: "+t.tablet.left+t["tablet-unit"]+";",e+="margin-right: "+t.tablet.right+t["tablet-unit"]+";",e+="margin-top: "+t.tablet.top+t["desktop-unit"]+";",e+="margin-bottom: "+t.tablet.bottom+t["desktop-unit"]+";",e+="} ",e+="} ",e+="@media (max-width: "+i+"px) {",e+=a+" {",e+="margin-left: "+t.mobile.left+t["mobile-unit"]+";",e+="margin-right: "+t.mobile.right+t["mobile-unit"]+";",e+="margin-top: "+t.mobile.top+t["desktop-unit"]+";",e+="margin-bottom: "+t.mobile.bottom+t["desktop-unit"]+";",e+="} ",e+="} ",astra_add_dynamic_css("header-account-margin",e))})}),astra_builder_visibility_css("section-header-account",'.ast-header-account[data-section="section-header-account"]')}(jQuery); \ No newline at end of file
diff --git a/inc/builder/type/header/account/assets/js/unminified/customizer-preview.js b/inc/builder/type/header/account/assets/js/unminified/customizer-preview.js
new file mode 100644
index 0000000..8bafe1f
--- /dev/null
+++ b/inc/builder/type/header/account/assets/js/unminified/customizer-preview.js
@@ -0,0 +1,140 @@
+/**
+ * This file adds some LIVE to the Customizer live preview. To leverage
+ * this, set your custom settings to 'postMessage' and then add your handling
+ * here. Your javascript should grab settings from customizer controls, and
+ * then make any necessary changes to the page using jQuery.
+ *
+ * @package Astra
+ * @since x.x.x
+ */
+
+( function( $ ) {
+
+ var tablet_break_point = astraBuilderPreview.tablet_break_point || 768,
+ mobile_break_point = astraBuilderPreview.mobile_break_point || 544;
+
+ var selector = '.ast-header-account-wrap';
+ var section = 'section-header-account';
+ var visibility_selector = '.ast-header-account[data-section="section-header-account"]';
+
+ wp.customize( 'astra-settings[header-account-icon-color]', function( value ) {
+ value.bind( function( color ) {
+ if( ! color ) {
+ color = 'inherit';
+ }
+ var dynamicStyle = selector + ' .ast-header-account-type-icon .ahfb-svg-iconset svg path:not( .ast-hf-account-unfill ), ' + selector + ' .ast-header-account-type-icon .ahfb-svg-iconset svg circle, .ast-mobile-popup-content' + selector + ' .ast-header-account-type-icon .ahfb-svg-iconset svg path:not( .ast-hf-account-unfill ), .ast-mobile-popup-content ' + selector + ' .ast-header-account-type-icon .ahfb-svg-iconset svg circle {';
+ dynamicStyle += 'fill: ' + color + ';';
+ dynamicStyle += '} ';
+ astra_add_dynamic_css( 'header-account-icon-color', dynamicStyle );
+ } );
+ } );
+
+ // Typography CSS Generation.
+ astra_responsive_font_size(
+ 'astra-settings[font-size-section-header-account]',
+ selector + ' .ast-header-account-text'
+ );
+
+ // Text size.
+ astra_css(
+ 'astra-settings[header-account-type-text-color]',
+ 'color',
+ selector + ' .ast-header-account-text, .ast-mobile-popup-content ' + selector + ' .ast-header-account-text'
+ );
+
+ // Icon Size.
+ wp.customize( 'astra-settings[header-account-icon-size]', function( value ) {
+ value.bind( function( size ) {
+ if( size.desktop != '' || size.tablet != '' || size.mobile != '' ) {
+ var dynamicStyle = '';
+ dynamicStyle += selector + ' .ast-header-account-type-icon .ahfb-svg-iconset svg {';
+ dynamicStyle += 'height: ' + size.desktop + 'px' + ';';
+ dynamicStyle += 'width: ' + size.desktop + 'px' + ';';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {';
+ dynamicStyle += selector + ' .ast-header-account-type-icon .ahfb-svg-iconset svg {';
+ dynamicStyle += 'height: ' + size.tablet + 'px' + ';';
+ dynamicStyle += 'width: ' + size.tablet + 'px' + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {';
+ dynamicStyle += selector + ' .ast-header-account-type-icon .ahfb-svg-iconset svg {';
+ dynamicStyle += 'height: ' + size.mobile + 'px' + ';';
+ dynamicStyle += 'width: ' + size.mobile + 'px' + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+ astra_add_dynamic_css( 'header-account-icon-size', dynamicStyle );
+ }
+ } );
+ } );
+
+ // Image Width.
+ wp.customize( 'astra-settings[header-account-image-width]', function( value ) {
+ value.bind( function( size ) {
+ if( size.desktop != '' || size.tablet != '' || size.mobile != '' ) {
+ var dynamicStyle = '';
+ dynamicStyle += selector + ' .ast-header-account-type-avatar .avatar {';
+ dynamicStyle += 'width: ' + size.desktop + 'px' + ';';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {';
+ dynamicStyle += selector + ' .ast-header-account-type-avatar .avatar {';
+ dynamicStyle += 'width: ' + size.tablet + 'px' + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {';
+ dynamicStyle += selector + ' .ast-header-account-type-avatar .avatar {';
+ dynamicStyle += 'width: ' + size.mobile + 'px' + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+ astra_add_dynamic_css( 'header-account-image-width', dynamicStyle );
+ }
+ } );
+ } );
+
+ // Margin.
+ wp.customize( 'astra-settings[header-account-margin]', function( value ) {
+ value.bind( function( margin ) {
+ if(
+ margin.desktop.bottom != '' || margin.desktop.top != '' || margin.desktop.left != '' || margin.desktop.right != '' ||
+ margin.tablet.bottom != '' || margin.tablet.top != '' || margin.tablet.left != '' || margin.tablet.right != '' ||
+ margin.mobile.bottom != '' || margin.mobile.top != '' || margin.mobile.left != '' || margin.mobile.right != ''
+ ) {
+ var selector = '.ast-header-account-wrap';
+ var dynamicStyle = '';
+ dynamicStyle += selector + ' {';
+ dynamicStyle += 'margin-left: ' + margin['desktop']['left'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-right: ' + margin['desktop']['right'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-top: ' + margin['desktop']['top'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-bottom: ' + margin['desktop']['bottom'] + margin['desktop-unit'] + ';';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {';
+ dynamicStyle += selector + ' {';
+ dynamicStyle += 'margin-left: ' + margin['tablet']['left'] + margin['tablet-unit'] + ';';
+ dynamicStyle += 'margin-right: ' + margin['tablet']['right'] + margin['tablet-unit'] + ';';
+ dynamicStyle += 'margin-top: ' + margin['tablet']['top'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-bottom: ' + margin['tablet']['bottom'] + margin['desktop-unit'] + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {';
+ dynamicStyle += selector + ' {';
+ dynamicStyle += 'margin-left: ' + margin['mobile']['left'] + margin['mobile-unit'] + ';';
+ dynamicStyle += 'margin-right: ' + margin['mobile']['right'] + margin['mobile-unit'] + ';';
+ dynamicStyle += 'margin-top: ' + margin['mobile']['top'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-bottom: ' + margin['mobile']['bottom'] + margin['desktop-unit'] + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+ astra_add_dynamic_css( 'header-account-margin', dynamicStyle );
+ }
+ } );
+ } );
+
+ // Advanced Visibility CSS Generation.
+ astra_builder_visibility_css( section, visibility_selector );
+
+} )( jQuery );
diff --git a/inc/builder/type/header/account/class-astra-header-account-component-loader.php b/inc/builder/type/header/account/class-astra-header-account-component-loader.php
new file mode 100644
index 0000000..edbbbd5
--- /dev/null
+++ b/inc/builder/type/header/account/class-astra-header-account-component-loader.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Account Styling Loader for Astra theme.
+ *
+ * @package astra-builder
+ * @author Astra
+ * @copyright Copyright (c) 2020, Astra
+ * @link https://wpastra.com/
+ * @since 3.0.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+/**
+ * Customizer Initialization
+ *
+ * @since 3.0.0
+ */
+class Astra_Header_Account_Component_Loader {
+
+ /**
+ * Constructor
+ *
+ * @since 3.0.0
+ */
+ public function __construct() {
+
+ add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 );
+ }
+
+ /**
+ * Customizer Preview
+ *
+ * @since 3.0.0
+ */
+ public function preview_scripts() {
+ /**
+ * Load unminified if SCRIPT_DEBUG is true.
+ */
+ /* Directory and Extension */
+ $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
+ $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min';
+ wp_enqueue_script( 'astra-header-builder-account-customizer-preview-js', ASTRA_HEADER_ACCOUNT_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true );
+
+ }
+}
+
+/**
+* Kicking this off by creating the object of the class.
+*/
+new Astra_Header_Account_Component_Loader();
diff --git a/inc/builder/type/header/account/class-astra-header-account-component.php b/inc/builder/type/header/account/class-astra-header-account-component.php
new file mode 100644
index 0000000..b56b58b
--- /dev/null
+++ b/inc/builder/type/header/account/class-astra-header-account-component.php
@@ -0,0 +1,151 @@
+<?php
+/**
+ * Account for Astra theme.
+ *
+ * @package astra-builder
+ * @author Astra
+ * @copyright Copyright (c) 2020, Astra
+ * @link https://wpastra.com/
+ * @since 3.0.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+define( 'ASTRA_HEADER_ACCOUNT_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/account' );
+define( 'ASTRA_HEADER_ACCOUNT_URI', ASTRA_THEME_URI . 'inc/builder/type/header/account' );
+
+if ( ! class_exists( 'Astra_Header_Account_Component' ) ) {
+
+ /**
+ * Heading Initial Setup
+ *
+ * @since 3.0.0
+ */
+ class Astra_Header_Account_Component {
+
+ /**
+ * Constructor function that initializes required actions and hooks
+ */
+ public function __construct() {
+
+ // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
+ require_once ASTRA_HEADER_ACCOUNT_DIR . '/class-astra-header-account-component-loader.php';
+
+ // Include front end files.
+ if ( ! is_admin() ) {
+ require_once ASTRA_HEADER_ACCOUNT_DIR . '/dynamic-css/dynamic.css.php';
+ }
+ // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
+ }
+
+ /**
+ * Account navigation markup
+ */
+ public static function account_menu_markup() {
+
+ $theme_location = 'loggedin_account_menu';
+ $account_type = astra_get_option( 'header-account-type' );
+ $enable_woo_menu = ( 'woocommerce' === $account_type && astra_get_option( 'header-account-woo-menu' ) );
+
+ /**
+ * Filter the classes(array) for Menu (<ul>).
+ *
+ * @since 3.0.0
+ * @var Array
+ */
+ $menu_classes = apply_filters( 'astra_menu_classes', array( 'main-header-menu', 'ast-nav-menu', 'ast-account-nav-menu' ) );
+
+ $items_wrap = '<nav ';
+ $items_wrap .= astra_attr(
+ 'site-navigation',
+ array(
+ 'id' => 'site-navigation',
+ 'class' => 'ast-flex-grow-1 navigation-accessibility site-header-focus-item',
+ 'aria-label' => esc_attr__( 'Site Navigation', 'astra' ),
+ )
+ );
+ $items_wrap .= '>';
+ $items_wrap .= '<div class="account-main-navigation">';
+ $items_wrap .= '<ul id="%1$s" class="%2$s">%3$s</ul>';
+ $items_wrap .= '</div>';
+ $items_wrap .= '</nav>';
+
+ // Fallback Menu if primary menu not set.
+ $fallback_menu_args = array(
+ 'theme_location' => $theme_location,
+ 'menu_id' => 'ast-hf-account-menu',
+ 'menu_class' => 'account-main-navigation',
+ 'container' => 'div',
+ 'before' => '<ul class="' . esc_attr( implode( ' ', $menu_classes ) ) . '">',
+ 'after' => '</ul>',
+ 'walker' => new Astra_Walker_Page(),
+ );
+
+ // To add default alignment for navigation which can be added through any third party plugin.
+ // Do not add any CSS from theme except header alignment.
+ echo '<div class="ast-hf-account-menu-wrap ast-main-header-bar-alignment">';
+
+ if ( has_nav_menu( $theme_location ) && ! $enable_woo_menu ) {
+ wp_nav_menu(
+ array(
+ 'menu_id' => 'ast-hf-account-menu',
+ 'menu_class' => esc_attr( implode( ' ', $menu_classes ) ),
+ 'container' => 'div',
+ 'container_class' => 'account-main-header-bar-navigation',
+ 'items_wrap' => $items_wrap,
+ 'theme_location' => $theme_location,
+ )
+ );
+ } elseif ( $enable_woo_menu ) {
+ echo '<div class="ast-hf-account-menu-wrap ast-main-header-bar-alignment">';
+ echo '<div class="account-main-header-bar-navigation">';
+ echo '<nav ';
+ echo astra_attr(
+ 'account-woo-navigation',
+ array(
+ 'id' => 'account-woo-navigation',
+ )
+ );
+ echo ' class="ast-flex-grow-1 navigation-accessibility site-header-focus-item" aria-label="' . esc_attr__( 'Account Woo Navigation', 'astra' ) . '">';
+ if ( class_exists( 'woocommerce' ) ) {
+ ?>
+ <ul id="ast-hf-account-menu" class="main-header-menu ast-nav-menu ast-account-nav-menu ast-header-account-woocommerce-menu">
+ <?php foreach ( wc_get_account_menu_items() as $endpoint => $item ) { ?>
+ <li class="menu-item <?php echo esc_attr( wc_get_account_menu_item_classes( $endpoint ) ); ?>">
+ <a href="<?php echo esc_url( wc_get_account_endpoint_url( $endpoint ) ); ?>" class="menu-link"><?php echo esc_html( $item ); ?></a>
+ </li>
+ <?php } ?>
+ </ul>
+ <?php
+ }
+ echo '</nav>';
+ echo '</div>';
+ echo '</div>';
+ } else {
+ echo '<div class="ast-hf-account-menu-wrap ast-main-header-bar-alignment">';
+ echo '<div class="account-main-header-bar-navigation">';
+ echo '<nav ';
+ echo astra_attr(
+ 'site-navigation',
+ array(
+ 'id' => 'site-navigation',
+ )
+ );
+ echo ' class="ast-flex-grow-1 navigation-accessibility" aria-label="' . esc_attr__( 'Site Navigation', 'astra' ) . '">';
+ wp_page_menu( $fallback_menu_args );
+ echo '</nav>';
+ echo '</div>';
+ echo '</div>';
+ }
+ echo '</div>';
+ }
+ }
+
+ /**
+ * Kicking this off by creating an object.
+ */
+ new Astra_Header_Account_Component();
+
+}
diff --git a/inc/builder/type/header/account/dynamic-css/dynamic.css.php b/inc/builder/type/header/account/dynamic-css/dynamic.css.php
new file mode 100644
index 0000000..9e9458e
--- /dev/null
+++ b/inc/builder/type/header/account/dynamic-css/dynamic.css.php
@@ -0,0 +1,149 @@
+<?php
+/**
+ * Account - Dynamic CSS
+ *
+ * @package Astra
+ * @since 3.0.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+/**
+ * Account
+ */
+add_filter( 'astra_dynamic_theme_css', 'astra_hb_account_dynamic_css' );
+
+/**
+ * Dynamic CSS
+ *
+ * @param string $dynamic_css Astra Dynamic CSS.
+ * @param string $dynamic_css_filtered Astra Dynamic CSS Filters.
+ * @return String Generated dynamic CSS for Account.
+ *
+ * @since 3.0.0
+ */
+function astra_hb_account_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {
+
+ if ( ! Astra_Builder_Helper::is_component_loaded( 'account', 'header' ) ) {
+ return $dynamic_css;
+ }
+
+ $_section = 'section-header-account';
+ $selector = '.ast-header-account-wrap';
+
+ $icon_size = astra_get_option( 'header-account-icon-size' );
+
+ $icon_size_desktop = ( isset( $icon_size ) && isset( $icon_size['desktop'] ) && ! empty( $icon_size['desktop'] ) ) ? $icon_size['desktop'] : 20;
+
+ $icon_size_tablet = ( isset( $icon_size ) && isset( $icon_size['tablet'] ) && ! empty( $icon_size['tablet'] ) ) ? $icon_size['tablet'] : 20;
+
+ $icon_size_mobile = ( isset( $icon_size ) && isset( $icon_size['mobile'] ) && ! empty( $icon_size['mobile'] ) ) ? $icon_size['mobile'] : 20;
+
+ $image_width = astra_get_option( 'header-account-image-width' );
+
+ $image_width_desktop = ( isset( $image_width ) && isset( $image_width['desktop'] ) && ! empty( $image_width['desktop'] ) ) ? $image_width['desktop'] : 20;
+
+ $image_width_tablet = ( isset( $image_width ) && isset( $image_width['tablet'] ) && ! empty( $image_width['tablet'] ) ) ? $image_width['tablet'] : 20;
+
+ $image_width_mobile = ( isset( $image_width ) && isset( $image_width['mobile'] ) && ! empty( $image_width['mobile'] ) ) ? $image_width['mobile'] : 20;
+
+ $margin = astra_get_option( 'header-account-margin' );
+ $margin_selector = '.ast-header-account-wrap';
+
+ /**
+ * Account CSS.
+ */
+ $css_output_desktop = array(
+ '.ast-header-account-type-icon' => array(
+ '-js-display' => 'inline-flex',
+ 'display' => 'inline-flex',
+ 'align-self' => 'center',
+ 'vertical-align' => 'middle',
+ ),
+ '.ast-header-account-type-avatar .avatar' => array(
+ 'display' => 'inline',
+ 'border-radius' => '100%',
+ 'max-width' => '100%',
+ ),
+ '.as.site-header-focus-item.ast-header-account:hover > .customize-partial-edit-shortcut' => array(
+ 'opacity' => '0',
+ ),
+ '.site-header-focus-item.ast-header-account:hover > * > .customize-partial-edit-shortcut' => array(
+ 'opacity' => '1',
+ ),
+ $selector . ' .ast-header-account-type-icon .ahfb-svg-iconset svg path:not( .ast-hf-account-unfill ), ' . $selector . ' .ast-header-account-type-icon .ahfb-svg-iconset svg circle' => array(
+ 'fill' => esc_attr( astra_get_option( 'header-account-icon-color' ) ),
+ ),
+ '.ast-mobile-popup-content ' . $selector . ' .ast-header-account-type-icon .ahfb-svg-iconset svg path:not( .ast-hf-account-unfill ), .ast-mobile-popup-content ' . $selector . ' .ast-header-account-type-icon .ahfb-svg-iconset svg circle' => array(
+ 'fill' => esc_attr( astra_get_option( 'header-account-icon-color' ) ),
+ ),
+ $selector . ' .ast-header-account-type-icon .ahfb-svg-iconset svg' => array(
+ 'height' => astra_get_css_value( $icon_size_desktop, 'px' ),
+ 'width' => astra_get_css_value( $icon_size_desktop, 'px' ),
+ ),
+ $selector . ' .ast-header-account-type-avatar .avatar' => array(
+ 'width' => astra_get_css_value( $image_width_desktop, 'px' ),
+ ),
+ $selector . ' .ast-header-account-text' => array(
+ 'color' => esc_attr( astra_get_option( 'header-account-type-text-color' ) ),
+ ),
+ $margin_selector => array(
+ // Margin CSS.
+ 'margin-top' => astra_responsive_spacing( $margin, 'top', 'desktop' ),
+ 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'desktop' ),
+ 'margin-left' => astra_responsive_spacing( $margin, 'left', 'desktop' ),
+ 'margin-right' => astra_responsive_spacing( $margin, 'right', 'desktop' ),
+ ),
+ );
+
+ $css_output_tablet = array(
+
+ $selector . ' .ast-header-account-type-icon .ahfb-svg-iconset svg' => array(
+ 'height' => astra_get_css_value( $icon_size_tablet, 'px' ),
+ 'width' => astra_get_css_value( $icon_size_tablet, 'px' ),
+ ),
+ $selector . ' .ast-header-account-type-avatar .avatar' => array(
+ 'width' => astra_get_css_value( $image_width_tablet, 'px' ),
+ ),
+ $margin_selector => array(
+ // Margin CSS.
+ 'margin-top' => astra_responsive_spacing( $margin, 'top', 'tablet' ),
+ 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'tablet' ),
+ 'margin-left' => astra_responsive_spacing( $margin, 'left', 'tablet' ),
+ 'margin-right' => astra_responsive_spacing( $margin, 'right', 'tablet' ),
+ ),
+ );
+
+ $css_output_mobile = array(
+
+ $selector . ' .ast-header-account-type-icon .ahfb-svg-iconset svg' => array(
+ 'height' => astra_get_css_value( $icon_size_mobile, 'px' ),
+ 'width' => astra_get_css_value( $icon_size_mobile, 'px' ),
+ ),
+ $selector . ' .ast-header-account-type-avatar .avatar' => array(
+ 'width' => astra_get_css_value( $image_width_mobile, 'px' ),
+ ),
+ $margin_selector => array(
+ // Margin CSS.
+ 'margin-top' => astra_responsive_spacing( $margin, 'top', 'mobile' ),
+ 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'mobile' ),
+ 'margin-left' => astra_responsive_spacing( $margin, 'left', 'mobile' ),
+ 'margin-right' => astra_responsive_spacing( $margin, 'right', 'mobile' ),
+ ),
+ );
+
+ /* Parse CSS from array() */
+ $css_output = astra_parse_css( $css_output_desktop );
+ $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() );
+ $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() );
+
+ $dynamic_css .= $css_output;
+
+ $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_advanced_typography_css( $_section, $selector . ' .ast-header-account-text' );
+
+ $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( $_section, $selector );
+
+ return $dynamic_css;
+}