Initial commit: Atomaste website

This commit is contained in:
2025-12-10 12:17:30 -05:00
commit 0b9e5d1605
19260 changed files with 5206382 additions and 0 deletions

View File

@@ -0,0 +1,118 @@
/**
* 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 1.7.0
*/
( function( $ ) {
/* Breadcrumb Typography */
astra_responsive_font_size(
'astra-settings[breadcrumb-font-size]',
'.ast-breadcrumbs-wrapper .trail-items span, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator, .ast-breadcrumbs-wrapper .breadcrumb-item, .ast-breadcrumbs-wrapper .breadcrumb-item.active, .ast-breadcrumbs-wrapper .breadcrumb-item:after, .ast-breadcrumbs-inner nav, .ast-breadcrumbs-inner nav .breadcrumb-item, .ast-breadcrumbs-inner nav .breadcrumb-item:after'
);
astra_generate_outside_font_family_css(
'astra-settings[breadcrumb-font-family]',
'.ast-breadcrumbs-wrapper .trail-items span, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator, .ast-breadcrumbs-wrapper .breadcrumb-item, .ast-breadcrumbs-wrapper .breadcrumb-item.active, .ast-breadcrumbs-wrapper .breadcrumb-item:after, .ast-breadcrumbs-inner nav, .ast-breadcrumbs-inner nav .breadcrumb-item, .ast-breadcrumbs-inner nav .breadcrumb-item:after'
);
astra_generate_font_weight_css( 'astra-settings[breadcrumb-font-family]', 'astra-settings[breadcrumb-font-weight]', 'font-weight', '.ast-breadcrumbs-wrapper .trail-items span, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator, .ast-breadcrumbs-wrapper .breadcrumb-item, .ast-breadcrumbs-wrapper .breadcrumb-item.active, .ast-breadcrumbs-wrapper .breadcrumb-item:after, .ast-breadcrumbs-inner nav, .ast-breadcrumbs-inner nav .breadcrumb-item, .ast-breadcrumbs-inner nav .breadcrumb-item:after' );
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Line Height */
astra_font_extras_css( 'breadcrumb-font-extras', '.ast-breadcrumbs-wrapper .ast-breadcrumbs-name, .ast-breadcrumbs-wrapper .ast-breadcrumbs-item, .ast-breadcrumbs-wrapper .ast-breadcrumbs .separator, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator, .ast-breadcrumbs-wrapper .breadcrumb-item, .ast-breadcrumbs-wrapper .breadcrumb-item.active, .ast-breadcrumbs-wrapper .breadcrumb-item:after, .ast-breadcrumbs-inner nav, .ast-breadcrumbs-inner nav .breadcrumb-item, .ast-breadcrumbs-inner nav .breadcrumb-item:after' );
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Text Color */
astra_color_responsive_css(
'breadcrumb',
'astra-settings[breadcrumb-active-color-responsive]',
'color',
'.ast-breadcrumbs-wrapper .trail-items .trail-end, .ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast .breadcrumb_last, .ast-breadcrumbs-wrapper .current-item, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-inner, .ast-breadcrumbs-wrapper .breadcrumb-item.active'
);
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Link Color */
astra_color_responsive_css(
'breadcrumb',
'astra-settings[breadcrumb-text-color-responsive]',
'color',
'.ast-breadcrumbs-wrapper .trail-items a, .ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast a, .ast-breadcrumbs-wrapper .breadcrumbs a, .ast-breadcrumbs-wrapper .rank-math-breadcrumb a, .ast-breadcrumbs-wrapper .breadcrumb-item a'
);
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Hover Color */
astra_color_responsive_css(
'breadcrumb',
'astra-settings[breadcrumb-hover-color-responsive]',
'color',
'.ast-breadcrumbs-wrapper .trail-items a:hover, .ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast a:hover, .ast-breadcrumbs-wrapper .breadcrumbs a:hover, .ast-breadcrumbs-wrapper .rank-math-breadcrumb a:hover, .ast-breadcrumbs-wrapper .breadcrumb-item a:hover'
);
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Separator Color */
astra_color_responsive_css(
'breadcrumb',
'astra-settings[breadcrumb-separator-color]',
'color',
'.ast-breadcrumbs-wrapper .trail-items li::after, .ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb .separator, .ast-breadcrumbs-wrapper .breadcrumb-item:after'
);
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Background Color */
astra_color_responsive_css(
'breadcrumb',
'astra-settings[breadcrumb-bg-color]',
'background-color',
'.ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb, .ast-primary-sticky-header-active .main-header-bar.ast-header-breadcrumb'
);
/* Breadcrumb default, Yoast SEO Breadcrumb, Breadcrumb NavXT, Ran Math Breadcrumb, SEOPress Breadcrumb - Alignment */
astra_css(
'astra-settings[breadcrumb-alignment]',
'text-align',
'.ast-breadcrumbs-wrapper'
);
/**
* Breadcrumb Spacing
*/
wp.customize( 'astra-settings[breadcrumb-spacing]', function( value ) {
value.bind( function( padding ) {
var spacing_value = wp.customize( 'astra-settings[breadcrumb-position]' ).get();
if( 'astra_header_markup_after' == spacing_value || 'astra_header_after' == spacing_value ) {
astra_responsive_spacing( 'astra-settings[breadcrumb-spacing]','.main-header-bar.ast-header-breadcrumb', 'padding', ['top', 'right', 'bottom', 'left' ] );
} else if( 'astra_masthead_content' == spacing_value ) {
astra_responsive_spacing( 'astra-settings[breadcrumb-spacing]','.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .ast-breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner', 'padding', ['top', 'right', 'bottom', 'left' ] );
} else {
astra_responsive_spacing( 'astra-settings[breadcrumb-spacing]','.ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb, .ast-breadcrumbs-wrapper .ast-breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner', 'padding', ['top', 'right', 'bottom', 'left' ] );
}
} );
} );
/**
* Breadcrumb Separator.
*/
wp.customize( 'astra-settings[breadcrumb-separator-selector]', function( value ) {
value.bind( function( value ) {
const customBreadcrumbValue = wp.customize.value( 'astra-settings[breadcrumb-separator]' )();
const currentSelectedSeparator = 'unicode' !== value ? value : customBreadcrumbValue;
let dynamicStyle = '';
dynamicStyle += '.trail-items li::after {';
dynamicStyle += 'content: "' + currentSelectedSeparator + '";';
dynamicStyle += '} ';
astra_add_dynamic_css( 'breadcrumb-separator-selector', dynamicStyle );
} );
} );
wp.customize( 'astra-settings[breadcrumb-separator]', function( value ) {
value.bind( function( value ) {
let dynamicStyle = '';
dynamicStyle += '.trail-items li::after {';
dynamicStyle += 'content: "' + value + '";';
dynamicStyle += '} ';
astra_add_dynamic_css( 'breadcrumb-separator', dynamicStyle );
} );
} );
} )( jQuery );

View File

@@ -0,0 +1,197 @@
<?php
/**
* Breadcrumbs Loader for Astra theme.
*
* @package Astra
* @link https://www.brainstormforce.com
* @since Astra 1.7.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( ! class_exists( 'Astra_Breadcrumbs_Loader' ) ) {
/**
* Customizer Initialization
*
* @since 1.7.0
*/
class Astra_Breadcrumbs_Loader {
/**
* Member Variable
*
* @var object instance
*/
private static $instance;
/**
* Initiator
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor
*/
public function __construct() {
add_filter( 'astra_theme_defaults', array( $this, 'theme_defaults' ) );
add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 );
add_action( 'customize_register', array( $this, 'customize_register' ), 2 );
// Load Google fonts.
add_action( 'astra_get_fonts', array( $this, 'add_fonts' ), 1 );
}
/**
* Enqueue google fonts.
*
* @return void
*/
public function add_fonts() {
$breadcrumb_font_family = astra_get_option( 'breadcrumb-font-family' );
$breadcrumb_font_weight = astra_get_option( 'breadcrumb-font-weight' );
Astra_Fonts::add_font( $breadcrumb_font_family, $breadcrumb_font_weight );
}
/**
* Set Options Default Values
*
* @param array $defaults Astra options default value array.
* @return array
*/
public function theme_defaults( $defaults ) {
$astra_options = Astra_Theme_Options::get_astra_options();
/**
* Breadcrumb Responsive Colors
*/
$defaults['breadcrumb-text-color-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['breadcrumb-active-color-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['breadcrumb-hover-color-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['breadcrumb-separator-color'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['breadcrumb-bg-color'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['breadcrumb-spacing'] = array(
'desktop' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'tablet' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'mobile' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
);
/**
* Breadcrumb Font Defaults
*/
$defaults['breadcrumb-font-family'] = 'inherit';
$defaults['breadcrumb-font-weight'] = 'inherit';
$defaults['breadcrumb-font-size'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
);
$defaults['breadcrumb-font-extras'] = array(
'line-height' => ! isset( $astra_options['breadcrumb-font-extras'] ) && isset( $astra_options['breadcrumb-line-height'] ) ? $astra_options['breadcrumb-line-height'] : '',
'line-height-unit' => 'em',
'letter-spacing' => '',
'letter-spacing-unit' => 'px',
'text-transform' => ! isset( $astra_options['breadcrumb-font-extras'] ) && isset( $astra_options['breadcrumb-text-transform'] ) ? $astra_options['breadcrumb-text-transform'] : '',
'text-decoration' => '',
);
/**
* Breadcrumb Separator defaults
*/
$defaults['breadcrumb-separator-selector'] = '\003E';
$defaults['breadcrumb-separator'] = '\00bb';
return $defaults;
}
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
public function customize_register( $wp_customize ) {
/**
* Register Panel & Sections
*/
// @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
require_once ASTRA_THEME_BREADCRUMBS_DIR . 'customizer/class-astra-breadcrumbs-configs.php';
require_once ASTRA_THEME_BREADCRUMBS_DIR . 'customizer/class-astra-breadcrumbs-color-configs.php';
require_once ASTRA_THEME_BREADCRUMBS_DIR . 'customizer/class-astra-breadcrumbs-typo-configs.php';
// @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
}
/**
* Customizer Preview
*/
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-breadcrumbs-customizer-preview-js', ASTRA_THEME_BREADCRUMBS_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 calling 'get_instance()' method
*/
Astra_Breadcrumbs_Loader::get_instance();

View File

@@ -0,0 +1,155 @@
<?php
/**
* Breadcrumbs for Astra theme.
*
* @package Astra
* @link https://www.brainstormforce.com
* @since Astra 1.8.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( ! class_exists( 'Astra_Breadcrumbs_Markup' ) ) {
/**
* Breadcrumbs Markup Initial Setup
*
* @since 1.8.0
*/
class Astra_Breadcrumbs_Markup {
/**
* Member Variable
*
* @var object instance
*/
private static $instance;
/**
* Initiator
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor
*/
public function __construct() {
add_action( 'wp', array( $this, 'astra_breadcumb_template' ) );
}
/**
* Astra Breadcrumbs Template
*
* Loads template based on the style option selected in options panel for Breadcrumbs.
*
* @since 1.8.0
*
* @return void
*/
public function astra_breadcumb_template() {
$breadcrumb_position = astra_get_option( 'breadcrumb-position' );
$breadcrumb_enabled = false;
if ( is_singular() ) {
$breadcrumb_enabled = get_post_meta( get_the_ID(), 'ast-breadcrumbs-content', true );
}
if ( 'disabled' !== $breadcrumb_enabled && $breadcrumb_position && 'none' !== $breadcrumb_position && ! ( ( is_home() || is_front_page() ) && ( 'astra_entry_top' === $breadcrumb_position ) ) ) {
if ( self::astra_breadcrumb_rules() ) {
if ( ( is_archive() || is_search() ) && 'astra_entry_top' === $breadcrumb_position ) {
add_action( 'astra_before_archive_title', array( $this, 'astra_hook_breadcrumb_position' ), 15 );
} else {
add_action( $breadcrumb_position, array( $this, 'astra_hook_breadcrumb_position' ), 15 );
}
}
}
}
/**
* Astra Hook Breadcrumb Position
*
* Hook breadcrumb to position of selected option
*
* @since 1.8.0
*
* @return void
*/
public function astra_hook_breadcrumb_position() {
$breadcrumb_position = astra_get_option( 'breadcrumb-position' );
if ( $breadcrumb_position && ( 'astra_header_markup_after' === $breadcrumb_position || 'astra_header_after' === $breadcrumb_position ) ) {
echo '<div class="main-header-bar ast-header-breadcrumb">
<div class="ast-container">';
}
astra_get_breadcrumb();
if ( $breadcrumb_position && ( 'astra_header_markup_after' === $breadcrumb_position || 'astra_header_after' === $breadcrumb_position ) ) {
echo ' </div>
</div>';
}
}
/**
* Astra Breadcrumbs Rules
*
* Checks the rules defined for displaying Breadcrumb on different pages.
*
* @since 1.8.0
*
* @return boolean
*/
public static function astra_breadcrumb_rules() {
// Display Breadcrumb default true.
$display_breadcrumb = true;
if ( is_front_page() && '0' == astra_get_option( 'breadcrumb-disable-home-page' ) ) {
$display_breadcrumb = false;
}
if ( is_home() && '0' == astra_get_option( 'breadcrumb-disable-blog-posts-page' ) ) {
$display_breadcrumb = false;
}
if ( is_search() && '0' == astra_get_option( 'breadcrumb-disable-search' ) ) {
$display_breadcrumb = false;
}
if ( ( is_archive() ) && '0' == astra_get_option( 'breadcrumb-disable-archive' ) ) {
$display_breadcrumb = false;
}
if ( is_page() && '0' == astra_get_option( 'breadcrumb-disable-single-page' ) ) {
$display_breadcrumb = false;
}
if ( is_single() && '0' == astra_get_option( 'breadcrumb-disable-single-post' ) ) {
$display_breadcrumb = false;
}
if ( is_singular() && '0' == astra_get_option( 'breadcrumb-disable-singular' ) ) {
$display_breadcrumb = false;
}
if ( is_404() && '0' == astra_get_option( 'breadcrumb-disable-404-page' ) ) {
$display_breadcrumb = false;
}
return apply_filters( 'astra_breadcrumb_enabled', $display_breadcrumb );
}
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
Astra_Breadcrumbs_Markup::get_instance();

View File

@@ -0,0 +1,107 @@
<?php
/**
* Breadcrumbs for Astra theme.
*
* @package Astra
* @link https://www.brainstormforce.com
* @since Astra 1.7.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
define( 'ASTRA_THEME_BREADCRUMBS_DIR', ASTRA_THEME_DIR . 'inc/addons/breadcrumbs/' );
define( 'ASTRA_THEME_BREADCRUMBS_URI', ASTRA_THEME_URI . 'inc/addons/breadcrumbs/' );
if ( ! class_exists( 'Astra_Breadcrumbs' ) ) {
/**
* Breadcrumbs Initial Setup
*
* @since 1.7.0
*/
class Astra_Breadcrumbs {
/**
* Member Variable
*
* @var object instance
*/
private static $instance;
/**
* Initiator
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor function that initializes required actions and hooks
*/
public function __construct() {
// @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
require_once ASTRA_THEME_BREADCRUMBS_DIR . 'class-astra-breadcrumbs-loader.php';
require_once ASTRA_THEME_BREADCRUMBS_DIR . 'class-astra-breadcrumbs-markup.php';
require_once ASTRA_THEME_BREADCRUMBS_DIR . 'class-astra-breadcrumb-trail.php';
// @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
// Third Party plugins in the breadcrumb options.
add_filter( 'astra_breadcrumb_source_list', array( $this, 'astra_breadcrumb_source_list_items' ) );
// Include front end files.
if ( ! is_admin() ) {
require_once ASTRA_THEME_BREADCRUMBS_DIR . 'dynamic-css/dynamic.css.php';// phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
}
}
/**
* Third Party Breadcrumb option
*
* @param Array $options breadcrumb options array.
*
* @return Array breadcrumb options array.
* @since 1.0.0
*/
public function astra_breadcrumb_source_list_items( $options ) {
$breadcrumb_enable = is_callable( 'WPSEO_Options::get' ) ? WPSEO_Options::get( 'breadcrumbs-enable' ) : false;
$wpseo_option = get_option( 'wpseo_internallinks' ) ? get_option( 'wpseo_internallinks' ) : $breadcrumb_enable;
if ( ! is_array( $wpseo_option ) ) {
unset( $wpseo_option );
$wpseo_option = array(
'breadcrumbs-enable' => $breadcrumb_enable,
);
}
if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] ) {
$options['yoast-seo-breadcrumbs'] = 'Yoast SEO Breadcrumbs';
}
if ( function_exists( 'bcn_display' ) ) {
$options['breadcrumb-navxt'] = 'Breadcrumb NavXT';
}
if ( function_exists( 'rank_math_the_breadcrumbs' ) ) {
$options['rank-math'] = 'Rank Math';
}
if ( function_exists( 'seopress_display_breadcrumbs' ) ) {
$options['seopress'] = 'SEOPress';
}
return $options;
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
Astra_Breadcrumbs::get_instance();
}

View File

@@ -0,0 +1,226 @@
<?php
/**
* Colors - Breadcrumbs Options for theme.
*
* @package Astra
* @link https://www.brainstormforce.com
* @since Astra 1.7.0
*/
// Block direct access to the file.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Bail if Customizer config base class does not exist.
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
return;
}
/**
* Customizer Sanitizes
*
* @since 1.7.0
*/
if ( ! class_exists( 'Astra_Breadcrumbs_Color_Configs' ) ) {
/**
* Register Colors and Background - Breadcrumbs Options Customizer Configurations.
*/
class Astra_Breadcrumbs_Color_Configs extends Astra_Customizer_Config_Base {
/**
* Register Colors and Background - Breadcrumbs Options Customizer Configurations.
*
* @param Array $configurations Astra Customizer Configurations.
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
* @since 1.7.0
* @return Array Astra Customizer Configurations with updated configurations.
*/
public function register_configuration( $configurations, $wp_customize ) {
$content_colors_control_title = __( 'Content', 'astra' );
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
$content_colors_control_title = __( 'Content Colors', 'astra' );
}
$_configs = array(
/**
* Option: Divider
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-color-section-divider]',
'section' => 'section-breadcumb',
'title' => __( 'Colors', 'astra' ),
'type' => 'control',
'control' => 'ast-heading',
'priority' => 72,
'divider' => array( 'ast_class' => 'ast-bottom-spacing' ),
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
),
),
/*
* Breadcrumb Color
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-bg-color]',
'type' => 'control',
'default' => astra_get_option( 'breadcrumb-bg-color' ),
'section' => 'section-breadcrumb',
'transport' => 'postMessage',
'control' => 'ast-responsive-color',
'title' => __( 'Background Color', 'astra' ),
'responsive' => true,
'rgba' => true,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
),
'priority' => 72,
),
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-active-color-responsive]',
'default' => astra_get_option( 'breadcrumb-active-color-responsive' ),
'type' => 'control',
'section' => 'section-breadcrumb',
'transport' => 'postMessage',
'control' => 'ast-responsive-color',
'title' => __( 'Text Color', 'astra' ),
'responsive' => true,
'rgba' => true,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
),
'priority' => 72,
),
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-separator-color]',
'default' => astra_get_option( 'breadcrumb-separator-color' ),
'type' => 'control',
'section' => 'section-breadcrumb',
'transport' => 'postMessage',
'control' => 'ast-responsive-color',
'title' => __( 'Separator Color', 'astra' ),
'responsive' => true,
'rgba' => true,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
),
'priority' => 72,
),
array(
'name' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-link-color]',
'default' => astra_get_option( 'section-breadcrumb-color' ),
'type' => 'control',
'control' => 'ast-color-group',
'title' => __( 'Content Link Color', 'astra' ),
'section' => 'section-breadcrumb',
'transport' => 'postMessage',
'priority' => 72,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
),
'responsive' => true,
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
),
array(
'name' => 'breadcrumb-text-color-responsive',
'default' => astra_get_option( 'breadcrumb-text-color-responsive' ),
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-link-color]',
'section' => 'section-breadcrumb',
'transport' => 'postMessage',
'tab' => __( 'Normal', 'astra' ),
'control' => 'ast-responsive-color',
'title' => __( 'Normal', 'astra' ),
'responsive' => true,
'rgba' => true,
'priority' => 15,
),
array(
'name' => 'breadcrumb-hover-color-responsive',
'default' => astra_get_option( 'breadcrumb-hover-color-responsive' ),
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-link-color]',
'section' => 'section-breadcrumb',
'transport' => 'postMessage',
'tab' => __( 'Hover', 'astra' ),
'control' => 'ast-responsive-color',
'title' => __( 'Hover', 'astra' ),
'responsive' => true,
'rgba' => true,
'priority' => 20,
),
);
if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) {
array_push(
$_configs,
/**
* Option: Divider
* Option: breadcrumb color Section divider
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-color-divider]',
'type' => 'control',
'control' => 'ast-heading',
'section' => 'section-breadcrumb',
'title' => __( 'Colors', 'astra' ),
'priority' => 71,
'settings' => array(),
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
)
);
}
return array_merge( $configurations, $_configs );
}
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
new Astra_Breadcrumbs_Color_Configs();

View File

@@ -0,0 +1,569 @@
<?php
/**
* Breadcrumbs Options for Astra theme.
*
* @package Astra
* @link https://www.brainstormforce.com
* @since Astra 1.7.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Astra_Breadcrumbs_Configs' ) ) {
/**
* Customizer Sanitizes Initial setup
*/
class Astra_Breadcrumbs_Configs extends Astra_Customizer_Config_Base {
/**
* Register Astra-Breadcrumbs Settings.
*
* @param Array $configurations Astra Customizer Configurations.
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
* @since 1.7.0
* @return Array Astra Customizer Configurations with updated configurations.
*/
public function register_configuration( $configurations, $wp_customize ) {
$breadcrumb_source_list = apply_filters(
'astra_breadcrumb_source_list',
array(
'default' => __( 'Default', 'astra' ),
),
'breadcrumb-list'
);
$_section = 'section-breadcrumb';
$positions = array(
'none' => __( 'None', 'astra' ),
'astra_masthead_content' => __( 'Inside', 'astra' ),
'astra_header_markup_after' => __( 'After Header', 'astra' ),
'astra_entry_top' => __( 'Before Title', 'astra' ),
);
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
$positions = array(
'none' => __( 'None', 'astra' ),
'astra_header_primary_container_after' => __( 'Inside', 'astra' ),
'astra_header_after' => __( 'After', 'astra' ),
'astra_entry_top' => __( 'Before Title', 'astra' ),
);
}
$_configs = array(
/*
* Breadcrumb
*/
array(
'name' => $_section,
'type' => 'section',
'priority' => 20,
'title' => __( 'Breadcrumb', 'astra' ),
'description_hidden' => true,
'description' => $this->section_get_description(
array(
'description' => '<p><b>' . __( 'Helpful Information', 'astra' ) . '</b></p>',
'links' => array(
array(
'text' => __( 'Breadcrumb Overview', 'astra' ) . ' &#187;',
'attrs' => array(
'href' => astra_get_pro_url( 'https://wpastra.com/docs/add-breadcrumbs-with-astra/', 'customizer', 'helpful_information', 'astra_theme' ),
),
),
),
)
),
),
/**
* Option: Breadcrumb Position
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'default' => astra_get_option( 'breadcrumb-position', 'none' ),
'section' => $_section,
'title' => __( 'Header Position', 'astra' ),
'type' => 'control',
'control' => 'ast-select',
'priority' => 5,
'choices' => $positions,
'partial' => array(
'selector' => '.ast-breadcrumbs-wrapper .ast-breadcrumbs .trail-items',
'container_inclusive' => false,
),
'context' => Astra_Builder_Helper::$general_tab,
'responsive' => false,
'renderAs' => 'text',
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
),
// Breadcrumb if set to None - Show the notice under the Design tab.
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-position-none-notice]',
'type' => 'control',
'control' => 'ast-description',
'section' => $_section,
'priority' => 5,
'label' => '',
'help' => __( 'Note: To get design settings in action make sure to select Header Position other than None.', 'astra' ),
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '==',
'value' => 'none',
),
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
),
),
/**
* Option: Divider
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-layout-divider]',
'section' => $_section,
'title' => __( 'Display Settings', 'astra' ),
'type' => 'control',
'control' => 'ast-heading',
'priority' => 25,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
),
/**
* Option: Disable Breadcrumb on Categories
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-home-page]',
'default' => astra_get_option( 'breadcrumb-disable-home-page', '1' ),
'type' => 'control',
'section' => $_section,
'title' => __( 'Enable on Home Page?', 'astra' ),
'priority' => 25,
'control' => 'ast-toggle-control',
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
),
/**
* Option: Disable Breadcrumb on Categories
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-blog-posts-page]',
'default' => astra_get_option( 'breadcrumb-disable-blog-posts-page', '1' ),
'type' => 'control',
'section' => $_section,
'description' => __( 'Latest posts page or when any page is selected as blog page', 'astra' ),
'title' => __( 'Enable on Blog / Posts Page?', 'astra' ),
'priority' => 25,
'control' => 'ast-toggle-control',
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
),
/**
* Option: Disable Breadcrumb on Search
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-search]',
'default' => astra_get_option( 'breadcrumb-disable-search', '1' ),
'type' => 'control',
'section' => $_section,
'title' => __( 'Enable on Search?', 'astra' ),
'priority' => 30,
'control' => 'ast-toggle-control',
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
),
/**
* Option: Disable Breadcrumb on Archive
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-archive]',
'default' => astra_get_option( 'breadcrumb-disable-archive', '1' ),
'type' => 'control',
'section' => $_section,
'title' => __( 'Enable on Archive?', 'astra' ),
'priority' => 35,
'control' => 'ast-toggle-control',
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
),
/**
* Option: Disable Breadcrumb on Single Page
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-single-page]',
'default' => astra_get_option( 'breadcrumb-disable-single-page', '1' ),
'type' => 'control',
'section' => $_section,
'title' => __( 'Enable on Single Page?', 'astra' ),
'priority' => 40,
'control' => 'ast-toggle-control',
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
),
/**
* Option: Disable Breadcrumb on Single Post
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-single-post]',
'default' => astra_get_option( 'breadcrumb-disable-single-post', '1' ),
'type' => 'control',
'section' => $_section,
'title' => __( 'Enable on Single Post?', 'astra' ),
'priority' => 45,
'control' => 'ast-toggle-control',
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
),
/**
* Option: Disable Breadcrumb on Singular
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-singular]',
'default' => astra_get_option( 'breadcrumb-disable-singular', '1' ),
'type' => 'control',
'section' => $_section,
'description' => __( 'All Pages, All Posts, All Attachments', 'astra' ),
'title' => __( 'Enable on Singular?', 'astra' ),
'priority' => 50,
'control' => 'ast-toggle-control',
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
),
/**
* Option: Disable Breadcrumb on 404 Page
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-disable-404-page]',
'default' => astra_get_option( 'breadcrumb-disable-404-page', '1' ),
'type' => 'control',
'section' => $_section,
'title' => __( 'Enable on 404 Page?', 'astra' ),
'priority' => 55,
'control' => 'ast-toggle-control',
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
),
/**
* Option: Breadcrumb Alignment
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-alignment]',
'default' => astra_get_option( 'breadcrumb-alignment', 'left' ),
'section' => $_section,
'transport' => 'postMessage',
'title' => __( 'Alignment', 'astra' ),
'type' => 'control',
'control' => 'ast-selector',
'priority' => 24,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
'choices' => array(
'left' => 'align-left',
'center' => 'align-center',
'right' => 'align-right',
),
'responsive' => false,
'divider' => array( 'ast_class' => 'ast-top-section-divider ast-bottom-spacing' ),
),
/**
* Option: Breadcrumb Spacing
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-spacing]',
'default' => astra_get_option( 'breadcrumb-spacing' ),
'type' => 'control',
'transport' => 'postMessage',
'control' => 'ast-responsive-spacing',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
'priority' => 83,
'title' => __( 'Spacing', 'astra' ),
'linked_choices' => true,
'unit_choices' => array( 'px', 'em', '%' ),
'choices' => array(
'top' => __( 'Top', 'astra' ),
'right' => __( 'Right', 'astra' ),
'bottom' => __( 'Bottom', 'astra' ),
'left' => __( 'Left', 'astra' ),
),
'section' => $_section,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
),
),
);
if ( $this->is_third_party_breadcrumb_active() ) {
$_configs[] = array(
'name' => ASTRA_THEME_SETTINGS . '[select-breadcrumb-source]',
'default' => astra_get_option( 'select-breadcrumb-source', 'default' ),
'section' => $_section,
'title' => __( 'Breadcrumb Source', 'astra' ),
'type' => 'control',
'control' => 'ast-select',
'priority' => 10,
'choices' => $breadcrumb_source_list,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
'divider' => array( 'ast_class' => 'ast-top-divider' ),
);
}
if ( $this->is_selected_breadcrumb_active() ) {
/**
* Option: Breadcrumb separator
*/
$_configs[] = array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-separator-selector]',
'type' => 'control',
'control' => 'ast-radio-image',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ),
'default' => astra_get_option( 'breadcrumb-separator-selector' ),
'priority' => 15,
'title' => __( 'Separator', 'astra' ),
'section' => $_section,
'choices' => array(
'\003E' => array(
'label' => __( 'Type 1', 'astra' ),
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'breadcrumb-separator-1' ),
),
'\00BB' => array(
'label' => __( 'Type 2', 'astra' ),
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'breadcrumb-separator-2' ),
),
'\002F' => array(
'label' => __( 'Type 3', 'astra' ),
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'breadcrumb-separator-3' ),
),
'unicode' => array(
'label' => __( 'Custom separator', 'astra' ),
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'breadcrumb-separator-unicode' ),
),
),
'alt_layout' => true,
'transport' => 'postMessage',
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
Astra_Builder_Helper::$general_tab_config,
),
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
);
/**
* Option: Breadcrumb Unicode input
*/
$_configs[] = array(
'name' => ASTRA_THEME_SETTINGS . '[breadcrumb-separator]',
'type' => 'control',
'control' => 'text',
'section' => $_section,
'default' => astra_get_option( 'breadcrumb-separator' ),
'priority' => 15,
'title' => __( 'Unicode', 'astra' ),
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-separator-selector]',
'operator' => '=',
'value' => 'unicode',
),
Astra_Builder_Helper::$general_tab_config,
),
'transport' => 'postMessage',
);
}
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
$_configs[] = array(
'name' => $_section . '-ast-context-tabs',
'section' => $_section,
'type' => 'control',
'control' => 'ast-builder-header-control',
'priority' => 0,
'description' => '',
);
}
return array_merge( $configurations, $_configs );
}
/**
* Is third-party breadcrumb active.
* Decide if the Source option should be visible depending on third party plugins.
*
* @return boolean True - If the option should be displayed, False - If the option should be hidden.
*/
public function is_third_party_breadcrumb_active() {
// Check if breadcrumb is turned on from WPSEO option.
$breadcrumb_enable = is_callable( 'WPSEO_Options::get' ) ? WPSEO_Options::get( 'breadcrumbs-enable' ) : false;
$wpseo_option = get_option( 'wpseo_internallinks' ) ? get_option( 'wpseo_internallinks' ) : $breadcrumb_enable;
if ( ! is_array( $wpseo_option ) ) {
unset( $wpseo_option );
$wpseo_option = array(
'breadcrumbs-enable' => $breadcrumb_enable,
);
}
if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] ) {
// Check if breadcrumb is turned on from SEO Yoast plugin.
return true;
} elseif ( function_exists( 'bcn_display' ) ) {
// Check if breadcrumb is turned on from Breadcrumb NavXT plugin.
return true;
} elseif ( function_exists( 'rank_math_the_breadcrumbs' ) ) {
// Check if breadcrumb is turned on from Rank Math plugin.
return true;
} elseif ( function_exists( 'seopress_display_breadcrumbs' ) ) {
// Check if breadcrumb is turned on from SEOPress plugin.
return true;
} else {
return false;
}
}
/**
* Is selected third-party breadcrumb active.
* Decide if the Separator option should be visible depending on third party plugins.
*
* @return boolean True - If the option should be displayed, False - If the option should be hidden.
*/
public function is_selected_breadcrumb_active() {
// Check if breadcrumb is turned on from WPSEO option.
$selected_breadcrumb_source = astra_get_option( 'select-breadcrumb-source' );
$breadcrumb_enable = is_callable( 'WPSEO_Options::get' ) ? WPSEO_Options::get( 'breadcrumbs-enable' ) : false;
$wpseo_option = get_option( 'wpseo_internallinks' ) ? get_option( 'wpseo_internallinks' ) : $breadcrumb_enable;
if ( ! is_array( $wpseo_option ) ) {
unset( $wpseo_option );
$wpseo_option = array(
'breadcrumbs-enable' => $breadcrumb_enable,
);
}
if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] && 'yoast-seo-breadcrumbs' === $selected_breadcrumb_source ) {
// Check if breadcrumb is turned on from SEO Yoast plugin.
return false;
} elseif ( function_exists( 'bcn_display' ) && 'breadcrumb-navxt' === $selected_breadcrumb_source ) {
// Check if breadcrumb is turned on from Breadcrumb NavXT plugin.
return false;
} elseif ( function_exists( 'rank_math_the_breadcrumbs' ) && 'rank-math' === $selected_breadcrumb_source ) {
// Check if breadcrumb is turned on from Rank Math plugin.
return false;
} elseif ( function_exists( 'seopress_display_breadcrumbs' ) ) {
// Check if breadcrumb is turned on from SEOPress plugin.
return false;
} else {
return true;
}
}
}
}
new Astra_Breadcrumbs_Configs();

View File

@@ -0,0 +1,167 @@
<?php
/**
* Typography - Breadcrumbs Options for theme.
*
* @package Astra
* @link https://www.brainstormforce.com
* @since Astra 1.7.0
*/
// Block direct access to the file.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Bail if Customizer config base class does not exist.
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
return;
}
/**
* Customizer Sanitizes
*
* @since 1.7.0
*/
if ( ! class_exists( 'Astra_Breadcrumbs_Typo_Configs' ) ) {
/**
* Register Colors and Background - Breadcrumbs Options Customizer Configurations.
*/
class Astra_Breadcrumbs_Typo_Configs extends Astra_Customizer_Config_Base {
/**
* Register Colors and Background - Breadcrumbs Options Customizer Configurations.
*
* @param Array $configurations Astra Customizer Configurations.
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
* @since 1.7.0
* @return Array Astra Customizer Configurations with updated configurations.
*/
public function register_configuration( $configurations, $wp_customize ) {
$_configs = array(
/*
* Breadcrumb Typography
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]',
'default' => astra_get_option( 'section-breadcrumb-typo' ),
'type' => 'control',
'control' => 'ast-settings-group',
'title' => esc_html__( 'Content Font', 'astra' ),
'section' => 'section-breadcrumb',
'transport' => 'postMessage',
'priority' => 71,
'context' => array(
array(
'setting' => ASTRA_THEME_SETTINGS . '[breadcrumb-position]',
'operator' => '!=',
'value' => 'none',
),
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ?
Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
),
'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-section-divider' ),
),
/**
* Option: Font Family
*/
array(
'name' => 'breadcrumb-font-family',
'default' => astra_get_option( 'breadcrumb-font-family' ),
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]',
'section' => 'section-breadcrumb',
'control' => 'ast-font',
'font_type' => 'ast-font-family',
'title' => esc_html__( 'Font Family', 'astra' ),
'connect' => 'breadcrumb-font-weight',
'priority' => 5,
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
),
/**
* Option: Font Weight
*/
array(
'name' => 'breadcrumb-font-weight',
'control' => 'ast-font',
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]',
'section' => 'section-breadcrumb',
'font_type' => 'ast-font-weight',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
'default' => astra_get_option( 'breadcrumb-font-weight' ),
'title' => esc_html__( 'Font Weight', 'astra' ),
'connect' => 'breadcrumb-font-family',
'priority' => 10,
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
),
/**
* Option: Font Size
*/
array(
'name' => 'breadcrumb-font-size',
'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]',
'type' => 'sub-control',
'control' => 'ast-responsive-slider',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
'section' => 'section-breadcrumb',
'transport' => 'postMessage',
'title' => esc_html__( 'Font Size', 'astra' ),
'priority' => 10,
'default' => astra_get_option( 'breadcrumb-font-size' ),
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
'input_attrs' => array(
'px' => array(
'min' => 0,
'step' => 1,
'max' => 200,
),
'em' => array(
'min' => 0,
'step' => 0.01,
'max' => 20,
),
'vw' => array(
'min' => 0,
'step' => 0.1,
'max' => 25,
),
'rem' => array(
'min' => 0,
'step' => 0.1,
'max' => 20,
),
),
),
/**
* Option: Breadcrumb Content Font Extras
*/
array(
'name' => 'breadcrumb-font-extras',
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[section-breadcrumb-typo]',
'control' => 'ast-font-extras',
'section' => 'section-breadcrumb',
'priority' => 25,
'default' => astra_get_option( 'breadcrumb-font-extras' ),
'title' => esc_html__( 'Line Height', 'astra' ),
),
);
return array_merge( $configurations, $_configs );
}
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
new Astra_Breadcrumbs_Typo_Configs();

View File

@@ -0,0 +1,582 @@
<?php
/**
* Breadcrumbs - Dynamic CSS
*
* @package Astra
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Breadcrumbs
*/
add_filter( 'astra_dynamic_theme_css', 'astra_breadcrumb_section_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 Breadcrumb.
*
* @since 1.7.0
*/
function astra_breadcrumb_section_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {
$breadcrumb_position = astra_get_option( 'breadcrumb-position', 'none' );
$dynamic_css .= astra_parse_css(
array(
'.ast-breadcrumbs .trail-browse, .ast-breadcrumbs .trail-items, .ast-breadcrumbs .trail-items li' => array(
'display' => 'inline-block',
'margin' => '0',
'padding' => '0',
'border' => 'none',
'background' => 'inherit',
'text-indent' => '0',
'text-decoration' => 'none',
),
'.ast-breadcrumbs .trail-browse' => array(
'font-size' => 'inherit',
'font-style' => 'inherit',
'font-weight' => 'inherit',
'color' => 'inherit',
),
'.ast-breadcrumbs .trail-items' => array(
'list-style' => 'none',
),
'.trail-items li::after' => array(
'padding' => '0 0.3em',
'content' => '"\00bb"',
),
'.trail-items li:last-of-type::after' => array(
'display' => 'none',
),
),
'',
''
);
if ( 'none' === $breadcrumb_position ) {
return $dynamic_css;
}
/**
* Set CSS Params
*/
$default_color_array = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$breadcrumb_text_color = astra_get_option( 'breadcrumb-text-color-responsive', $default_color_array );
$breadcrumb_active_color = astra_get_option( 'breadcrumb-active-color-responsive', $default_color_array );
$breadcrumb_hover_color = astra_get_option( 'breadcrumb-hover-color-responsive', $default_color_array );
$breadcrumb_separator_color = astra_get_option( 'breadcrumb-separator-color', $default_color_array );
$breadcrumb_bg_color = astra_get_option( 'breadcrumb-bg-color', $default_color_array );
$breadcrumb_font_size = astra_get_option( 'breadcrumb-font-size' );
$breadcrumb_spacing = astra_get_option( 'breadcrumb-spacing' );
$breadcrumb_alignment = astra_get_option( 'breadcrumb-alignment' );
$breadcrumb_separator = astra_get_option( 'breadcrumb-separator' );
$breadcrumb_separator_selector = astra_get_option( 'breadcrumb-separator-selector' );
/**
* Generate dynamic CSS based on the Breadcrumb Source option selected from the customizer.
*/
$breadcrumb_source = astra_get_option( 'select-breadcrumb-source' );
/**
* Generate Dynamic CSS
*/
$css = '';
$breadcrumbs_default_css = array();
$breadcrumb_enable = is_callable( 'WPSEO_Options::get' ) ? WPSEO_Options::get( 'breadcrumbs-enable' ) : false;
$wpseo_option = get_option( 'wpseo_internallinks' ) ? get_option( 'wpseo_internallinks' ) : $breadcrumb_enable;
if ( ! is_array( $wpseo_option ) ) {
unset( $wpseo_option );
$wpseo_option = array(
'breadcrumbs-enable' => $breadcrumb_enable,
);
}
/**
* Breadcrumb Separator
*/
$current_selected_separator = '';
if ( 'unicode' === $breadcrumb_separator_selector ) {
$current_selected_separator = $breadcrumb_separator;
} else {
$current_selected_separator = $breadcrumb_separator_selector;
}
$css .= astra_parse_css(
array(
'.trail-items li::after' => array(
'content' => '"' . $current_selected_separator . '"',
),
),
'',
''
);
/**
* Breadcrumb Colors & Typography
*/
if ( function_exists( 'yoast_breadcrumb' ) && true === $wpseo_option['breadcrumbs-enable'] && $breadcrumb_source && 'yoast-seo-breadcrumbs' == $breadcrumb_source ) {
/* Yoast SEO Breadcrumb CSS - Desktop */
$breadcrumbs_desktop = array(
'.ast-breadcrumbs-wrapper a' => array(
'color' => esc_attr( $breadcrumb_text_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper .breadcrumb_last' => array(
'color' => esc_attr( $breadcrumb_active_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper span' => array(
'color' => esc_attr( $breadcrumb_separator_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span' => astra_get_font_array_css( astra_get_option( 'breadcrumb-font-family' ), astra_get_option( 'breadcrumb-font-weight' ), $breadcrumb_font_size, 'breadcrumb-font-extras' ),
);
/* Yoast SEO Breadcrumb CSS - Tablet */
$breadcrumbs_tablet = array(
'.ast-breadcrumbs-wrapper a' => array(
'color' => esc_attr( $breadcrumb_text_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper .breadcrumb_last' => array(
'color' => esc_attr( $breadcrumb_active_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper span' => array(
'color' => esc_attr( $breadcrumb_separator_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ),
),
);
/* Yoast SEO Breadcrumb CSS - Mobile */
$breadcrumbs_mobile = array(
'.ast-breadcrumbs-wrapper a' => array(
'color' => esc_attr( $breadcrumb_text_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper .breadcrumb_last' => array(
'color' => esc_attr( $breadcrumb_active_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper span' => array(
'color' => esc_attr( $breadcrumb_separator_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumb_last, .ast-breadcrumbs-wrapper span' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ),
),
);
} elseif ( function_exists( 'bcn_display' ) && $breadcrumb_source && 'breadcrumb-navxt' == $breadcrumb_source ) {
/* Breadcrumb NavXT CSS - Desktop */
$breadcrumbs_desktop = array(
'.ast-breadcrumbs-wrapper a' => array(
'color' => esc_attr( $breadcrumb_text_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper .current-item' => array(
'color' => esc_attr( $breadcrumb_active_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper .breadcrumbs' => array(
'color' => esc_attr( $breadcrumb_separator_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item' => astra_get_font_array_css( astra_get_option( 'breadcrumb-font-family' ), astra_get_option( 'breadcrumb-font-weight' ), $breadcrumb_font_size, 'breadcrumb-font-extras' ),
);
/* Breadcrumb NavXT CSS - Tablet */
$breadcrumbs_tablet = array(
'.ast-breadcrumbs-wrapper a' => array(
'color' => esc_attr( $breadcrumb_text_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper .current-item' => array(
'color' => esc_attr( $breadcrumb_active_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper .breadcrumbs' => array(
'color' => esc_attr( $breadcrumb_separator_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ),
),
);
/* Breadcrumb NavXT CSS - Mobile */
$breadcrumbs_mobile = array(
'.ast-breadcrumbs-wrapper a' => array(
'color' => esc_attr( $breadcrumb_text_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper .current-item' => array(
'color' => esc_attr( $breadcrumb_active_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper .breadcrumbs' => array(
'color' => esc_attr( $breadcrumb_separator_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .current-item' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ),
),
);
} elseif ( function_exists( 'rank_math_the_breadcrumbs' ) && $breadcrumb_source && 'rank-math' == $breadcrumb_source ) {
/* Rank Math CSS - Desktop */
$breadcrumbs_desktop = array(
'.ast-breadcrumbs-wrapper a' => array(
'color' => esc_attr( $breadcrumb_text_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper .last' => array(
'color' => esc_attr( $breadcrumb_active_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper .separator' => array(
'color' => esc_attr( $breadcrumb_separator_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator' => astra_get_font_array_css( astra_get_option( 'breadcrumb-font-family' ), astra_get_option( 'breadcrumb-font-weight' ), $breadcrumb_font_size, 'breadcrumb-font-extras' ),
);
/* Rank Math CSS - Tablet */
$breadcrumbs_tablet = array(
'.ast-breadcrumbs-wrapper a' => array(
'color' => esc_attr( $breadcrumb_text_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper .last' => array(
'color' => esc_attr( $breadcrumb_active_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper .separator' => array(
'color' => esc_attr( $breadcrumb_separator_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ),
),
);
/* Rank Math CSS - Mobile */
$breadcrumbs_mobile = array(
'.ast-breadcrumbs-wrapper a' => array(
'color' => esc_attr( $breadcrumb_text_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper .last' => array(
'color' => esc_attr( $breadcrumb_active_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper .separator' => array(
'color' => esc_attr( $breadcrumb_separator_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper a, .ast-breadcrumbs-wrapper .last, .ast-breadcrumbs-wrapper .separator' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ),
),
);
} elseif ( function_exists( 'seopress_display_breadcrumbs' ) && $breadcrumb_source && 'seopress' == $breadcrumb_source ) {
/* SEOPress CSS - Desktop */
$breadcrumbs_desktop = array(
'.ast-breadcrumbs-inner .breadcrumb-item a' => array(
'color' => esc_attr( $breadcrumb_text_color['desktop'] ),
),
'.ast-breadcrumbs-inner, .ast-breadcrumbs-inner .breadcrumb-item.active' => array(
'color' => esc_attr( $breadcrumb_active_color['desktop'] ),
),
'.ast-breadcrumbs-inner .breadcrumb-item a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['desktop'] ),
),
'.ast-breadcrumbs-inner .breadcrumb-item:after' => array(
'color' => esc_attr( $breadcrumb_separator_color['desktop'] ),
),
'.ast-breadcrumbs-inner, .ast-breadcrumbs-inner .breadcrumb-item, .ast-breadcrumbs-inner .breadcrumb-item.active, .ast-breadcrumbs-inner .breadcrumb-item:after' => astra_get_font_array_css( astra_get_option( 'breadcrumb-font-family' ), astra_get_option( 'breadcrumb-font-weight' ), $breadcrumb_font_size, 'breadcrumb-font-extras' ),
);
/* SEOPress CSS - Tablet */
$breadcrumbs_tablet = array(
'.ast-breadcrumbs-inner .breadcrumb-item a' => array(
'color' => esc_attr( $breadcrumb_text_color['tablet'] ),
),
'.ast-breadcrumbs-inner, .ast-breadcrumbs-inner .breadcrumb-item.active' => array(
'color' => esc_attr( $breadcrumb_active_color['tablet'] ),
),
'.ast-breadcrumbs-inner .breadcrumb-item a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['tablet'] ),
),
'.ast-breadcrumbs-inner .breadcrumb-item:after' => array(
'color' => esc_attr( $breadcrumb_separator_color['tablet'] ),
),
'.ast-breadcrumbs-inner, .ast-breadcrumbs-inner .breadcrumb-item, .ast-breadcrumbs-inner .breadcrumb-item.active, .ast-breadcrumbs-inner .breadcrumb-item:after' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ),
),
);
/* SEOPress CSS - Mobile */
$breadcrumbs_mobile = array(
'.ast-breadcrumbs-inner .breadcrumb-item a' => array(
'color' => esc_attr( $breadcrumb_text_color['mobile'] ),
),
'.ast-breadcrumbs-inner, .ast-breadcrumbs-inner .breadcrumb-item.active' => array(
'color' => esc_attr( $breadcrumb_active_color['mobile'] ),
),
'.ast-breadcrumbs-inner .breadcrumb-item a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['mobile'] ),
),
'.ast-breadcrumbs-inner .breadcrumb-item:after' => array(
'color' => esc_attr( $breadcrumb_separator_color['mobile'] ),
),
'.ast-breadcrumbs-inner, .ast-breadcrumbs-inner .breadcrumb-item, .ast-breadcrumbs-inner .breadcrumb-item.active, .ast-breadcrumbs-inner .breadcrumb-item:after' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ),
),
);
} else {
/* Default Breadcrumb CSS - Desktop */
$breadcrumbs_desktop = array(
'.ast-breadcrumbs-wrapper .trail-items a' => array(
'color' => esc_attr( $breadcrumb_text_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper .trail-items .trail-end' => array(
'color' => esc_attr( $breadcrumb_active_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper .trail-items a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper .trail-items li::after' => array(
'color' => esc_attr( $breadcrumb_separator_color['desktop'] ),
),
'.ast-breadcrumbs-wrapper, .ast-breadcrumbs-wrapper *' => astra_get_font_array_css( astra_get_option( 'breadcrumb-font-family' ), astra_get_option( 'breadcrumb-font-weight' ), $breadcrumb_font_size, 'breadcrumb-font-extras' ),
);
/* Default Breadcrumb CSS - Tablet */
$breadcrumbs_tablet = array(
'.ast-breadcrumbs-wrapper .trail-items a' => array(
'color' => esc_attr( $breadcrumb_text_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper .trail-items .trail-end' => array(
'color' => esc_attr( $breadcrumb_active_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper .trail-items a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper .trail-items li::after' => array(
'color' => esc_attr( $breadcrumb_separator_color['tablet'] ),
),
'.ast-breadcrumbs-wrapper, .ast-breadcrumbs-wrapper a' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'tablet' ),
),
);
/* Default Breadcrumb CSS - Mobile */
$breadcrumbs_mobile = array(
'.ast-breadcrumbs-wrapper .trail-items a' => array(
'color' => esc_attr( $breadcrumb_text_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper .trail-items .trail-end' => array(
'color' => esc_attr( $breadcrumb_active_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper .trail-items a:hover' => array(
'color' => esc_attr( $breadcrumb_hover_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper .trail-items li::after' => array(
'color' => esc_attr( $breadcrumb_separator_color['mobile'] ),
),
'.ast-breadcrumbs-wrapper, .ast-breadcrumbs-wrapper a' => array(
'font-size' => astra_responsive_font( $breadcrumb_font_size, 'mobile' ),
),
);
}
/* Breadcrumb CSS for Background Color */
$breadcrumbs_desktop['.ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb'] = array(
'background-color' => esc_attr( $breadcrumb_bg_color['desktop'] ),
);
$breadcrumbs_tablet['.ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb'] = array(
'background-color' => esc_attr( $breadcrumb_bg_color['tablet'] ),
);
$breadcrumbs_mobile['.ast-breadcrumbs-wrapper, .main-header-bar.ast-header-breadcrumb'] = array(
'background-color' => esc_attr( $breadcrumb_bg_color['mobile'] ),
);
/* Breadcrumb CSS for Spacing */
if ( 'astra_header_markup_after' === $breadcrumb_position || 'astra_header_after' === $breadcrumb_position ) {
// After Header.
$breadcrumbs_desktop['.main-header-bar.ast-header-breadcrumb, .ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .header-main-layout-2 .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .ast-mobile-header-stack .main-header-bar.ast-header-breadcrumb, .ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb'] = array(
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'desktop' ),
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'desktop' ),
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'desktop' ),
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'desktop' ),
);
$breadcrumbs_tablet['.main-header-bar.ast-header-breadcrumb, .ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .header-main-layout-2 .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .ast-mobile-header-stack .main-header-bar.ast-header-breadcrumb, .ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb'] = array(
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'tablet' ),
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'tablet' ),
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'tablet' ),
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'tablet' ),
);
$breadcrumbs_mobile['.main-header-bar.ast-header-breadcrumb, .ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .header-main-layout-2 .main-header-bar.ast-header-breadcrumb, .ast-header-break-point .ast-mobile-header-stack .main-header-bar.ast-header-breadcrumb, .ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar-wrap .main-header-bar.ast-header-breadcrumb'] = array(
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'mobile' ),
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'mobile' ),
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'mobile' ),
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'mobile' ),
);
$breadcrumbs_default_css['.ast-header-breadcrumb'] = array(
'padding-top' => '10px',
'padding-bottom' => '10px',
'width' => '100%',
);
} elseif ( 'astra_masthead_content' === $breadcrumb_position ) {
// Inside Header.
$breadcrumbs_desktop['.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'desktop' ),
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'desktop' ),
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'desktop' ),
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'desktop' ),
);
$breadcrumbs_tablet['.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'tablet' ),
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'tablet' ),
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'tablet' ),
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'tablet' ),
);
$breadcrumbs_mobile['.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'mobile' ),
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'mobile' ),
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'mobile' ),
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'mobile' ),
);
$breadcrumbs_default_css['.ast-breadcrumbs-inner #ast-breadcrumbs-yoast, .ast-breadcrumbs-inner .breadcrumbs, .ast-breadcrumbs-inner .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
'padding-bottom' => '10px',
);
$breadcrumbs_default_css['.ast-header-break-point .ast-breadcrumbs-wrapper'] = array(
'order' => '4',
);
} else {
// Before Title.
$breadcrumbs_desktop['.ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'desktop' ),
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'desktop' ),
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'desktop' ),
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'desktop' ),
);
$breadcrumbs_tablet['.ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'tablet' ),
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'tablet' ),
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'tablet' ),
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'tablet' ),
);
$breadcrumbs_mobile['.ast-breadcrumbs-wrapper #ast-breadcrumbs-yoast, .ast-breadcrumbs-wrapper .breadcrumbs, .ast-breadcrumbs-wrapper .rank-math-breadcrumb, .ast-breadcrumbs-inner nav'] = array(
'padding-top' => astra_responsive_spacing( $breadcrumb_spacing, 'top', 'mobile' ),
'padding-right' => astra_responsive_spacing( $breadcrumb_spacing, 'right', 'mobile' ),
'padding-bottom' => astra_responsive_spacing( $breadcrumb_spacing, 'bottom', 'mobile' ),
'padding-left' => astra_responsive_spacing( $breadcrumb_spacing, 'left', 'mobile' ),
);
}
/* Breadcrumb CSS for Alignment */
$breadcrumbs_desktop['.ast-breadcrumbs-wrapper'] = array(
'text-align' => esc_attr( $breadcrumb_alignment ),
);
$css .= astra_parse_css( $breadcrumbs_desktop );
$css .= astra_parse_css( $breadcrumbs_tablet, '', astra_get_tablet_breakpoint() );
$css .= astra_parse_css( $breadcrumbs_mobile, '', astra_get_mobile_breakpoint() );
$css .= astra_parse_css( $breadcrumbs_default_css );
/* Breadcrumb default CSS */
$css .= astra_parse_css(
array(
'.ast-default-menu-enable.ast-main-header-nav-open.ast-header-break-point .main-header-bar.ast-header-breadcrumb, .ast-main-header-nav-open .main-header-bar.ast-header-breadcrumb' => array(
'padding-top' => '1em',
'padding-bottom' => '1em',
),
),
'',
''
);
$css .= astra_parse_css(
array(
'.ast-header-break-point .main-header-bar.ast-header-breadcrumb' => array(
'border-bottom-width' => '1px',
'border-bottom-color' => '#eaeaea',
'border-bottom-style' => 'solid',
),
),
'',
''
);
$css .= astra_parse_css(
array(
'.ast-breadcrumbs-wrapper' => array(
'line-height' => '1.4',
),
),
'',
''
);
$css .= astra_parse_css(
array(
'.ast-breadcrumbs-wrapper .rank-math-breadcrumb p' => array(
'margin-bottom' => '0px',
),
),
'',
''
);
$css .= astra_parse_css(
array(
'.ast-breadcrumbs-wrapper' => array(
'display' => 'block',
'width' => '100%',
),
),
'',
''
);
$dynamic_css .= $css;
return $dynamic_css;
}

View File

@@ -0,0 +1,151 @@
/**
* 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 3.0.0
*/
( function( $ ) {
var headingSelectors = 'h1, .entry-content h1, h2, .entry-content h2, h3, .entry-content h3, h4, .entry-content h4, h5, .entry-content h5, h6, .entry-content h6';
if( astraHeadingColorOptions.maybeApplyHeadingColorForTitle ) {
headingSelectors += ',.ast-archive-title, .entry-title a';
}
/**
* Content <h1> to <h6> headings
*/
astra_css( 'astra-settings[heading-base-color]', 'color', headingSelectors );
function headingDynamicCss(slug) {
let anchorSupport = '';
let WidthTitleSupport = '';
// Check if anchors should be loaded in the CSS for headings.
if( astraCustomizer.includeAnchorsInHeadindsCss ) {
anchorSupport = ',.entry-content ' + slug + ' a';
}
// Add widget title support to font-weight preview CSS.
if( astraCustomizer.font_weights_widget_title_support ) {
WidthTitleSupport = ',' + slug + '.widget-title';
}
astra_generate_outside_font_family_css( 'astra-settings[font-family-'+ slug +']', slug + ', .entry-content ' + slug + anchorSupport, true, '.ast-sg-typo-field[data-for="' + slug + '"] .ast-sg-font-family' );
astra_generate_font_weight_css( 'astra-settings[font-family-'+ slug +']', 'astra-settings[font-weight-'+ slug +']', 'font-weight', slug + ', .entry-content ' + slug + anchorSupport + WidthTitleSupport );
wp.customize( 'astra-settings[font-extras-'+ slug +']', function( value ) {
value.bind( function( data ) {
let elementorSupport = '';
let dynamicStyle = '';
if ( astraCustomizer.page_builder_button_style_css ) {
elementorSupport = ',.elementor-widget-heading '+ slug +'.elementor-heading-title';
}
// Line Height
const globalSelectorLineHeight = slug + ', .entry-content '+ slug + elementorSupport + anchorSupport;
if( data['line-height'] && data['line-height-unit'] ) {
dynamicStyle += globalSelectorLineHeight + '{';
dynamicStyle += 'line-height : ' + data['line-height'] + data['line-height-unit'] + ';' ;
dynamicStyle += '}';
let styleGuideUpdatedEvent = new CustomEvent('AstraStyleGuideElementUpdated', {
'detail': {
'value': data['line-height'] + data['line-height-unit'],
'selector': '.ast-sg-typo-field[data-for="' + slug + '"] .ast-sg-line-height'
}
});
document.dispatchEvent(styleGuideUpdatedEvent);
}
const globalSelector = slug +', .entry-content ' + slug + anchorSupport;
if( data['letter-spacing'] || data['text-decoration'] || data['text-transform'] ) {
dynamicStyle += globalSelector + '{';
if( data['letter-spacing'] && data['letter-spacing-unit'] ) {
dynamicStyle += 'letter-spacing : ' + data['letter-spacing'] + data['letter-spacing-unit'] + ";" ;
}
if( data['text-decoration'] ) {
dynamicStyle += 'text-decoration : ' + data['text-decoration'] + ";";
}
if( data['text-transform'] ) {
dynamicStyle += 'text-transform : ' + data['text-transform'] + ';' ;
}
dynamicStyle += '}';
}
astra_add_dynamic_css( 'font-extras-'+ slug, dynamicStyle );
});
});
}
headingDynamicCss('h1');
headingDynamicCss('h2');
headingDynamicCss('h3');
headingDynamicCss('h4');
headingDynamicCss('h5');
headingDynamicCss('h6');
let woo_button_attr = '';
// WooCommerce global button compatibility for new users only.
if( astraCustomizer.astra_woo_btn_global_compatibility ) {
woo_button_attr = ', .woocommerce a.button, .woocommerce button.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce-cart table.cart td.actions .button, .woocommerce form.checkout_coupon .button, .woocommerce #respond input#submit, .wc-block-grid__products .wc-block-grid__product .wp-block-button__link';
}
if ( astraCustomizer.page_builder_button_style_css ) {
var ele_btn_font_family = '';
var ele_btn_font_weight = '';
var ele_btn_font_size = '';
var ele_btn_transform = '';
var ele_btn_line_height = '';
var ele_btn_letter_spacing = '';
if ( 'color-typo' == astraCustomizer.elementor_default_color_font_setting || 'typo' == astraCustomizer.elementor_default_color_font_setting ) {
// Button Typo
ele_btn_font_family = ',.elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited';
ele_btn_font_weight = ',.elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited';
ele_btn_font_size = ',.elementor-button-wrapper .elementor-button.elementor-size-sm, .elementor-button-wrapper .elementor-button.elementor-size-xs, .elementor-button-wrapper .elementor-button.elementor-size-md, .elementor-button-wrapper .elementor-button.elementor-size-lg, .elementor-button-wrapper .elementor-button.elementor-size-xl, .elementor-button-wrapper .elementor-button';
ele_btn_transform = ',.elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited';
ele_btn_line_height = ',.elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited';
ele_btn_letter_spacing = ',.elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited', 'px';
}
// Button Typo
astra_generate_outside_font_family_css( 'astra-settings[font-family-button]', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .wp-block-button .wp-block-button__link, form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' + astraCustomizer.v4_2_2_core_form_btns_styling + ele_btn_font_family + woo_button_attr );
astra_generate_font_weight_css( 'astra-settings[font-family-button]', 'astra-settings[font-weight-button]', 'font-weight', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .wp-block-button .wp-block-button__link, form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' + astraCustomizer.v4_2_2_core_form_btns_styling + ele_btn_font_weight + woo_button_attr );
astra_font_extras_css( 'font-extras-button', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], body .wp-block-button .wp-block-button__link, form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' + astraCustomizer.v4_2_2_core_form_btns_styling + ele_btn_transform + woo_button_attr + astraCustomizer.improved_button_selector );
astra_responsive_font_size( 'astra-settings[font-size-button]', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .wp-block-button .wp-block-button__link, form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' + astraCustomizer.v4_2_2_core_form_btns_styling + ele_btn_font_size + woo_button_attr );
astra_css( 'astra-settings[theme-btn-line-height]', 'line-height', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .wp-block-button .wp-block-button__link, form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' + astraCustomizer.v4_2_2_core_form_btns_styling + ele_btn_line_height + woo_button_attr );
astra_css( 'astra-settings[theme-btn-letter-spacing]', 'letter-spacing', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .wp-block-button .wp-block-button__link, form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' + astraCustomizer.v4_2_2_core_form_btns_styling + ele_btn_letter_spacing + woo_button_attr, 'px' );
} else {
// Button Typo
astra_generate_outside_font_family_css( 'astra-settings[font-family-button]', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' + astraCustomizer.v4_2_2_core_form_btns_styling + woo_button_attr );
astra_generate_font_weight_css( 'astra-settings[font-family-button]', 'astra-settings[font-weight-button]', 'font-weight', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' + astraCustomizer.v4_2_2_core_form_btns_styling + woo_button_attr );
astra_font_extras_css( 'font-extras-button', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' + astraCustomizer.v4_2_2_core_form_btns_styling + woo_button_attr );
astra_responsive_font_size( 'astra-settings[font-size-button]', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' + astraCustomizer.v4_2_2_core_form_btns_styling + woo_button_attr );
astra_css( 'astra-settings[theme-btn-line-height]', 'line-height', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' + astraCustomizer.v4_2_2_core_form_btns_styling + woo_button_attr );
astra_css( 'astra-settings[theme-btn-letter-spacing]', 'letter-spacing', 'button, .ast-button, .ast-custom-button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' + astraCustomizer.v4_2_2_core_form_btns_styling + woo_button_attr , 'px' );
}
// Secondary button typo.
let outline_btn_selector = 'body .wp-block-buttons .wp-block-button.is-style-outline .wp-block-button__link.wp-element-button, body .ast-outline-button, body .wp-block-uagb-buttons-child .uagb-buttons-repeater.ast-outline-button';
astra_generate_outside_font_family_css( 'astra-settings[secondary-font-family-button]', outline_btn_selector );
astra_generate_font_weight_css( 'astra-settings[secondary-font-family-button]', 'astra-settings[secondary-font-weight-button]', 'font-weight', outline_btn_selector );
astra_font_extras_css( 'secondary-font-extras-button', outline_btn_selector );
astra_responsive_font_size( 'astra-settings[secondary-font-size-button]', outline_btn_selector );
astra_css( 'astra-settings[secondary-theme-btn-line-height]', 'line-height', outline_btn_selector );
astra_css( 'astra-settings[secondary-theme-btn-letter-spacing]', 'letter-spacing', outline_btn_selector, 'px' );
} )( jQuery );

View File

@@ -0,0 +1,271 @@
<?php
/**
* Heading Colors Loader for Astra theme.
*
* @package Astra
* @link https://www.brainstormforce.com
* @since Astra 2.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Customizer Initialization
*
* @since 2.2.0
*/
class Astra_Heading_Colors_Loader {
/**
* Constructor
*
* @since 2.2.0
*/
public function __construct() {
add_filter( 'astra_theme_defaults', array( $this, 'theme_defaults' ) );
add_action( 'customize_register', array( $this, 'customize_register' ), 2 );
add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 );
// Load Google fonts.
add_action( 'astra_get_fonts', array( $this, 'add_fonts' ), 1 );
}
/**
* Enqueue google fonts.
*
* @since 2.2.0
*/
public function add_fonts() {
$font_family_h1 = astra_get_option( 'font-family-h1' );
$font_weight_h1 = astra_get_option( 'font-weight-h1' );
Astra_Fonts::add_font( $font_family_h1, $font_weight_h1 );
$font_family_h2 = astra_get_option( 'font-family-h2' );
$font_weight_h2 = astra_get_option( 'font-weight-h2' );
Astra_Fonts::add_font( $font_family_h2, $font_weight_h2 );
$font_family_h3 = astra_get_option( 'font-family-h3' );
$font_weight_h3 = astra_get_option( 'font-weight-h3' );
Astra_Fonts::add_font( $font_family_h3, $font_weight_h3 );
if ( astra_has_gcp_typo_preset_compatibility() ) {
$font_family_h4 = astra_get_option( 'font-family-h4' );
$font_weight_h4 = astra_get_option( 'font-weight-h4' );
Astra_Fonts::add_font( $font_family_h4, $font_weight_h4 );
$font_family_h5 = astra_get_option( 'font-family-h5' );
$font_weight_h5 = astra_get_option( 'font-weight-h5' );
Astra_Fonts::add_font( $font_family_h5, $font_weight_h5 );
$font_family_h6 = astra_get_option( 'font-family-h6' );
$font_weight_h6 = astra_get_option( 'font-weight-h6' );
Astra_Fonts::add_font( $font_family_h6, $font_weight_h6 );
}
$theme_btn_font_family = astra_get_option( 'font-family-button' );
$theme_btn_font_weight = astra_get_option( 'font-weight-button' );
Astra_Fonts::add_font( $theme_btn_font_family, $theme_btn_font_weight );
$theme_secondary_btn_font_family = astra_get_option( 'secondary-font-family-button' );
$theme_secondary_btn_font_weight = astra_get_option( 'secondary-font-weight-button' );
Astra_Fonts::add_font( $theme_secondary_btn_font_family, $theme_secondary_btn_font_weight );
$header_btn_font_family = astra_get_option( 'primary-header-button-font-family' );
$header_btn_font_weight = astra_get_option( 'primary-header-button-font-weight' );
Astra_Fonts::add_font( $header_btn_font_family, $header_btn_font_weight );
}
/**
* Set Options Default Values
*
* @param array $defaults Astra options default value array.
* @return array
*
* @since 2.2.0
*/
public function theme_defaults( $defaults ) {
$astra_options = Astra_Theme_Options::get_astra_options();
/**
* Update Astra default color and typography values. To not update directly on existing users site, added backwards.
*
* @since 4.0.0
*/
$apply_new_default_color_typo_values = Astra_Dynamic_CSS::astra_check_default_color_typo();
/**
* Heading Tags <h1> to <h6>
*/
$defaults['h1-color'] = '';
$defaults['h2-color'] = '';
$defaults['h3-color'] = '';
$defaults['h4-color'] = '';
$defaults['h5-color'] = '';
$defaults['h6-color'] = '';
// Header <H1>.
$defaults['font-family-h1'] = 'inherit';
$defaults['font-weight-h1'] = 'inherit';
$defaults['font-extras-h1'] = array(
'line-height' => ! isset( $astra_options['font-extras-h1'] ) && isset( $astra_options['line-height-h1'] ) ? $astra_options['line-height-h1'] : '1.4',
'line-height-unit' => 'em',
'letter-spacing' => '',
'letter-spacing-unit' => 'px',
'text-transform' => ! isset( $astra_options['font-extras-h1'] ) && isset( $astra_options['text-transform-h1'] ) ? $astra_options['text-transform-h1'] : '',
'text-decoration' => '',
);
// Header <H2>.
$defaults['font-family-h2'] = 'inherit';
$defaults['font-weight-h2'] = 'inherit';
$defaults['font-extras-h2'] = array(
'line-height' => ! isset( $astra_options['font-extras-h2'] ) && isset( $astra_options['line-height-h2'] ) ? $astra_options['line-height-h2'] : '1.3',
'line-height-unit' => 'em',
'letter-spacing' => '',
'letter-spacing-unit' => 'px',
'text-transform' => ! isset( $astra_options['font-extras-h2'] ) && isset( $astra_options['text-transform-h2'] ) ? $astra_options['text-transform-h2'] : '',
'text-decoration' => '',
);
// Header <H3>.
$defaults['font-family-h3'] = 'inherit';
$defaults['font-weight-h3'] = 'inherit';
$defaults['font-extras-h3'] = array(
'line-height' => ! isset( $astra_options['font-extras-h3'] ) && isset( $astra_options['line-height-h3'] ) ? $astra_options['line-height-h3'] : '1.3',
'line-height-unit' => 'em',
'letter-spacing' => '',
'letter-spacing-unit' => 'px',
'text-transform' => ! isset( $astra_options['font-extras-h3'] ) && isset( $astra_options['text-transform-h3'] ) ? $astra_options['text-transform-h3'] : '',
'text-decoration' => '',
);
// Header <H4>.
$defaults['font-family-h4'] = 'inherit';
$defaults['font-weight-h4'] = 'inherit';
$defaults['font-extras-h4'] = array(
'line-height' => ! isset( $astra_options['font-extras-h4'] ) && isset( $astra_options['line-height-h4'] ) ? $astra_options['line-height-h4'] : '1.2',
'line-height-unit' => 'em',
'letter-spacing' => '',
'letter-spacing-unit' => 'px',
'text-transform' => ! isset( $astra_options['font-extras-h4'] ) && isset( $astra_options['text-transform-h4'] ) ? $astra_options['text-transform-h4'] : '',
'text-decoration' => '',
);
// Header <H5>.
$defaults['font-family-h5'] = 'inherit';
$defaults['font-weight-h5'] = 'inherit';
$defaults['font-extras-h5'] = array(
'line-height' => ! isset( $astra_options['font-extras-h5'] ) && isset( $astra_options['line-height-h5'] ) ? $astra_options['line-height-h5'] : '1.2',
'line-height-unit' => 'em',
'letter-spacing' => '',
'letter-spacing-unit' => 'px',
'text-transform' => ! isset( $astra_options['font-extras-h5'] ) && isset( $astra_options['text-transform-h5'] ) ? $astra_options['text-transform-h5'] : '',
'text-decoration' => '',
);
// Header <H6>.
$defaults['font-family-h6'] = 'inherit';
$defaults['font-weight-h6'] = 'inherit';
$defaults['font-extras-h6'] = array(
'line-height' => ! isset( $astra_options['font-extras-h6'] ) && isset( $astra_options['line-height-h6'] ) ? $astra_options['line-height-h6'] : '1.25',
'line-height-unit' => 'em',
'letter-spacing' => '',
'letter-spacing-unit' => 'px',
'text-transform' => ! isset( $astra_options['font-extras-h6'] ) && isset( $astra_options['text-transform-h6'] ) ? $astra_options['text-transform-h6'] : '',
'text-decoration' => '',
);
/**
* Theme button Font Defaults
*/
$defaults['font-weight-button'] = $apply_new_default_color_typo_values ? '500' : 'inherit';
$defaults['secondary-font-weight-button'] = $apply_new_default_color_typo_values ? '500' : 'inherit';
$defaults['font-family-button'] = 'inherit';
$defaults['secondary-font-family-button'] = 'inherit';
$defaults['font-size-button'] = array(
'desktop' => $apply_new_default_color_typo_values ? '16' : '',
'tablet' => '',
'mobile' => '',
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
);
$defaults['secondary-font-size-button'] = array(
'desktop' => $apply_new_default_color_typo_values ? '16' : '',
'tablet' => '',
'mobile' => '',
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
);
$defaults['font-extras-button'] = array(
'line-height' => ! isset( $astra_options['font-extras-button'] ) && isset( $astra_options['theme-btn-line-height'] ) ? $astra_options['theme-btn-line-height'] : 1,
'line-height-unit' => 'em',
'letter-spacing' => ! isset( $astra_options['font-extras-button'] ) && isset( $astra_options['theme-btn-letter-spacing'] ) ? $astra_options['theme-btn-letter-spacing'] : '',
'letter-spacing-unit' => 'px',
'text-transform' => ! isset( $astra_options['font-extras-button'] ) && isset( $astra_options['text-transform-button'] ) ? $astra_options['text-transform-button'] : '',
'text-decoration' => '',
);
$defaults['secondary-font-extras-button'] = array(
'line-height' => ! isset( $astra_options['secondary-font-extras-button'] ) && isset( $astra_options['secondary-theme-btn-line-height'] ) ? $astra_options['secondary-theme-btn-line-height'] : 1,
'line-height-unit' => 'em',
'letter-spacing' => ! isset( $astra_options['secondary-font-extras-button'] ) && isset( $astra_options['secondary-theme-btn-letter-spacing'] ) ? $astra_options['secondary-theme-btn-letter-spacing'] : '',
'letter-spacing-unit' => 'px',
'text-transform' => ! isset( $astra_options['secondary-font-extras-button'] ) && isset( $astra_options['secondary-text-transform-button'] ) ? $astra_options['secondary-text-transform-button'] : '',
'text-decoration' => '',
);
return $defaults;
}
/**
* Load color configs for the Heading Colors.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*
* @since 2.2.0
*/
public function customize_register( $wp_customize ) {
/**
* Register Panel & Sections
*/
require_once ASTRA_THEME_HEADING_COLORS_DIR . 'customizer/class-astra-heading-colors-configs.php';// phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
}
/**
* Customizer Preview
*
* @since 2.2.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-heading-colors-customizer-preview-js', ASTRA_THEME_HEADING_COLORS_URI . 'assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true );
wp_localize_script(
'astra-heading-colors-customizer-preview-js',
'astraHeadingColorOptions',
array(
'maybeApplyHeadingColorForTitle' => astra_has_global_color_format_support(),
)
);
}
}
/**
* Kicking this off by creating the object of the class.
*/
new Astra_Heading_Colors_Loader();

View File

@@ -0,0 +1,45 @@
<?php
/**
* Heading Colors for Astra theme.
*
* @package Astra
* @link https://www.brainstormforce.com
* @since Astra 2.1.4
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
define( 'ASTRA_THEME_HEADING_COLORS_DIR', ASTRA_THEME_DIR . 'inc/addons/heading-colors/' );
define( 'ASTRA_THEME_HEADING_COLORS_URI', ASTRA_THEME_URI . 'inc/addons/heading-colors/' );
if ( ! class_exists( 'Astra_Heading_Colors' ) ) {
/**
* Heading Initial Setup
*
* @since 2.1.4
*/
class Astra_Heading_Colors {
/**
* Constructor function that initializes required actions and hooks
*/
public function __construct() {
require_once ASTRA_THEME_HEADING_COLORS_DIR . 'class-astra-heading-colors-loader.php';// phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
// Include front end files.
if ( ! is_admin() ) {
require_once ASTRA_THEME_HEADING_COLORS_DIR . 'dynamic-css/dynamic.css.php';// phpcs:ignore: WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
}
}
}
/**
* Kicking this off by creating an object.
*/
new Astra_Heading_Colors();
}

View File

@@ -0,0 +1,266 @@
<?php
/**
* Heading Colors Options for Astra theme.
*
* @package Astra
* @link https://www.brainstormforce.com
* @since Astra 2.1.4
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Astra_Heading_Colors_Configs' ) ) {
/**
* Customizer Sanitizes Initial setup
*/
class Astra_Heading_Colors_Configs extends Astra_Customizer_Config_Base {
/**
* Register Astra Heading Colors Settings.
*
* @param Array $configurations Astra Customizer Configurations.
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
* @since 2.1.4
* @return Array Astra Customizer Configurations with updated configurations.
*/
public function register_configuration( $configurations, $wp_customize ) {
$_section = 'section-colors-background';
if ( class_exists( 'Astra_Ext_Extension' ) && Astra_Ext_Extension::is_active( 'colors-and-background' ) && ! astra_has_gcp_typo_preset_compatibility() ) {
$_section = 'section-colors-body';
}
$_configs = array(
// Option: Base Heading Color.
array(
'default' => astra_get_option( 'heading-base-color' ),
'type' => 'control',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'transport' => 'postMessage',
'priority' => 5,
'name' => ASTRA_THEME_SETTINGS . '[heading-base-color]',
'title' => __( 'Heading (H1-H6)', 'astra' ),
'section' => $_section,
),
/**
* Option: Button Typography Heading
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[button-text-typography]',
'default' => astra_get_option( 'button-text-typography' ),
'type' => 'control',
'control' => 'ast-settings-group',
'title' => __( 'Font', 'astra' ),
'section' => 'section-buttons',
'transport' => 'postMessage',
'priority' => 18.5,
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider' ),
),
/**
* Option: Outline Button Typography Heading
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[secondary-button-text-typography]',
'default' => astra_get_option( 'secondary-button-text-typography' ),
'type' => 'control',
'control' => 'ast-settings-group',
'title' => __( 'Font', 'astra' ),
'section' => 'section-buttons',
'transport' => 'postMessage',
'priority' => 10,
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider' ),
'context' => Astra_Builder_Helper::$design_tab,
),
/**
* Option: Button Font Family
*/
array(
'name' => 'font-family-button',
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]',
'section' => 'section-buttons',
'control' => 'ast-font',
'font_type' => 'ast-font-family',
'title' => __( 'Font Family', 'astra' ),
'default' => astra_get_option( 'font-family-button' ),
'connect' => ASTRA_THEME_SETTINGS . '[font-weight-button]',
'priority' => 1,
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
),
/**
* Option: Outline Button Font Family
*/
array(
'name' => 'secondary-font-family-button',
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[secondary-button-text-typography]',
'section' => 'section-buttons',
'control' => 'ast-font',
'font_type' => 'ast-font-family',
'title' => __( 'Font Family', 'astra' ),
'default' => astra_get_option( 'secondary-font-family-button' ),
'connect' => ASTRA_THEME_SETTINGS . '[secondary-font-weight-button]',
'priority' => 1,
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
),
/**
* Option: Button Font Weight
*/
array(
'name' => 'font-weight-button',
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]',
'section' => 'section-buttons',
'control' => 'ast-font',
'font_type' => 'ast-font-weight',
'title' => __( 'Font Weight', 'astra' ),
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
'default' => astra_get_option( 'font-weight-button' ),
'connect' => 'font-family-button',
'priority' => 2,
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
),
/**
* Option: Button Font Weight
*/
array(
'name' => 'secondary-font-weight-button',
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[secondary-button-text-typography]',
'section' => 'section-buttons',
'control' => 'ast-font',
'font_type' => 'ast-font-weight',
'title' => __( 'Font Weight', 'astra' ),
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
'default' => astra_get_option( 'secondary-font-weight-button' ),
'connect' => 'secondary-font-family-button',
'priority' => 2,
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
),
/**
* Option: Button Font Size
*/
array(
'name' => 'font-size-button',
'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]',
'type' => 'sub-control',
'control' => 'ast-responsive-slider',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
'section' => 'section-buttons',
'transport' => 'postMessage',
'title' => __( 'Font Size', 'astra' ),
'priority' => 3,
'default' => astra_get_option( 'font-size-button' ),
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
'input_attrs' => array(
'px' => array(
'min' => 0,
'step' => 1,
'max' => 200,
),
'em' => array(
'min' => 0,
'step' => 0.01,
'max' => 20,
),
'vw' => array(
'min' => 0,
'step' => 0.1,
'max' => 25,
),
'rem' => array(
'min' => 0,
'step' => 0.1,
'max' => 20,
),
),
),
/**
* Option: Outline Button Font Size
*/
array(
'name' => 'secondary-font-size-button',
'parent' => ASTRA_THEME_SETTINGS . '[secondary-button-text-typography]',
'type' => 'sub-control',
'control' => 'ast-responsive-slider',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
'section' => 'section-buttons',
'transport' => 'postMessage',
'title' => __( 'Font Size', 'astra' ),
'priority' => 3,
'default' => astra_get_option( 'secondary-font-size-button' ),
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
'input_attrs' => array(
'px' => array(
'min' => 0,
'step' => 1,
'max' => 200,
),
'em' => array(
'min' => 0,
'step' => 0.01,
'max' => 20,
),
'vw' => array(
'min' => 0,
'step' => 0.1,
'max' => 25,
),
'rem' => array(
'min' => 0,
'step' => 0.1,
'max' => 20,
),
),
),
/**
* Option: Button Font Extras
*/
array(
'name' => 'font-extras-button',
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[button-text-typography]',
'control' => 'ast-font-extras',
'section' => 'section-buttons',
'priority' => 4,
'default' => astra_get_option( 'font-extras-button' ),
),
/**
* Option: Outline Button Font Extras
*/
array(
'name' => 'secondary-font-extras-button',
'type' => 'sub-control',
'parent' => ASTRA_THEME_SETTINGS . '[secondary-button-text-typography]',
'control' => 'ast-font-extras',
'section' => 'section-buttons',
'priority' => 4,
'default' => astra_get_option( 'secondary-font-extras-button' ),
),
);
return array_merge( $configurations, $_configs );
}
}
}
new Astra_Heading_Colors_Configs();

View File

@@ -0,0 +1,65 @@
<?php
/**
* Heading Colors - Dynamic CSS
*
* @package Astra
* @since 2.1.4
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Heading Colors
*/
add_filter( 'astra_dynamic_theme_css', 'astra_heading_colors_section_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 Heading Colors.
*
* @since 2.1.4
*/
function astra_heading_colors_section_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {
/**
* Heading Colors - h1 - h6.
*/
$heading_base_color = astra_get_option( 'heading-base-color' );
if ( empty( $heading_base_color ) ) {
return $dynamic_css;
}
/**
* Normal Colors without reponsive option.
* [1]. Heading Colors
*/
$css_output = array(
/**
* Content base heading color.
*/
'h1, .entry-content h1, h2, .entry-content h2, h3, .entry-content h3, h4, .entry-content h4, h5, .entry-content h5, h6, .entry-content h6' => array(
'color' => esc_attr( $heading_base_color ),
),
);
if ( astra_has_global_color_format_support() ) {
$css_output['.entry-title a'] = array(
'color' => esc_attr( $heading_base_color ),
);
}
/* Parse CSS from array() */
$css_output = astra_parse_css( $css_output );
$dynamic_css .= $css_output;
return $dynamic_css;
}

View File

@@ -0,0 +1 @@
jQuery,astra_css("astra-settings[scroll-to-top-icon-size]","font-size","#ast-scroll-top","px"),astra_css("astra-settings[scroll-to-top-icon-color]","color","#ast-scroll-top"),astra_css("astra-settings[scroll-to-top-icon-bg-color]","background-color","#ast-scroll-top"),astra_css("astra-settings[scroll-to-top-icon-h-color]","color","#ast-scroll-top:hover"),astra_css("astra-settings[scroll-to-top-icon-h-bg-color]","background-color","#ast-scroll-top:hover"),wp.customize("astra-settings[scroll-to-top-icon-radius-fields]",function(t){t.bind(function(t){var o=astraBuilderPreview.tablet_break_point||768,s="",s=(s=(s+=" #ast-scroll-top { border-top-left-radius :"+t.desktop.top+t["desktop-unit"]+"; border-bottom-right-radius :"+t.desktop.bottom+t["desktop-unit"]+"; border-bottom-left-radius :"+t.desktop.left+t["desktop-unit"]+"; border-top-right-radius :"+t.desktop.right+t["desktop-unit"]+"; } ")+("@media (max-width: "+o+"px) { #ast-scroll-top { border-top-left-radius :"+t.tablet.top+t["tablet-unit"]+"; border-bottom-right-radius :"+t.tablet.bottom+t["tablet-unit"]+"; border-bottom-left-radius :"+t.tablet.left+t["tablet-unit"]+"; border-top-right-radius :"+t.tablet.right+t["tablet-unit"]+"; } }"))+("@media (max-width: "+(astraBuilderPreview.mobile_break_point||544)+"px) { #ast-scroll-top { border-top-left-radius :"+t.mobile.top+t["mobile-unit"]+"; border-bottom-right-radius :"+t.mobile.bottom+t["mobile-unit"]+"; border-bottom-left-radius :"+t.mobile.left+t["mobile-unit"]+"; border-top-right-radius :"+t.mobile.right+t["mobile-unit"]+"; } }");astra_add_dynamic_css("scroll-to-top-icon-radius-fields",s)})}),wp.customize("astra-settings[scroll-to-top-icon-position]",function(t){t.bind(function(t){jQuery("#ast-scroll-top").removeClass("ast-scroll-to-top-right ast-scroll-to-top-left"),jQuery("#ast-scroll-top").addClass("ast-scroll-to-top-"+t)})});

View File

@@ -0,0 +1,50 @@
/**
* 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( $ ) {
astra_css(
'astra-settings[scroll-to-top-icon-size]',
'font-size',
'#ast-scroll-top',
'px'
);
astra_css( 'astra-settings[scroll-to-top-icon-color]', 'color', '#ast-scroll-top' );
astra_css( 'astra-settings[scroll-to-top-icon-bg-color]', 'background-color', '#ast-scroll-top' );
astra_css( 'astra-settings[scroll-to-top-icon-h-color]', 'color', '#ast-scroll-top:hover' );
astra_css( 'astra-settings[scroll-to-top-icon-h-bg-color]', 'background-color', '#ast-scroll-top:hover' );
// Border Radius Fields for Button.
wp.customize( 'astra-settings[scroll-to-top-icon-radius-fields]', function( value ) {
value.bind( function( border ) {
let tablet_break_point = astraBuilderPreview.tablet_break_point || 768,
mobile_break_point = astraBuilderPreview.mobile_break_point || 544;
let dynamicStyle = '';
dynamicStyle += ' #ast-scroll-top { border-top-left-radius :' + border['desktop']['top'] + border['desktop-unit']
+ '; border-bottom-right-radius :' + border['desktop']['bottom'] + border['desktop-unit'] + '; border-bottom-left-radius :'
+ border['desktop']['left'] + border['desktop-unit'] + '; border-top-right-radius :' + border['desktop']['right'] + border['desktop-unit'] + '; } ';
dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) { #ast-scroll-top { border-top-left-radius :' + border['tablet']['top'] + border['tablet-unit']
+ '; border-bottom-right-radius :' + border['tablet']['bottom'] + border['tablet-unit'] + '; border-bottom-left-radius :'
+ border['tablet']['left'] + border['tablet-unit'] + '; border-top-right-radius :' + border['tablet']['right'] + border['tablet-unit'] + '; } }';
dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) { #ast-scroll-top { border-top-left-radius :' + border['mobile']['top'] + border['mobile-unit']
+ '; border-bottom-right-radius :' + border['mobile']['bottom'] + border['mobile-unit'] + '; border-bottom-left-radius :'
+ border['mobile']['left'] + border['mobile-unit'] + '; border-top-right-radius :' + border['mobile']['right'] + border['mobile-unit'] + '; } }';
astra_add_dynamic_css( 'scroll-to-top-icon-radius-fields', dynamicStyle );
} );
} );
// Scroll to top position.
wp.customize( 'astra-settings[scroll-to-top-icon-position]', function( value ) {
value.bind( function( position ) {
jQuery("#ast-scroll-top").removeClass("ast-scroll-to-top-right ast-scroll-to-top-left");
jQuery("#ast-scroll-top").addClass("ast-scroll-to-top-"+position);
} );
} );
} )( jQuery );

View File

@@ -0,0 +1,59 @@
/**
* Scroll To Top
*
* @package Astra
* @since 1.0.0
*/
document.addEventListener("DOMContentLoaded", function() {
var masthead = document.querySelector( '#page header' );
var astScrollTop = document.getElementById( 'ast-scroll-top' );
if ( astScrollTop ) {
astScrollToTop = function () {
var content = getComputedStyle(astScrollTop).content,
device = astScrollTop.dataset.onDevices;
content = content.replace( /[^0-9]/g, '' );
if( 'both' == device || ( 'desktop' == device && '769' == content ) || ( 'mobile' == device && '' == content ) ) {
// Get current window / document scroll.
var scrollTop = window.pageYOffset || document.body.scrollTop;
// If masthead found.
if( masthead && masthead.length ){
if (scrollTop > masthead.offsetHeight + 100) {
astScrollTop.style.display = "block";
} else {
astScrollTop.style.display = "none";
}
}
else{
// If there is no masthead set default start scroll
if ( window.pageYOffset > 300 ) {
astScrollTop.style.display = "block";
} else {
astScrollTop.style.display = "none";
}
}
} else {
astScrollTop.style.display = "none";
}
};
astScrollToTop();
window.addEventListener('scroll', function () {
astScrollToTop();
});
astScrollTop.onclick = function(e){
e.preventDefault();
window.scrollTo({
top: 0,
left: 0,
behavior: 'smooth'
});
};
}
});

View File

@@ -0,0 +1,56 @@
<?php
/**
* Scroll To Top Addon
*
* @since 4.0.0
* @package Astra
*/
define( 'ASTRA_SCROLL_TO_TOP_DIR', ASTRA_THEME_DIR . 'inc/addons/scroll-to-top/' );
define( 'ASTRA_SCROLL_TO_TOP_URL', ASTRA_THEME_URI . 'inc/addons/scroll-to-top/' );
/**
* Scroll To Top Initial Setup
*
* @since 4.0.0
*/
class Astra_Scroll_To_Top {
/**
* Member Variable
*
* @var null $instance
*/
private static $instance;
/**
* Initiator
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
/** @psalm-suppress InvalidPropertyAssignmentValue */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
self::$instance = new self();
/** @psalm-suppress InvalidPropertyAssignmentValue */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
}
return self::$instance;
}
/**
* Constructor function that initializes required actions and hooks
*/
public function __construct() {
require_once ASTRA_SCROLL_TO_TOP_DIR . 'classes/class-astra-scroll-to-top-loader.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound -- Not a template file so loading in a normal way.
// Include front end files.
if ( ! is_admin() ) {
require_once ASTRA_SCROLL_TO_TOP_DIR . 'css/static-css.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound -- Not a template file so loading in a normal way.
require_once ASTRA_SCROLL_TO_TOP_DIR . 'css/dynamic-css.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound -- Not a template file so loading in a normal way.
}
}
}
/**
* Kicking this off by calling 'get_instance()' method.
*/
Astra_Scroll_To_Top::get_instance();

View File

@@ -0,0 +1,134 @@
<?php
/**
* Scroll to Top - Customizer.
*
* @package Astra
* @since 4.0.0
*/
/**
* Customizer Initialization
*
* @since 4.0.0
*/
class Astra_Scroll_To_Top_Loader {
/**
* Member Variable
*
* @var null $instance
*/
private static $instance;
/**
* Initiator
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
/** @psalm-suppress InvalidPropertyAssignmentValue */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
self::$instance = new self();
/** @psalm-suppress InvalidPropertyAssignmentValue */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
}
return self::$instance;
}
/**
* Constructor
*
* @since 4.0.0
*/
public function __construct() {
add_filter( 'astra_theme_defaults', array( $this, 'theme_defaults' ) );
add_action( 'customize_register', array( $this, 'new_customize_register' ), 2 );
add_action( 'customize_preview_init', array( $this, 'preview_scripts' ) );
add_action( 'wp_footer', array( $this, 'html_markup_loader' ) );
}
/**
* Set Options Default Values
*
* @param array $defaults Astra options default value array.
* @return array
* @since 4.0.0
*/
public function theme_defaults( $defaults ) {
$astra_options = Astra_Theme_Options::get_astra_options();
$defaults['scroll-to-top-enable'] = true;
$defaults['scroll-to-top-icon-size'] = 15;
$defaults['scroll-to-top-icon-position'] = 'right';
$defaults['scroll-to-top-on-devices'] = 'both';
$defaults['scroll-to-top-icon-radius-fields'] = array(
'desktop' => array(
'top' => ! isset( $astra_options['scroll-to-top-icon-radius'] ) ? '' : $astra_options['scroll-to-top-icon-radius'],
'right' => ! isset( $astra_options['scroll-to-top-icon-radius'] ) ? '' : $astra_options['scroll-to-top-icon-radius'],
'bottom' => ! isset( $astra_options['scroll-to-top-icon-radius'] ) ? '' : $astra_options['scroll-to-top-icon-radius'],
'left' => ! isset( $astra_options['scroll-to-top-icon-radius'] ) ? '' : $astra_options['scroll-to-top-icon-radius'],
),
'tablet' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'mobile' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'desktop-unit' => 'px',
'tablet-unit' => 'px',
'mobile-unit' => 'px',
);
$defaults['scroll-to-top-icon-color'] = '';
$defaults['scroll-to-top-icon-h-color'] = '';
$defaults['scroll-to-top-icon-bg-color'] = '';
$defaults['scroll-to-top-icon-h-bg-color'] = '';
return $defaults;
}
/**
* Add customizer configs for scroll to top in the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
* @since 4.0.0
*/
public function new_customize_register( $wp_customize ) {
require_once ASTRA_SCROLL_TO_TOP_DIR . 'classes/customizer/class-astra-scroll-to-top-configs.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound -- Not a template file so loading in a normal way.
}
/**
* Customizer Preview
*
* @since 4.0.0
*/
public function preview_scripts() {
/** @psalm-suppress RedundantCondition */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
if ( SCRIPT_DEBUG ) {
/** @psalm-suppress RedundantCondition */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
wp_enqueue_script( 'astra-scroll-to-top-customize-preview-js', ASTRA_SCROLL_TO_TOP_URL . 'assets/js/unminified/customizer-preview.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true );
} else {
wp_enqueue_script( 'astra-scroll-to-top-customize-preview-js', ASTRA_SCROLL_TO_TOP_URL . 'assets/js/minified/customizer-preview.min.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true );
}
}
/**
* Scroll to Top addon markup loader
*
* Loads appropriate template file based on the style option selected in options panel.
*
* @since 4.0.0
*/
public function html_markup_loader() {
if ( true === astra_get_option( 'scroll-to-top-enable', true ) ) {
get_template_part( 'template-parts/scroll-to-top' );
}
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
Astra_Scroll_To_Top_Loader::get_instance();

View File

@@ -0,0 +1,310 @@
<?php
/**
* Scroll To Top Options for our theme.
*
* @package Astra
* @link https://www.brainstormforce.com
* @since 4.0.0
*/
// Block direct access to the file.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Bail if Customizer config base class does not exist.
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
return;
}
/**
* Register Scroll To Top Customizer Configurations.
*/
class Astra_Scroll_To_Top_Configs extends Astra_Customizer_Config_Base {
/**
* Register Scroll To Top Customizer Configurations.
*
* @param Array $configurations Astra Customizer Configurations.
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
* @since 4.0.0
* @return Array Astra Customizer Configurations with updated configurations.
*/
public function register_configuration( $configurations, $wp_customize ) {
$_configs = array(
/**
* Option: Enable Scroll To Top
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
'default' => astra_get_option( 'scroll-to-top-enable' ),
'type' => 'control',
'section' => 'section-scroll-to-top',
'title' => __( 'Enable Scroll to Top', 'astra' ),
'priority' => 1,
'control' => 'ast-toggle-control',
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
),
/**
* Option: Scroll to Top Display On
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[scroll-to-top-on-devices]',
'default' => astra_get_option( 'scroll-to-top-on-devices' ),
'type' => 'control',
'control' => 'ast-selector',
'section' => 'section-scroll-to-top',
'priority' => 10,
'title' => __( 'Display On', 'astra' ),
'choices' => array(
'desktop' => __( 'Desktop', 'astra' ),
'mobile' => __( 'Mobile', 'astra' ),
'both' => __( 'Desktop + Mobile', 'astra' ),
),
'renderAs' => 'text',
'responsive' => false,
'divider' => array( 'ast_class' => 'ast-top-section-divider ast-bottom-section-divider' ),
'context' => array(
'relation' => 'AND',
Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
'operator' => '==',
'value' => true,
),
),
),
/**
* Option: Scroll to Top Position
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[scroll-to-top-icon-position]',
'default' => astra_get_option( 'scroll-to-top-icon-position' ),
'type' => 'control',
'control' => 'ast-selector',
'transport' => 'postMessage',
'section' => 'section-scroll-to-top',
'title' => __( 'Position', 'astra' ),
'choices' => array(
'left' => __( 'Left', 'astra' ),
'right' => __( 'Right', 'astra' ),
),
'priority' => 11,
'responsive' => false,
'renderAs' => 'text',
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
'context' => array(
'relation' => 'AND',
Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
'operator' => '==',
'value' => true,
),
),
),
/**
* Option: Scroll To Top Icon Size
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[scroll-to-top-icon-size]',
'default' => astra_get_option( 'scroll-to-top-icon-size' ),
'type' => 'control',
'control' => 'ast-slider',
'transport' => 'postMessage',
'section' => 'section-scroll-to-top',
'title' => __( 'Icon Size', 'astra' ),
'suffix' => 'px',
'priority' => 12,
'context' => array(
'relation' => 'AND',
Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
'operator' => '==',
'value' => true,
),
),
),
array(
'name' => ASTRA_THEME_SETTINGS . '[scroll-on-top-color-group]',
'default' => astra_get_option( 'scroll-on-top-color-group' ),
'type' => 'control',
'control' => 'ast-color-group',
'title' => __( 'Icon Color', 'astra' ),
'section' => 'section-scroll-to-top',
'context' => array(
'relation' => 'AND',
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
'operator' => '==',
'value' => true,
),
),
'priority' => 1,
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
),
array(
'name' => ASTRA_THEME_SETTINGS . '[scroll-on-top-bg-color-group]',
'default' => astra_get_option( 'scroll-on-top-bg-color-group' ),
'type' => 'control',
'control' => 'ast-color-group',
'title' => __( 'Background Color', 'astra' ),
'section' => 'section-scroll-to-top',
'transport' => 'postMessage',
'context' => array(
'relation' => 'AND',
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
'operator' => '==',
'value' => true,
),
),
'priority' => 1,
),
/**
* Option: Scroll To Top Radius
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[scroll-to-top-icon-radius-fields]',
'default' => astra_get_option( 'scroll-to-top-icon-radius-fields' ),
'type' => 'control',
'control' => 'ast-responsive-spacing',
'transport' => 'postMessage',
'section' => 'section-scroll-to-top',
'title' => __( 'Border Radius', 'astra' ),
'suffix' => 'px',
'priority' => 1,
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
'context' => array(
'relation' => 'AND',
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
'operator' => '==',
'value' => true,
),
),
'linked_choices' => true,
'unit_choices' => array( 'px', 'em', '%' ),
'choices' => array(
'top' => __( 'Top', 'astra' ),
'right' => __( 'Right', 'astra' ),
'bottom' => __( 'Bottom', 'astra' ),
'left' => __( 'Left', 'astra' ),
),
'connected' => false,
),
/**
* Option: Icon Color
*/
array(
'name' => 'scroll-to-top-icon-color',
'default' => astra_get_option( 'scroll-to-top-icon-color' ),
'type' => 'sub-control',
'priority' => 1,
'parent' => ASTRA_THEME_SETTINGS . '[scroll-on-top-color-group]',
'section' => 'section-scroll-to-top',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'transport' => 'postMessage',
'title' => __( 'Color', 'astra' ),
),
/**
* Option: Icon Background Color
*/
array(
'name' => 'scroll-to-top-icon-bg-color',
'default' => astra_get_option( 'scroll-to-top-icon-bg-color' ),
'type' => 'sub-control',
'priority' => 1,
'parent' => ASTRA_THEME_SETTINGS . '[scroll-on-top-bg-color-group]',
'section' => 'section-scroll-to-top',
'transport' => 'postMessage',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'title' => __( 'Color', 'astra' ),
),
/**
* Option: Icon Hover Color
*/
array(
'name' => 'scroll-to-top-icon-h-color',
'default' => astra_get_option( 'scroll-to-top-icon-h-color' ),
'type' => 'sub-control',
'priority' => 1,
'parent' => ASTRA_THEME_SETTINGS . '[scroll-on-top-color-group]',
'section' => 'section-scroll-to-top',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'transport' => 'postMessage',
'title' => __( 'Hover Color', 'astra' ),
),
/**
* Option: Link Hover Background Color
*/
array(
'name' => 'scroll-to-top-icon-h-bg-color',
'default' => astra_get_option( 'scroll-to-top-icon-h-bg-color' ),
'type' => 'sub-control',
'priority' => 1,
'parent' => ASTRA_THEME_SETTINGS . '[scroll-on-top-bg-color-group]',
'section' => 'section-scroll-to-top',
'control' => 'ast-color',
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
'transport' => 'postMessage',
'title' => __( 'Hover Color', 'astra' ),
),
);
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
$_configs[] = array(
'name' => 'section-scroll-to-top-ast-context-tabs',
'section' => 'section-scroll-to-top',
'type' => 'control',
'control' => 'ast-builder-header-control',
'priority' => 0,
'description' => '',
);
$_configs[] = array(
'name' => ASTRA_THEME_SETTINGS . '[enable-scroll-to-top-notice]',
'type' => 'control',
'control' => 'ast-description',
'section' => 'section-scroll-to-top',
'priority' => 1,
'label' => '',
'help' => __( 'Note: To get design settings in action make sure to enable Scroll to Top.', 'astra' ),
'context' => array(
'relation' => 'AND',
Astra_Builder_Helper::$design_tab_config,
array(
'setting' => ASTRA_THEME_SETTINGS . '[scroll-to-top-enable]',
'operator' => '!=',
'value' => true,
),
),
);
}
$configurations = array_merge( $configurations, $_configs );
return $configurations;
}
}
/** Creating instance for getting customizer configs. */
new Astra_Scroll_To_Top_Configs();

View File

@@ -0,0 +1,110 @@
<?php
/**
* Scroll To Top - Dynamic CSS
*
* @package Astra
*/
add_filter( 'astra_dynamic_theme_css', 'astra_scroll_to_top_dynamic_css', 11 );
/**
* Dynamic CSS
*
* @param string $dynamic_css Astra Dynamic CSS.
* @param string $dynamic_css_filtered Astra Dynamic CSS Filters.
* @return string
*/
function astra_scroll_to_top_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {
if ( true !== astra_get_option( 'scroll-to-top-enable', true ) ) {
return $dynamic_css;
}
$link_color = astra_get_option( 'link-color' );
$scroll_to_top_icon_size = astra_get_option( 'scroll-to-top-icon-size', 15 );
$scroll_to_top_icon_radius_fields = astra_get_option( 'scroll-to-top-icon-radius-fields' );
$scroll_to_top_icon_color = astra_get_option( 'scroll-to-top-icon-color' );
$scroll_to_top_icon_h_color = astra_get_option( 'scroll-to-top-icon-h-color' );
$scroll_to_top_icon_bg_color = astra_get_option( 'scroll-to-top-icon-bg-color', $link_color );
$scroll_to_top_icon_h_bg_color = astra_get_option( 'scroll-to-top-icon-h-bg-color' );
$scroll_to_top = array(
'#ast-scroll-top' => array(
'color' => $scroll_to_top_icon_color,
'background-color' => $scroll_to_top_icon_bg_color,
'font-size' => astra_get_css_value( $scroll_to_top_icon_size, 'px' ),
'border-top-left-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'top', 'desktop' ),
'border-top-right-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'right', 'desktop' ),
'border-bottom-right-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'bottom', 'desktop' ),
'border-bottom-left-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'left', 'desktop' ),
),
'#ast-scroll-top:hover' => array(
'color' => $scroll_to_top_icon_h_color,
'background-color' => $scroll_to_top_icon_h_bg_color,
),
);
$scroll_css = astra_parse_css( $scroll_to_top );
$scroll_to_top_tablet = array(
'#ast-scroll-top' => array(
'border-top-left-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'top', 'tablet' ),
'border-top-right-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'right', 'tablet' ),
'border-bottom-right-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'bottom', 'tablet' ),
'border-bottom-left-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'left', 'tablet' ),
),
);
/* Parse CSS from array() -> max-width: (tablet-breakpoint) px CSS */
$scroll_css .= astra_parse_css( $scroll_to_top_tablet, '', astra_get_tablet_breakpoint() );
$scroll_to_top_mobile = array(
'#ast-scroll-top' => array(
'border-top-left-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'top', 'mobile' ),
'border-top-right-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'right', 'mobile' ),
'border-bottom-right-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'bottom', 'mobile' ),
'border-bottom-left-radius' => astra_responsive_spacing( $scroll_to_top_icon_radius_fields, 'left', 'mobile' ),
),
);
/* Parse CSS from array() -> max-width: (mobile-breakpoint) px CSS */
$scroll_css .= astra_parse_css( $scroll_to_top_mobile, '', astra_get_mobile_breakpoint() );
if ( is_rtl() ) {
$scroll_to_top_rtl = array(
'#ast-scroll-top .ast-icon.icon-arrow svg' => array(
'margin-right' => '0px',
),
);
$scroll_css .= astra_parse_css( $scroll_to_top_rtl );
}
if ( false === Astra_Icons::is_svg_icons() ) {
$scroll_to_top_icon = array(
'.ast-scroll-top-icon::before' => array(
'content' => '"\e900"',
'font-family' => 'Astra',
'text-decoration' => 'inherit',
),
'.ast-scroll-top-icon' => array(
'transform' => 'rotate(180deg)',
),
);
$scroll_css .= astra_parse_css( $scroll_to_top_icon );
}
// Only if responsive devices is selected.
$svg_width = array(
/**
* Add spacing based on padded layout spacing
*/
'#ast-scroll-top .ast-icon.icon-arrow svg' => array(
'width' => '1em',
),
);
$scroll_css .= astra_parse_css( $svg_width, '', astra_get_tablet_breakpoint() );
return $dynamic_css . $scroll_css;
}

View File

@@ -0,0 +1,71 @@
<?php
/**
* Scroll to Top - Static CSS
*
* @package Astra
*
* @since 4.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
add_filter( 'astra_dynamic_theme_css', 'astra_scroll_to_top_static_css', 11 );
/**
* Scroll to Top - Static CSS
*
* @param string $dynamic_css Astra Dynamic CSS.
* @return String Generated dynamic CSS for Scroll to Top.
*
* @since 4.0.0
*/
function astra_scroll_to_top_static_css( $dynamic_css ) {
if ( true !== astra_get_option( 'scroll-to-top-enable', true ) ) {
return $dynamic_css;
}
$is_site_rtl = is_rtl() ? true : false;
$ltr_left = $is_site_rtl ? 'right' : 'left';
$ltr_right = $is_site_rtl ? 'left' : 'right';
$dynamic_css .= '
#ast-scroll-top {
display: none;
position: fixed;
text-align: center;
cursor: pointer;
z-index: 99;
width: 2.1em;
height: 2.1em;
line-height: 2.1;
color: #ffffff;
border-radius: 2px;
content: "";
outline: inherit;
}
@media (min-width: 769px) {
#ast-scroll-top {
content: "769";
}
}
#ast-scroll-top .ast-icon.icon-arrow svg {
margin-' . esc_attr( $ltr_left ) . ': 0px;
vertical-align: middle;
transform: translate(0, -20%) rotate(180deg);
width: 1.6em;
}
.ast-scroll-to-top-right {
' . esc_attr( $ltr_right ) . ': 30px;
bottom: 30px;
}
.ast-scroll-to-top-left {
' . esc_attr( $ltr_left ) . ': 30px;
bottom: 30px;
}
';
return $dynamic_css;
}

View File

@@ -0,0 +1,286 @@
/**
* 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 1.0.0
*/
( function( $ ) {
var isAstraHFBuilderActive = AstraBuilderTransparentData.is_astra_hf_builder_active || false;
/**
* Transparent Logo Width
*/
wp.customize( 'astra-settings[transparent-header-logo-width]', function( setting ) {
setting.bind( function( logo_width ) {
if ( logo_width['desktop'] != '' || logo_width['tablet'] != '' || logo_width['mobile'] != '' ) {
var dynamicStyle = '.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo img {max-width: ' + logo_width['desktop'] + 'px;} .ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo .astra-logo-svg { width: ' + logo_width['desktop'] + 'px;} @media( max-width: 768px ) { .ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo img {max-width: ' + logo_width['tablet'] + 'px;} .ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo .astra-logo-svg { width: ' + logo_width['tablet'] + 'px;} } @media( max-width: 544px ) { .ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo img {max-width: ' + logo_width['mobile'] + 'px;} .ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo .astra-logo-svg { width: ' + logo_width['mobile'] + 'px;} }';
astra_add_dynamic_css( 'transparent-header-logo-width', dynamicStyle );
}
else{
wp.customize.preview.send( 'refresh' );
}
} );
} );
// Transparent header for device.
const device = AstraBuilderTransparentData.transparent_header_devices;
let deviceSelector = '';
switch( device ) {
case 'mobile' :
deviceSelector = '.ast-header-break-point';
break;
case 'desktop' :
deviceSelector = ':not(.ast-header-break-point)';
break;
}
/* Transparent Header Colors */
astra_color_responsive_css( 'colors-background', 'astra-settings[primary-menu-a-bg-color-responsive]', 'background-color', '.main-header-menu .current-menu-item > .menu-link, .main-header-menu .current-menu-ancestor > .menu-link,.ast-header-sections-navigation .menu-item.current-menu-item > .menu-link,.ast-header-sections-navigation .menu-item.current-menu-ancestor > .menu-link' );
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-header-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header' + deviceSelector + ' .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-menu, .ast-theme-transparent-header' + deviceSelector + ' .main-header-bar-wrap .main-header-bar, .ast-theme-transparent-header' + ( device === 'both' ? '.ast-header-break-point' : deviceSelector ) + ' .ast-mobile-header-wrap .main-header-bar' );
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-header-color-site-title-responsive]', 'color', '.ast-theme-transparent-header .site-title a, .ast-theme-transparent-header .site-title a:focus, .ast-theme-transparent-header .site-title a:hover, .ast-theme-transparent-header .site-title a:visited, .ast-theme-transparent-header .site-header .site-description' );
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-header-color-h-site-title-responsive]', 'color', '.ast-theme-transparent-header .site-header .site-title a:hover' );
// Primary Menu
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-menu-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-bar-wrap .main-header-menu, .ast-flyout-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation .site-navigation, .ast-fullscreen-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation .site-navigation, .ast-flyout-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap .ast-above-header-navigation, .ast-flyout-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap .ast-below-header-actual-nav, .ast-fullscreen-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap, .ast-fullscreen-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap, .ast-theme-transparent-header .main-header-menu .menu-link' );
astra_color_responsive_css( 'transparent-primary-header-menu-colors', 'astra-settings[transparent-menu-color-responsive]', 'color', '.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item > .menu-link, .ast-theme-transparent-header .ast-masthead-custom-menu-items, .ast-theme-transparent-header .ast-masthead-custom-menu-items a, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-link' );
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-menu-h-color-responsive]', 'color', '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-ancestor > .menu-link' );
// Primary SubMenu
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-submenu-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .sub-menu, .ast-header-break-point.ast-theme-transparent-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .sub-menu .menu-link, .ast-header-break-point.ast-theme-transparent-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-theme-transparent-header .main-header-menu .menu-item .sub-menu' );
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-submenu-color-responsive]', 'color', '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item .menu-link,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item > .ast-menu-toggle, .astra-hfb-header.ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .sub-menu .menu-item .menu-link, .astra-hfb-header.ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .sub-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link' );
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-submenu-h-color-responsive]', 'color', '.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu a:hover,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .menu-item, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .ast-menu-toggle,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover .menu-link' );
// Style guide main header logo preview.
var primaryHeaderWrap = document.querySelector( ".ast-main-header-wrap.main-header-bar-wrap ");
if ( primaryHeaderWrap && primaryHeaderWrap.querySelector(".site-logo-img") ) {
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-header-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header' + deviceSelector + ' .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-menu, .ast-theme-transparent-header' + deviceSelector + ' .main-header-bar-wrap .main-header-bar, .ast-theme-transparent-header' + ( device === 'both' ? '.ast-header-break-point' : deviceSelector ) + ' .ast-mobile-header-wrap .main-header-bar, .ast-theme-transparent-header .ast-sg-element-wrap.ast-sg-logo-section' );
}
// Primary Content Section text color
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-content-section-text-color-responsive]', 'color', '.ast-theme-transparent-header div.ast-masthead-custom-menu-items, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget-title, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element' );
// Primary Content Section link color
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-content-section-link-color-responsive]', 'color', '.ast-theme-transparent-header div.ast-masthead-custom-menu-items a, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element a' );
// Primary Content Section link hover color
astra_color_responsive_css( 'transparent-primary-header', 'astra-settings[transparent-content-section-link-h-color-responsive]', 'color', '.ast-theme-transparent-header div.ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a:hover, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element a:hover' );
// Above Header Menu
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[hba-transparent-header-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header' + deviceSelector + ' .ast-above-header-wrap .ast-above-header, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-wrap .main-header-menu' );
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[transparent-menu-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header .ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-section-separated .ast-above-header-navigation ul, .ast-flyout-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap .ast-above-header-navigation, .ast-fullscreen-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-section-separated .ast-above-header-navigation-wrap' );
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[transparent-menu-color-responsive]', 'color', '.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation > ul.ast-above-header-menu > .menu-item-has-children:not(.current-menu-item) > .ast-menu-toggle' );
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[transparent-menu-h-color-responsive]', 'color', '.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-above-header-navigation .menu-item:hover > .menu-link' )
// Above Header SubMenu
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[transparent-submenu-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header .ast-above-header-menu .sub-menu' );
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[transparent-submenu-color-responsive]', 'color', '.ast-theme-transparent-header .ast-above-header-menu .sub-menu, .ast-theme-transparent-header .ast-above-header-navigation .ast-above-header-menu .sub-menu a' );
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[transparent-submenu-h-color-responsive]', 'color', '.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .ast-menu-toggle,.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle,.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' );
// Above Header Content Section text color
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[transparent-content-section-text-color-responsive]', 'color', '.ast-theme-transparent-header .ast-above-header-section .user-select, .ast-theme-transparent-header .ast-above-header-section .widget, .ast-theme-transparent-header .ast-above-header-section .widget-title' );
// Above Header Content Section link color
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[transparent-content-section-link-color-responsive]', 'color', '.ast-theme-transparent-header .ast-above-header-section .user-select a, .ast-theme-transparent-header .ast-above-header-section .widget a' );
// Above Header Content Section link hover color
astra_color_responsive_css( 'transparent-above-header', 'astra-settings[transparent-content-section-link-h-color-responsive]', 'color', '.ast-theme-transparent-header .ast-above-header-section .user-select a:hover, .ast-theme-transparent-header .ast-above-header-section .widget a:hover' );
// Style guide above header logo preview.
var aboveHeaderWrap = document.querySelector( ".ast-above-header-wrap");
if ( aboveHeaderWrap && aboveHeaderWrap.querySelector(".site-logo-img") ) {
astra_color_responsive_css( "transparent-above-header", "astra-settings[hba-transparent-header-bg-color-responsive]", "background-color", " .ast-theme-transparent-header" + deviceSelector + " .ast-above-header-wrap .ast-above-header, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-wrap .main-header-menu, .ast-theme-transparent-header .ast-sg-element-wrap.ast-sg-logo-section" );
}
// below Header Menu
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[hbb-transparent-header-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header' + deviceSelector + ' .ast-below-header-wrap .ast-below-header, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-wrap .main-header-menu' );
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[transparent-menu-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header.ast-no-toggle-below-menu-enable.ast-header-break-point .ast-below-header-navigation-wrap, .ast-theme-transparent-header .ast-below-header-actual-nav, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-actual-nav, .ast-flyout-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap .ast-below-header-actual-nav, .ast-fullscreen-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-section-separated .ast-below-header-navigation-wrap' );
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[transparent-menu-color-responsive]', 'color', '.ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu' );
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[transparent-menu-h-color-responsive]', 'color', '.ast-theme-transparent-header .ast-below-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.focus > .menu-link,.ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' );
// below Header SubMenu
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[transparent-submenu-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header .ast-below-header-menu .sub-menu' );
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[transparent-submenu-color-responsive]', 'color', '.ast-theme-transparent-header .ast-below-header-menu .sub-menu, .ast-theme-transparent-header .ast-below-header-menu .sub-menu a' );
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[transparent-submenu-h-color-responsive]', 'color', '.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' );
// below Header Content Section text color
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[transparent-content-section-text-color-responsive]', 'color', '', '.ast-theme-transparent-header .below-header-user-select, .ast-theme-transparent-header .below-header-user-select .widget,.ast-theme-transparent-header .below-header-user-select .widget-title' );
// below Header Content Section link color
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[transparent-content-section-link-color-responsive]', 'color', '', '.ast-theme-transparent-header .below-header-user-select a, .ast-theme-transparent-header .below-header-user-select .widget a' );
// below Header Content Section link hover color
astra_color_responsive_css( 'below-transparent-header', 'astra-settings[transparent-content-section-link-h-color-responsive]', 'color', '.ast-theme-transparent-header .below-header-user-select a:hover, .ast-theme-transparent-header .below-header-user-select .widget a:hover' );
// Style guide below header logo preview.
var belowHeaderWrap = document.querySelector( ".ast-below-header-wrap ");
if ( belowHeaderWrap && belowHeaderWrap.querySelector(".site-logo-img") ) {
astra_color_responsive_css( 'transparent-below-header', 'astra-settings[hbb-transparent-header-bg-color-responsive]', 'background-color', '.ast-theme-transparent-header' + deviceSelector + ' .ast-below-header-wrap .ast-below-header, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-wrap .main-header-menu, .ast-theme-transparent-header .ast-sg-element-wrap.ast-sg-logo-section' );
}
/**
* Button border
*/
wp.customize( 'astra-settings[primary-header-button-border-group]', function( value ) {
value.bind( function( value ) {
var optionValue = JSON.parse(value);
var border = optionValue['header-main-rt-section-button-border-size'];
if( '' != border.top || '' != border.right || '' != border.bottom || '' != border.left ) {
var dynamicStyle = '.main-header-bar .ast-container .button-custom-menu-item .ast-custom-button-link .ast-custom-button';
dynamicStyle += '{';
dynamicStyle += 'border-top-width:' + border.top + 'px;';
dynamicStyle += 'border-right-width:' + border.right + 'px;';
dynamicStyle += 'border-left-width:' + border.left + 'px;';
dynamicStyle += 'border-bottom-width:' + border.bottom + 'px;';
dynamicStyle += 'border-style: solid;';
dynamicStyle += '}';
astra_add_dynamic_css( 'header-main-rt-section-button-border-size', dynamicStyle );
}
} );
} );
astra_css( 'astra-settings[header-main-rt-trans-section-button-text-color]', 'color', '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' );
astra_css( 'astra-settings[header-main-rt-trans-section-button-back-color]', 'background-color', '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' );
astra_css( 'astra-settings[header-main-rt-trans-section-button-text-h-color]', 'color', '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button:hover' );
astra_css( 'astra-settings[header-main-rt-trans-section-button-back-h-color]', 'background-color', '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button:hover' );
astra_css( 'astra-settings[header-main-rt-trans-section-button-border-radius]', 'border-radius', '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button', 'px' );
astra_css( 'astra-settings[header-main-rt-trans-section-button-border-color]', 'border-color', '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' );
astra_css( 'astra-settings[header-main-rt-trans-section-button-border-h-color]', 'border-color', '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button:hover' );
astra_responsive_spacing( 'astra-settings[header-main-rt-trans-section-button-padding]','.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button', 'padding', ['top', 'right', 'bottom', 'left' ] );
/**
* Transparent Header > Elements preview styles.
*/
astra_css( 'astra-settings[transparent-header-divider-color]', 'border-color', '.ast-theme-transparent-header .ast-header-divider-element .ast-divider-wrapper' );
astra_css( 'astra-settings[transparent-header-html-text-color]', 'color', '.ast-theme-transparent-header [CLASS*="ast-header-html-"] .ast-builder-html-element' );
astra_css( 'astra-settings[transparent-header-html-link-color]', 'color', '.ast-theme-transparent-header [CLASS*="ast-header-html-"] .ast-builder-html-element a' );
astra_css( 'astra-settings[transparent-header-html-link-h-color]', 'color', '.ast-theme-transparent-header [CLASS*="ast-header-html-"] .ast-builder-html-element a:hover' );
astra_css( 'astra-settings[transparent-header-search-icon-color]', 'color', '.ast-theme-transparent-header .ast-header-search .astra-search-icon, .ast-theme-transparent-header .ast-header-search .ast-icon' );
astra_css( 'astra-settings[transparent-header-search-box-placeholder-color]', 'color', '.ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-field, .ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-field::placeholder' );
astra_css( 'astra-settings[transparent-header-search-box-background-color]', 'background-color', '.ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-field, .ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-form, .ast-theme-transparent-header .ast-header-search .ast-search-menu-icon .search-submit' );
astra_color_responsive_css( 'transparent-header-social-color', 'astra-settings[transparent-header-social-icons-bg-color]', 'background', '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element' );
astra_color_responsive_css( 'transparent-header-social-color', 'astra-settings[transparent-header-social-icons-color]', 'fill', '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element svg' );
astra_color_responsive_css( 'transparent-header-social-color-label', 'astra-settings[transparent-header-social-icons-color]', 'color', '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element .social-item-label' );
astra_color_responsive_css( 'transparent-header-social-color', 'astra-settings[transparent-header-social-icons-bg-h-color]', 'background', '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover' );
astra_color_responsive_css( 'transparent-header-social-color', 'astra-settings[transparent-header-social-icons-h-color]', 'fill', '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover svg' );
astra_color_responsive_css( 'transparent-header-social-color-label-h', 'astra-settings[transparent-header-social-icons-h-color]', 'color', '.ast-theme-transparent-header .ast-header-social-wrap .ast-social-color-type-custom .ast-builder-social-element:hover .social-item-label' );
astra_css( 'astra-settings[transparent-header-widget-title-color]', 'color', '.ast-theme-transparent-header .widget-area.header-widget-area .widget-title' );
if( AstraBuilderTransparentData.is_flex_based_css ) {
var transparent_header_widget = '.ast-theme-transparent-header .widget-area.header-widget-area.header-widget-area-inner';
}else{
var transparent_header_widget = '.ast-theme-transparent-header .widget-area.header-widget-area. header-widget-area-inner';
}
astra_css( 'astra-settings[transparent-header-widget-content-color]', 'color', transparent_header_widget );
astra_css( 'astra-settings[transparent-header-widget-link-color]', 'color', transparent_header_widget + ' a' );
astra_css( 'astra-settings[transparent-header-widget-link-h-color]', 'color', transparent_header_widget + ' a:hover' );
astra_css( 'astra-settings[transparent-header-button-text-color]', 'color', '.ast-theme-transparent-header [CLASS*="ast-header-button-"] .ast-custom-button' );
astra_css( 'astra-settings[transparent-header-button-bg-color]', 'background', '.ast-theme-transparent-header [CLASS*="ast-header-button-"] .ast-custom-button' );
astra_css( 'astra-settings[transparent-header-button-text-h-color]', 'color', '.ast-theme-transparent-header [CLASS*="ast-header-button-"] ..ast-custom-button:hover' );
astra_css( 'astra-settings[transparent-header-button-bg-h-color]', 'background', '.ast-theme-transparent-header [CLASS*="ast-header-button-"] .ast-custom-button:hover' );
astra_css( 'astra-settings[transparent-header-button-border-color]', 'border-color', '.ast-theme-transparent-header [CLASS*="ast-header-button-"] .ast-custom-button' );
astra_css( 'astra-settings[transparent-header-button-border-h-color]', 'border-color', '.ast-theme-transparent-header [CLASS*="ast-header-button-"] ..ast-custom-button:hover' );
/**
* Transparent Header menu-toggle Dynamic CSS.
*/
var toggle_selector = '.ast-theme-transparent-header [data-section="section-header-mobile-trigger"]';
// Trigger Icon Color.
astra_css(
'astra-settings[transparent-header-toggle-btn-color]',
'fill',
toggle_selector + ' .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg'
);
// Trigger Label Color.
astra_css(
'astra-settings[transparent-header-toggle-btn-color]',
'color',
toggle_selector + ' .ast-button-wrap .mobile-menu-wrap .mobile-menu'
);
// Trigger Button Background Color.
astra_css(
'astra-settings[transparent-header-toggle-btn-bg-color]',
'background',
toggle_selector + ' .ast-button-wrap .menu-toggle.ast-mobile-menu-trigger-fill'
);
// Border Color.
astra_css(
'astra-settings[transparent-header-toggle-border-color]',
'border-color',
toggle_selector + ' .ast-button-wrap .menu-toggle.ast-mobile-menu-trigger-outline'
);
// Icon Color.
astra_css(
'astra-settings[transparent-account-icon-color]',
'fill',
'.ast-theme-transparent-header .ast-header-account-wrap .ast-header-account-type-icon .ahfb-svg-iconset svg path:not(.ast-hf-account-unfill), .ast-theme-transparent-header .ast-header-account-wrap .ast-header-account-type-icon .ahfb-svg-iconset svg circle'
);
// logged out text Color.
astra_css(
'astra-settings[transparent-account-type-text-color]',
'color',
'.ast-theme-transparent-header .ast-header-account-wrap .ast-header-account-text'
);
// Menu - Normal Color
astra_css(
'astra-settings[transparent-account-menu-color]',
'color',
'.ast-theme-transparent-header .ast-header-account-wrap .main-header-menu .menu-item > .menu-link'
);
// Menu - Hover Color
astra_css(
'astra-settings[transparent-account-menu-h-color]',
'color',
'.ast-theme-transparent-header .ast-header-account-wrap .main-header-menu .menu-item:hover > .menu-link'
);
// Menu - Active Color
astra_css(
'astra-settings[transparent-account-menu-a-color]',
'color',
'.ast-theme-transparent-header .ast-header-account-wrap .main-header-menu .menu-item.current-menu-item > .menu-link'
);
// Menu - Hover Background
astra_css(
'astra-settings[transparent-account-menu-bg-obj]',
'background',
'.ast-theme-transparent-header .ast-header-account-wrap .account-main-navigation ul'
);
// Menu - Hover Background
astra_css(
'astra-settings[transparent-account-menu-h-bg-color]',
'background',
'.ast-theme-transparent-header .ast-header-account-wrap .account-main-navigation .menu-item:hover > .menu-link'
);
// Menu - Active Background
astra_css(
'astra-settings[transparent-account-menu-a-bg-color]',
'background',
'.ast-theme-transparent-header .ast-header-account-wrap .account-main-navigation .menu-item.current-menu-item > .menu-link'
);
} )( jQuery );

View File

@@ -0,0 +1,64 @@
<?php
/**
* Sticky Header Extension
*
* @package Astra
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
define( 'ASTRA_THEME_TRANSPARENT_HEADER_DIR', ASTRA_THEME_DIR . 'inc/addons/transparent-header/' );
define( 'ASTRA_THEME_TRANSPARENT_HEADER_URI', ASTRA_THEME_URI . 'inc/addons/transparent-header/' );
if ( ! class_exists( 'Astra_Ext_Transparent_Header' ) ) {
/**
* Sticky Header Initial Setup
*
* @since 1.0.0
*/
class Astra_Ext_Transparent_Header {
/**
* Member Variable
*
* @var object instance
*/
private static $instance;
/**
* Initiator
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor function that initializes required actions and hooks
*/
public function __construct() {
// @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/class-astra-ext-transparent-header-loader.php';
require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/class-astra-ext-transparent-header-markup.php';
// Include front end files.
if ( ! is_admin() ) {
require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/dynamic-css/dynamic.css.php';
require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/dynamic-css/header-sections-dynamic.css.php';
}
// @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
Astra_Ext_Transparent_Header::get_instance();
}

View File

@@ -0,0 +1,233 @@
<?php
/**
* Transparent Header - Customizer.
*
* @package Astra
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( ! class_exists( 'Astra_Ext_Transparent_Header_Loader' ) ) {
/**
* Customizer Initialization
*
* @since 1.0.0
*/
class Astra_Ext_Transparent_Header_Loader {
/**
* Member Variable
*
* @var object instance
*/
private static $instance;
/**
* Initiator
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor
*/
public function __construct() {
add_filter( 'astra_theme_defaults', array( $this, 'theme_defaults' ) );
add_action( 'customize_preview_init', array( $this, 'preview_scripts' ) );
add_action( 'customize_register', array( $this, 'customize_register' ), 2 );
}
/**
* Set Options Default Values
*
* @param array $defaults Astra options default value array.
* @return array
*/
public function theme_defaults( $defaults ) {
// Header - Transparent.
$defaults['transparent-header-logo'] = '';
$defaults['transparent-header-retina-logo'] = '';
$defaults['different-transparent-logo'] = 0;
$defaults['different-transparent-retina-logo'] = 0;
$defaults['transparent-header-logo-width'] = array(
'desktop' => 150,
'tablet' => 120,
'mobile' => 100,
);
$defaults['transparent-header-enable'] = 0;
/**
* Old option for 404, search and archive pages.
*
* For default value on separate option this setting is in use.
*/
$defaults['transparent-header-disable-archive'] = 1;
$defaults['transparent-header-disable-latest-posts-index'] = 1;
$defaults['transparent-header-on-devices'] = 'both';
$defaults['transparent-header-main-sep'] = '';
$defaults['transparent-header-main-sep-color'] = '';
/**
* Transparent Header
*/
$defaults['transparent-header-bg-color'] = '';
$defaults['transparent-header-color-site-title'] = '';
$defaults['transparent-header-color-h-site-title'] = '';
$defaults['transparent-menu-bg-color'] = '';
$defaults['transparent-menu-color'] = '';
$defaults['transparent-menu-h-color'] = '';
$defaults['transparent-submenu-bg-color'] = '';
$defaults['transparent-submenu-color'] = '';
$defaults['transparent-submenu-h-color'] = '';
$defaults['transparent-header-logo-color'] = '';
/**
* Transparent Header Responsive Colors
*/
$defaults['transparent-header-bg-color-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['hba-transparent-header-bg-color-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['hbb-transparent-header-bg-color-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['transparent-header-color-site-title-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['transparent-header-color-h-site-title-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['transparent-menu-bg-color-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['transparent-menu-color-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['transparent-menu-h-color-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['transparent-submenu-bg-color-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['transparent-submenu-color-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['transparent-submenu-h-color-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['transparent-content-section-text-color-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['transparent-content-section-link-color-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
$defaults['transparent-content-section-link-h-color-responsive'] = array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
);
return $defaults;
}
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
public function customize_register( $wp_customize ) {
// @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
/**
* Register Panel & Sections
*/
require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/class-astra-transparent-header-panels-and-sections.php';
/**
* Sections
*/
require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/sections/class-astra-customizer-colors-transparent-header-configs.php';
// Check Transparent Header is activated.
require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/sections/class-astra-customizer-transparent-header-configs.php';
// @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
}
/**
* Customizer Preview
*/
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-transparent-header-customizer-preview-js', ASTRA_THEME_TRANSPARENT_HEADER_URI . 'assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true );
// Localize variables for further JS.
wp_localize_script(
'astra-transparent-header-customizer-preview-js',
'AstraBuilderTransparentData',
array(
'is_astra_hf_builder_active' => Astra_Builder_Helper::$is_header_footer_builder_active,
'is_flex_based_css' => Astra_Builder_Helper::apply_flex_based_css(),
'transparent_header_devices' => astra_get_option( 'transparent-header-on-devices' ),
)
);
}
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
Astra_Ext_Transparent_Header_Loader::get_instance();

View File

@@ -0,0 +1,398 @@
<?php
/**
* Transparent Header Markup
*
* @package Astra
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( ! class_exists( 'Astra_ExtTransparenty_Header_Markup' ) ) {
/**
* Transparent Header Markup Initial Setup
*
* @since 1.0.0
*/
class Astra_Ext_Transparent_Header_Markup {
/**
* Member Variable
*
* @var object instance
*/
private static $instance;
/**
* Initiator
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor
*/
public function __construct() {
add_action( 'body_class', array( $this, 'add_body_class' ) );
/* Fixed header markup */
add_action( 'astra_header', array( $this, 'transparent_header_logo' ), 1 );
/**
* Metabox setup
*/
add_filter( 'astra_meta_box_options', array( $this, 'add_options' ) );
add_action( 'astra_meta_box_markup_after', array( $this, 'add_options_markup' ) );
add_action( 'astra_customizer_save', array( $this, 'customizer_save' ) );
}
/**
* Add Body Classes
*
* @param array $classes Body Class Array.
* @return array
*/
public function add_body_class( $classes ) {
/** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$inherit_desk_logo = astra_get_option( 'different-transparent-logo', false );
$transparent_header_logo = astra_get_option( 'transparent-header-logo', true );
$transparent_header_logo_retina = astra_get_option( 'transparent-header-retina-logo', true );
if ( '1' == $inherit_desk_logo && ( '' !== $transparent_header_logo || '' !== $transparent_header_logo_retina ) ) {
$classes[] = 'ast-replace-site-logo-transparent';
}
if ( '1' !== $inherit_desk_logo ) {
$classes[] = 'ast-inherit-site-logo-transparent';
}
/**
* Add class 'ast-theme-transparent-header'
*/
if ( self::is_transparent_header() ) {
$classes[] = 'ast-theme-transparent-header';
}
return $classes;
}
/**
* Astra check if transparent header is enabled.
*
* @return boolean true/false.
*/
public static function is_transparent_header() {
// Transparent Header.
$enable_trans_header = astra_get_option( 'transparent-header-enable' );
$trans_meta_option = astra_get_option_meta( 'theme-transparent-header-meta', 'default' );
if ( $enable_trans_header ) {
// Checking if the new 404 page setting option is enabled, if not then fetch the value from the old archive setting option to handle backward compatibility.
if ( is_404() && '1' == astra_get_option( 'transparent-header-disable-404-page', astra_get_option( 'transparent-header-disable-archive' ) ) ) {
$enable_trans_header = false;
}
// Checking if the new search page setting option is enabled, if not then fetch the value from the old archive setting option to handle backward compatibility.
if ( is_search() && '1' == astra_get_option( 'transparent-header-disable-search-page', astra_get_option( 'transparent-header-disable-archive' ) ) ) {
$enable_trans_header = false;
}
// Checking if the new archive pages setting option is enabled, if not then fetch the value from the old archive setting option to handle backward compatibility.
if ( is_archive() && '1' == astra_get_option( 'transparent-header-disable-archive-pages', astra_get_option( 'transparent-header-disable-archive' ) ) ) {
$enable_trans_header = false;
}
if ( is_home() && '1' == astra_get_option( 'transparent-header-disable-index' ) && ( 'posts' !== get_option( 'show_on_front' ) ) ) {
$enable_trans_header = false;
}
if ( is_front_page() && 'posts' == get_option( 'show_on_front' ) && '1' == astra_get_option( 'transparent-header-disable-latest-posts-index' ) ) {
$enable_trans_header = false;
}
if ( is_page() && '1' == astra_get_option( 'transparent-header-disable-page' ) ) {
$enable_trans_header = false;
}
if ( is_single() && '1' == astra_get_option( 'transparent-header-disable-posts' ) ) {
$enable_trans_header = false;
}
}
if ( class_exists( 'Astra_Woocommerce' ) ) {
if ( is_product() && '1' == astra_get_option( 'transparent-header-disable-woo-products' ) ) {
$enable_trans_header = false;
}
}
// Force Meta settings to override global settings.
if ( 'enabled' === $trans_meta_option ) {
$enable_trans_header = true;
} elseif ( 'disabled' === $trans_meta_option ) {
$enable_trans_header = false;
}
return apply_filters( 'astra_is_transparent_header', $enable_trans_header );
}
/**
* Site Header - <header>
*
* @since 1.0.0
*/
public function transparent_header_logo() {
/** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$inherit_desk_logo = astra_get_option( 'different-transparent-logo', false );
$transparent_header_logo = astra_get_option( 'transparent-header-logo' );
if ( self::is_transparent_header() && '1' == $inherit_desk_logo && '' !== $transparent_header_logo ) {
// Logo For None Effect.
add_filter( 'astra_has_custom_logo', '__return_true' );
add_filter( 'get_custom_logo', array( $this, 'transparent_custom_logo' ), 10, 2 );
}
}
/**
* Replace transparent header logo.
*
* @param sting $html Size name.
* @param int $blog_id Icon.
*
* @return string html markup of logo.
*/
public function transparent_custom_logo( $html, $blog_id ) {
$trans_logo = astra_get_option( 'transparent-header-logo' );
$transparent_header_devices = astra_get_option( 'transparent-header-on-devices' );
if ( '' !== $trans_logo ) {
/* Replace transparent header logo and width */
add_filter( 'wp_get_attachment_image_attributes', array( $this, 'replace_trans_header_attr' ), 10, 3 );
$custom_logo_id = attachment_url_to_postid( $trans_logo );
$size = 'ast-transparent-logo-size';
if ( is_customize_preview() ) {
$size = 'full';
}
$html = sprintf(
'<a href="%1$s" class="custom-logo-link transparent-custom-logo" rel="home" itemprop="url" aria-label="%3$s">%2$s</a>',
esc_url( home_url( '/' ) ),
wp_get_attachment_image(
$custom_logo_id,
$size,
false,
array(
'class' => 'custom-logo',
)
),
get_bloginfo()
);
if ( 'mobile' === $transparent_header_devices ) {
$html .= sprintf(
'<a href="%1$s" class="custom-logo-link ast-transparent-desktop-logo" rel="home" itemprop="url">%2$s</a>',
esc_url( home_url( '/' ) ),
wp_get_attachment_image(
get_theme_mod( 'custom_logo' ),
$size,
false,
array(
'class' => 'custom-logo',
)
)
);
}
if ( 'desktop' === $transparent_header_devices ) {
$html .= sprintf(
'<a href="%1$s" class="custom-logo-link ast-transparent-mobile-logo" rel="home" itemprop="url">%2$s</a>',
esc_url( home_url( '/' ) ),
wp_get_attachment_image(
get_theme_mod( 'custom_logo' ),
$size,
false,
array(
'class' => 'custom-logo',
)
)
);
}
remove_filter( 'wp_get_attachment_image_attributes', array( $this, 'replace_trans_header_attr' ) );
}
return $html;
}
/**
* Replace transparent header logo.
*
* @param array $attr Image.
* @param object $attachment Image obj.
* @param sting $size Size name.
*
* @return array Image attr.
*/
public function replace_trans_header_attr( $attr, $attachment, $size ) {
$trans_logo = astra_get_option( 'transparent-header-logo' );
$custom_logo_id = attachment_url_to_postid( $trans_logo );
if ( $custom_logo_id == $attachment->ID ) {
$attach_data = array();
if ( ! is_customize_preview() ) {
$attach_data = wp_get_attachment_image_src( $attachment->ID, 'ast-transparent-logo-size' );
if ( isset( $attach_data[0] ) ) {
$attr['src'] = $attach_data[0];
}
}
$file_type = wp_check_filetype( $attr['src'] );
$file_extension = $file_type['ext'];
if ( 'svg' == $file_extension ) {
$attr['class'] = 'astra-logo-svg';
}
$diff_retina_logo = astra_get_option( 'different-transparent-retina-logo' );
if ( '1' == $diff_retina_logo ) {
$retina_logo = astra_get_option( 'transparent-header-retina-logo' );
$attr['srcset'] = '';
if ( apply_filters( 'astra_transparent_header_retina', true ) && '' !== $retina_logo ) {
$cutom_logo = wp_get_attachment_image_src( $custom_logo_id, 'full' );
$cutom_logo_url = $cutom_logo[0];
if ( astra_check_is_ie() ) {
// Replace header logo url to retina logo url.
$attr['src'] = $retina_logo;
}
$attr['srcset'] = $cutom_logo_url . ' 1x, ' . $retina_logo . ' 2x';
}
}
}
return $attr;
}
/**
* Add Meta Options
*
* @param array $meta_option Page Meta.
* @return array
*/
public function add_options( $meta_option ) {
$meta_option['theme-transparent-header-meta'] = array(
'sanitize' => 'FILTER_SANITIZE_STRING',
);
return $meta_option;
}
/**
* Transparent Header Meta Field markup
*
* Loads appropriate template file based on the style option selected in options panel.
*
* @param array $meta Page Meta.
* @since 1.0.0
*/
public function add_options_markup( $meta ) {
/**
* Get options
*/
$trans_header_meta = ( isset( $meta['theme-transparent-header-meta']['default'] ) ) ? $meta['theme-transparent-header-meta']['default'] : 'default';
$show_meta_field = ! astra_check_is_bb_themer_layout();
?>
<?php if ( $show_meta_field ) { ?>
<div class="transparent-header-wrapper">
<p class="post-attributes-label-wrapper">
<strong> <?php esc_html_e( 'Transparent Header', 'astra' ); ?> </strong><br/>
</p>
<select name="theme-transparent-header-meta" id="theme-transparent-header-meta">
<option value="default" <?php selected( $trans_header_meta, 'default' ); ?>> <?php esc_html_e( 'Customizer Setting', 'astra' ); ?> </option>
<option value="enabled" <?php selected( $trans_header_meta, 'enabled' ); ?>> <?php esc_html_e( 'Enabled', 'astra' ); ?> </option>
<option value="disabled" <?php selected( $trans_header_meta, 'disabled' ); ?>> <?php esc_html_e( 'Disabled', 'astra' ); ?> </option>
</select>
</div>
<?php } ?>
<?php
}
/**
* Add Styles Callback
*/
public function customizer_save() {
/* Generate Transparent Header Logo */
$trans_logo = astra_get_option( 'transparent-header-logo' );
if ( '' !== $trans_logo ) {
add_filter( 'intermediate_image_sizes_advanced', array( $this, 'transparent_logo_image_sizes' ), 10, 2 );
$trans_logo_id = attachment_url_to_postid( $trans_logo );
Astra_Customizer::generate_logo_by_width( $trans_logo_id );
remove_filter( 'intermediate_image_sizes_advanced', array( $this, 'transparent_logo_image_sizes' ), 10 );
}
}
/**
* Add logo image sizes in filter.
*
* @since 1.0.0
* @param array $sizes Sizes.
* @param array $metadata attachment data.
*
* @return array
*/
public function transparent_logo_image_sizes( $sizes, $metadata ) {
$logo_width = astra_get_option( 'transparent-header-logo-width' );
if ( is_array( $sizes ) && '' != $logo_width['desktop'] ) {
$max_value = max( $logo_width );
$sizes['ast-transparent-logo-size'] = array(
'width' => (int) $max_value,
'height' => 0,
'crop' => false,
);
}
return $sizes;
}
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
Astra_Ext_Transparent_Header_Markup::get_instance();

View File

@@ -0,0 +1,69 @@
<?php
/**
* Transparent Header Options for our theme.
*
* @package Astra Addon
* @link https://www.brainstormforce.com
* @since Astra 1.4.3
*/
// Block direct access to the file.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Bail if Customizer config base class does not exist.
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
return;
}
/**
* Customizer Sanitizes
*
* @since 1.4.3
*/
if ( ! class_exists( 'Astra_Transparent_Header_Panels_And_Sections' ) ) {
/**
* Register Transparent Header Customizer Configurations.
*/
class Astra_Transparent_Header_Panels_And_Sections extends Astra_Customizer_Config_Base {
/**
* Register Transparent Header Customizer Configurations.
*
* @param Array $configurations Astra Customizer Configurations.
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
* @since 1.4.3
* @return Array Astra Customizer Configurations with updated configurations.
*/
public function register_configuration( $configurations, $wp_customize ) {
$_configs = array(
array(
'name' => 'section-transparent-header',
'title' => esc_html__( 'Transparent Header', 'astra' ),
'panel' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 'panel-header-builder-group' : 'panel-header-group',
'type' => 'section',
'priority' => 33,
),
array(
'name' => 'section-colors-header-group',
'type' => 'section',
'title' => esc_html__( 'Header', 'astra' ),
'panel' => 'panel-colors-background',
'priority' => 20,
),
);
return array_merge( $configurations, $_configs );
}
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
new Astra_Transparent_Header_Panels_And_Sections();

View File

@@ -0,0 +1,616 @@
<?php
/**
* Transparent Header - Dynamic CSS
*
* @package Astra
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
add_filter( 'astra_dynamic_theme_css', 'astra_ext_transparent_header_dynamic_css' );
/**
* To avoid multiple Transparent color in submenu anchor tag.
* Old Users - Will not reflect directly.
* New Users - Will see the changes
*
* @return bool true|false.
* @since 4.4.0
*/
function astra_has_submenu_transperent_styling() {
$astra_settings = get_option( ASTRA_THEME_SETTINGS );
return apply_filters( 'astra_submenu_anchor_transperent_style', isset( $astra_settings['v4-3-2-anchor_transperent_style'] ) ? false : true );
}
/**
* Get transparent header's last active row to process bottom border design accordingly.
*
* @param string $device Device type.
*
* @since 4.6.16
* @return string
*/
function astra_get_transparent_header_last_active_row( $device ) {
$selector = '';
$prefix_sel = 'desktop' === $device ? '.ast-theme-transparent-header #ast-desktop-header > ' : '.ast-theme-transparent-header.ast-header-break-point #ast-mobile-header > ';
$header_rows = array( 'above', 'primary', 'below' );
foreach ( $header_rows as $row ) {
if ( ! Astra_Builder_Helper::is_row_empty( $row, 'header', $device ) ) {
continue;
}
$selector = 'primary' === $row ? $prefix_sel . '.ast-main-header-wrap > .main-header-bar' : $prefix_sel . '.ast-' . $row . '-header-wrap > .ast-' . $row . '-header';
}
return $selector;
}
/**
* Dynamic CSS
*
* @param String $dynamic_css Astra Dynamic CSS.
* @param String $dynamic_css_filtered Astra Dynamic CSS Filters.
* @return String Dynamic CSS.
*/
function astra_ext_transparent_header_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {
if ( true != Astra_Ext_Transparent_Header_Markup::is_transparent_header() ) {
return $dynamic_css;
}
/**
* Set colors
*
* If colors extension is_active then get color from it.
* Else set theme default colors.
*/
$transparent_header_separator = astra_get_option( 'transparent-header-main-sep' );
$transparent_header_separator_color = astra_get_option( 'transparent-header-main-sep-color' );
$transparent_header_logo_width = astra_get_option( 'transparent-header-logo-width' );
$transparent_header_inherit = astra_get_option( 'different-transparent-logo' );
$transparent_header_logo = astra_get_option( 'transparent-header-logo' );
$transparent_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'desktop' );
$transparent_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'tablet', $transparent_bg_color_desktop );
$transparent_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'mobile', ( $transparent_bg_color_tablet ) ? $transparent_bg_color_tablet : $transparent_bg_color_desktop );
// Above transparent header background color.
$above_transparent_bg_color_desktop = astra_get_prop( astra_get_option( 'hba-transparent-header-bg-color-responsive' ), 'desktop' );
$above_transparent_bg_color_tablet = astra_get_prop( astra_get_option( 'hba-transparent-header-bg-color-responsive' ), 'tablet', $above_transparent_bg_color_desktop );
$above_transparent_bg_color_mobile = astra_get_prop( astra_get_option( 'hba-transparent-header-bg-color-responsive' ), 'mobile', ( $above_transparent_bg_color_tablet ) ? $above_transparent_bg_color_tablet : $above_transparent_bg_color_desktop );
// Below transparent header background color.
$below_transparent_bg_color_desktop = astra_get_prop( astra_get_option( 'hbb-transparent-header-bg-color-responsive' ), 'desktop' );
$below_transparent_bg_color_tablet = astra_get_prop( astra_get_option( 'hbb-transparent-header-bg-color-responsive' ), 'tablet', $below_transparent_bg_color_desktop );
$below_transparent_bg_color_mobile = astra_get_prop( astra_get_option( 'hbb-transparent-header-bg-color-responsive' ), 'mobile', ( $below_transparent_bg_color_tablet ) ? $below_transparent_bg_color_tablet : $below_transparent_bg_color_desktop );
$transparent_color_site_title_desktop = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'desktop' );
$transparent_color_site_title_tablet = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'tablet' );
$transparent_color_site_title_mobile = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'mobile' );
$transparent_color_h_site_title_desktop = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'desktop' );
$transparent_color_h_site_title_tablet = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'tablet' );
$transparent_color_h_site_title_mobile = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'mobile' );
$transparent_menu_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'desktop' );
$transparent_menu_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'desktop' );
$transparent_menu_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'desktop' );
$transparent_menu_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'tablet' );
$transparent_menu_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'tablet' );
$transparent_menu_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'tablet' );
$transparent_menu_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'mobile' );
$transparent_menu_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'mobile' );
$transparent_menu_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'mobile' );
$transparent_sub_menu_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'desktop' );
$transparent_sub_menu_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'desktop' );
$transparent_sub_menu_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'desktop' );
$transparent_sub_menu_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'tablet' );
$transparent_sub_menu_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'tablet' );
$transparent_sub_menu_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'tablet' );
$transparent_sub_menu_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'mobile' );
$transparent_sub_menu_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'mobile' );
$transparent_sub_menu_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'mobile' );
$transparent_content_section_text_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'desktop' );
$transparent_content_section_link_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'desktop' );
$transparent_content_section_link_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'desktop' );
$transparent_content_section_text_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'tablet' );
$transparent_content_section_link_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'tablet' );
$transparent_content_section_link_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'tablet' );
$transparent_content_section_text_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'mobile' );
$transparent_content_section_link_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'mobile' );
$transparent_content_section_link_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'mobile' );
$transparent_header_devices = astra_get_option( 'transparent-header-on-devices' );
/**
* Generate Dynamic CSS
*/
$css = '';
if ( '0' === $transparent_header_inherit && '' != $transparent_header_logo ) {
$css_output = array(
'.ast-theme-transparent-header .site-logo-img .custom-logo-link' => array(
'display' => 'none',
),
);
$css .= astra_parse_css( $css_output );
}
// Handle style guide logo background cases inside the customizer.
if ( is_customize_preview() ) {
if ( Astra_Ext_Transparent_Header_Markup::is_transparent_header() ) {
// Fetch the header items
$header_items = astra_get_option( 'header-desktop-items', array() );
$transparent_bg_colors = array(
'above' => $above_transparent_bg_color_desktop,
'primary' => $transparent_bg_color_desktop,
'below' => $below_transparent_bg_color_desktop,
);
$transparent_bg_color = ! empty( $transparent_bg_color_desktop ) ? esc_attr( $transparent_bg_color_desktop ) : 'black';
foreach ( $transparent_bg_colors as $section => $bg_color ) {
if ( isset( $header_items[ $section ] ) && astra_is_logo_in_section( $header_items[ $section ] ) ) {
$transparent_bg_color = ! empty( $bg_color ) ? esc_attr( $bg_color ) : '#d1d5db';
break;
}
}
$transparent_header_desktop_bg = array(
'.ast-theme-transparent-header .ast-sg-element-wrap.ast-sg-logo-section' => array(
'background-color' => $transparent_bg_color,
),
);
$css .= astra_parse_css( $transparent_header_desktop_bg );
}
}
// Desktop Transparent Heder Logo Width.
$css_output = array(
'.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo .astra-logo-svg' => array(
'width' => astra_get_css_value( $transparent_header_logo_width['desktop'], 'px' ),
'height' => astra_get_css_value( ( ! empty( $transparent_header_logo_width['desktop-svg-height'] ) && ! is_customize_preview() ) ? $transparent_header_logo_width['desktop-svg-height'] : '', 'px' ),
),
'.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo img' => array(
' max-width' => astra_get_css_value( $transparent_header_logo_width['desktop'], 'px' ),
' width' => astra_get_css_value( $transparent_header_logo_width['desktop'], 'px' ),
),
);
$css .= astra_parse_css( $css_output );
// Tablet Transparent Heder Logo Width.
$tablet_css_output = array(
'.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo .astra-logo-svg' => array(
'width' => astra_get_css_value( $transparent_header_logo_width['tablet'], 'px' ),
'height' => astra_get_css_value( ( ! empty( $transparent_header_logo_width['tablet-svg-height'] ) && ! is_customize_preview() ) ? $transparent_header_logo_width['tablet-svg-height'] : '', 'px' ),
),
'.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo img' => array(
' max-width' => astra_get_css_value( $transparent_header_logo_width['tablet'], 'px' ),
' width' => astra_get_css_value( $transparent_header_logo_width['tablet'], 'px' ),
),
);
$css .= astra_parse_css( $tablet_css_output, '', astra_get_tablet_breakpoint() );
// Mobile Transparent Heder Logo Width.
$mobile_css_output = array(
'.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo .astra-logo-svg' => array(
'width' => astra_get_css_value( $transparent_header_logo_width['mobile'], 'px' ),
'height' => astra_get_css_value( ( ! empty( $transparent_header_logo_width['mobile-svg-height'] ) && ! is_customize_preview() ) ? $transparent_header_logo_width['mobile-svg-height'] : '', 'px' ),
),
'.ast-theme-transparent-header #masthead .site-logo-img .transparent-custom-logo img' => array(
' max-width' => astra_get_css_value( $transparent_header_logo_width['mobile'], 'px' ),
' width' => astra_get_css_value( $transparent_header_logo_width['mobile'], 'px' ),
),
);
$css .= astra_parse_css( $mobile_css_output, '', astra_get_mobile_breakpoint( 1 ) );
$transparent_header_base = array(
'.ast-theme-transparent-header #masthead' => array(
'position' => 'absolute',
'left' => '0',
'right' => '0',
),
'.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar' => array(
'background' => 'none',
),
'body.elementor-editor-active.ast-theme-transparent-header #masthead, .fl-builder-edit .ast-theme-transparent-header #masthead, body.vc_editor.ast-theme-transparent-header #masthead, body.brz-ed.ast-theme-transparent-header #masthead' => array(
'z-index' => '0',
),
'.ast-header-break-point.ast-replace-site-logo-transparent.ast-theme-transparent-header .custom-mobile-logo-link' => array(
'display' => 'none',
),
'.ast-header-break-point.ast-replace-site-logo-transparent.ast-theme-transparent-header .transparent-custom-logo' => array(
'display' => 'inline-block',
),
'.ast-theme-transparent-header .ast-above-header, .ast-theme-transparent-header .ast-above-header.ast-above-header-bar' => array(
'background-image' => 'none',
'background-color' => 'transparent',
),
'.ast-theme-transparent-header .ast-below-header, .ast-theme-transparent-header .ast-below-header.ast-below-header-bar' => array(
'background-image' => 'none',
'background-color' => 'transparent',
),
);
/**
* Transparent Header Colors
*/
$transparent_header_desktop = array(
'.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .ast-mobile-header-wrap .main-header-bar' => array(
'background-color' => esc_attr( $transparent_bg_color_desktop ),
),
'.ast-theme-transparent-header .main-header-bar .ast-search-menu-icon form' => array(
'background-color' => esc_attr( $transparent_bg_color_desktop ),
),
'.ast-theme-transparent-header .ast-above-header, .ast-theme-transparent-header .ast-above-header.ast-above-header-bar' => array(
'background-color' => esc_attr( $above_transparent_bg_color_desktop ),
),
'.ast-theme-transparent-header .ast-below-header, .ast-theme-transparent-header .ast-below-header.ast-below-header-bar' => array(
'background-color' => esc_attr( $below_transparent_bg_color_desktop ),
),
'.ast-theme-transparent-header .site-title a, .ast-theme-transparent-header .site-title a:focus, .ast-theme-transparent-header .site-title a:hover, .ast-theme-transparent-header .site-title a:visited' => array(
'color' => esc_attr( $transparent_color_site_title_desktop ),
),
'.ast-theme-transparent-header .site-header .site-title a:hover' => array(
'color' => esc_attr( $transparent_color_h_site_title_desktop ),
),
'.ast-theme-transparent-header .site-header .site-description' => array(
'color' => esc_attr( $transparent_color_site_title_desktop ),
),
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-bar-wrap .main-header-menu, .ast-flyout-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation .site-navigation, .ast-fullscreen-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation .site-navigation, .ast-flyout-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap .ast-above-header-navigation, .ast-flyout-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap .ast-below-header-actual-nav, .ast-fullscreen-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap, .ast-fullscreen-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap, .ast-theme-transparent-header .main-header-menu .menu-link' => array(
'background-color' => esc_attr( $transparent_menu_bg_color_desktop ),
),
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu' => array(
'background-color' => esc_attr( $transparent_sub_menu_bg_color_desktop ),
),
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array(
'color' => esc_attr( $transparent_sub_menu_color_desktop ),
),
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link:hover,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .ast-menu-toggle,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array(
'color' => esc_attr( $transparent_sub_menu_h_color_desktop ),
),
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item > .menu-link, .ast-theme-transparent-header .ast-masthead-custom-menu-items, .ast-theme-transparent-header .ast-masthead-custom-menu-items a, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation > ul.ast-above-header-menu > .menu-item-has-children:not(.current-menu-item) > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .main-header-menu .menu-link' => array(
'color' => esc_attr( $transparent_menu_color_desktop ),
),
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-ancestor > .menu-link' => array(
'color' => esc_attr( $transparent_menu_h_color_desktop ),
),
// Content Section text color.
'.ast-theme-transparent-header div.ast-masthead-custom-menu-items, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget-title, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element' => array(
'color' => esc_attr( $transparent_content_section_text_color_desktop ),
),
// Content Section link color.
'.ast-theme-transparent-header div.ast-masthead-custom-menu-items a, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element a' => array(
'color' => esc_attr( $transparent_content_section_link_color_desktop ),
),
// Content Section link hover color.
'.ast-theme-transparent-header div.ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a:hover, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element a:hover' => array(
'color' => esc_attr( $transparent_content_section_link_h_color_desktop ),
),
);
if ( astra_has_submenu_transperent_styling() ) {
$transparent_header_desktop['.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link'] = array(
'background-color' => 'transparent',
);
}
$transparent_header_tablet = array(
'.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .ast-mobile-header-wrap .main-header-bar' => array(
'background-color' => esc_attr( $transparent_bg_color_tablet ),
),
'.ast-theme-transparent-header .main-header-bar .ast-search-menu-icon form' => array(
'background-color' => esc_attr( $transparent_bg_color_tablet ),
),
'.ast-theme-transparent-header.ast-header-break-point .ast-above-header, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-bar .main-header-menu' => array(
'background-color' => esc_attr( $above_transparent_bg_color_tablet ),
),
'.ast-theme-transparent-header.ast-header-break-point .ast-below-header, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-bar .main-header-menu' => array(
'background-color' => esc_attr( $below_transparent_bg_color_tablet ),
),
'.ast-theme-transparent-header .site-title a, .ast-theme-transparent-header .site-title a:focus, .ast-theme-transparent-header .site-title a:hover, .ast-theme-transparent-header .site-title a:visited, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:hover, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:focus, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:visited' => array(
'color' => esc_attr( $transparent_color_site_title_tablet ),
),
'.ast-theme-transparent-header .site-header .site-title a:hover' => array(
'color' => esc_attr( $transparent_color_h_site_title_tablet ),
),
'.ast-theme-transparent-header .site-header .site-description' => array(
'color' => esc_attr( $transparent_color_site_title_tablet ),
),
'.ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu .sub-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-bar-wrap .main-header-menu, .ast-flyout-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation .site-navigation, .ast-fullscreen-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation .site-navigation, .ast-flyout-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap .ast-above-header-navigation, .ast-flyout-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap .ast-below-header-actual-nav, .ast-fullscreen-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap, .ast-fullscreen-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap, .ast-theme-transparent-header .main-header-menu .menu-link' => array(
'background-color' => esc_attr( $transparent_menu_bg_color_tablet ),
),
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header.astra-hfb-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.astra-hfb-header .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header.astra-hfb-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.astra-hfb-header .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu' => array(
'background-color' => esc_attr( $transparent_sub_menu_bg_color_tablet ),
),
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array(
'color' => esc_attr( $transparent_sub_menu_color_tablet ),
),
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link:hover,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .ast-menu-toggle,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array(
'color' => esc_attr( $transparent_sub_menu_h_color_tablet ),
),
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item > .menu-link, .ast-theme-transparent-header .ast-masthead-custom-menu-items, .ast-theme-transparent-header .ast-masthead-custom-menu-items a,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-link' => array(
'color' => esc_attr( $transparent_menu_color_tablet ),
),
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-ancestor > .menu-link' => array(
'color' => esc_attr( $transparent_menu_h_color_tablet ),
),
// Content Section text color.
'.ast-theme-transparent-header div.ast-masthead-custom-menu-items, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget-title, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element' => array(
'color' => esc_attr( $transparent_content_section_text_color_tablet ),
),
// Content Section link color.
'.ast-theme-transparent-header div.ast-masthead-custom-menu-items a, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a' => array(
'color' => esc_attr( $transparent_content_section_link_color_tablet ),
),
// Content Section link hover color.
'.ast-theme-transparent-header div.ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a:hover' => array(
'color' => esc_attr( $transparent_content_section_link_h_color_tablet ),
),
);
$transparent_header_mobile = array(
'.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .main-header-bar-wrap .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .ast-mobile-header-wrap .main-header-bar' => array(
'background-color' => esc_attr( $transparent_bg_color_mobile ),
),
'.ast-theme-transparent-header .main-header-bar .ast-search-menu-icon form' => array(
'background-color' => esc_attr( $transparent_bg_color_mobile ),
),
'.ast-theme-transparent-header.ast-header-break-point .ast-above-header, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-bar .main-header-menu' => array(
'background-color' => esc_attr( $above_transparent_bg_color_mobile ),
),
'.ast-theme-transparent-header.ast-header-break-point .ast-below-header, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-bar .main-header-menu' => array(
'background-color' => esc_attr( $below_transparent_bg_color_mobile ),
),
'.ast-theme-transparent-header .site-title a, .ast-theme-transparent-header .site-title a:focus, .ast-theme-transparent-header .site-title a:hover, .ast-theme-transparent-header .site-title a:visited, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:hover, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:focus, .ast-theme-transparent-header .ast-builder-layout-element .ast-site-identity .site-title a:visited' => array(
'color' => esc_attr( $transparent_color_site_title_mobile ),
),
'.ast-theme-transparent-header .site-header .site-title a:hover' => array(
'color' => esc_attr( $transparent_color_h_site_title_mobile ),
),
'.ast-theme-transparent-header .site-header .site-description' => array(
'color' => esc_attr( $transparent_color_site_title_mobile ),
),
'.ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu .sub-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-builder-menu .main-header-bar-wrap .main-header-menu, .ast-flyout-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation .site-navigation, .ast-fullscreen-menu-enable.ast-header-break-point.ast-theme-transparent-header .main-header-bar-navigation .site-navigation, .ast-flyout-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap .ast-above-header-navigation, .ast-flyout-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap .ast-below-header-actual-nav, .ast-fullscreen-above-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation-wrap, .ast-fullscreen-below-menu-enable.ast-header-break-point.ast-theme-transparent-header .ast-below-header-navigation-wrap, .ast-theme-transparent-header .main-header-menu .menu-link' => array(
'background-color' => esc_attr( $transparent_menu_bg_color_mobile ),
),
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header.astra-hfb-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.astra-hfb-header .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .ast-builder-menu .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header.astra-hfb-header .ast-builder-menu [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.astra-hfb-header .ast-builder-menu .main-header-bar-navigation [CLASS*="ast-builder-menu-"] .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu' => array(
'background-color' => esc_attr( $transparent_sub_menu_bg_color_mobile ),
),
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array(
'color' => esc_attr( $transparent_sub_menu_color_mobile ),
),
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-link:hover,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.current-menu-item > .ast-menu-toggle,.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item .sub-menu .menu-item.focus > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item.focus > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link, .ast-header-break-point.ast-flyout-menu-enable.ast-header-break-point .main-header-bar-navigation .main-header-menu .menu-item .sub-menu .menu-link' => array(
'color' => esc_attr( $transparent_sub_menu_h_color_mobile ),
),
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-link, .ast-theme-transparent-header .ast-masthead-custom-menu-items, .ast-theme-transparent-header .ast-masthead-custom-menu-items a, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-link' => array(
'color' => esc_attr( $transparent_menu_color_mobile ),
),
'.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .menu-link, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .main-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-item > .menu-link, .ast-theme-transparent-header .main-header-menu .current-menu-ancestor > .menu-link' => array(
'color' => esc_attr( $transparent_menu_h_color_mobile ),
),
// Content Section text color.
'.ast-theme-transparent-header div.ast-masthead-custom-menu-items, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget-title, .ast-theme-transparent-header .site-header-section [CLASS*="ast-header-html-"] .ast-builder-html-element' => array(
'color' => esc_attr( $transparent_content_section_text_color_mobile ),
),
// Content Section link color.
'.ast-theme-transparent-header div.ast-masthead-custom-menu-items a, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a' => array(
'color' => esc_attr( $transparent_content_section_link_color_mobile ),
),
// Content Section link hover color.
'.ast-theme-transparent-header div.ast-masthead-custom-menu-items a:hover, .ast-theme-transparent-header div.ast-masthead-custom-menu-items .widget a:hover' => array(
'color' => esc_attr( $transparent_content_section_link_h_color_mobile ),
),
);
/* Parse CSS from array() */
if ( 'both' === $transparent_header_devices || 'desktop' === $transparent_header_devices ) {
$css .= astra_parse_css( $transparent_header_base, strval( astra_get_tablet_breakpoint() ) );
// If Transparent header is active on mobile + desktop, enqueue CSS without media queeries.
// If only for desktop add media query for the transparent header.
if ( 'both' === $transparent_header_devices ) {
$css .= astra_parse_css( $transparent_header_desktop );
} else {
$css .= astra_parse_css( $transparent_header_desktop, astra_get_tablet_breakpoint( '', 1 ) );
}
}
if ( 'mobile' === $transparent_header_devices ) {
$css .= astra_parse_css(
array(
'.transparent-custom-logo' => array(
'display' => 'none',
),
),
astra_get_tablet_breakpoint()
);
$css .= astra_parse_css(
array(
'.transparent-custom-logo' => array(
'display' => 'block',
),
),
'',
astra_get_tablet_breakpoint()
);
$css .= astra_parse_css(
array(
'.ast-transparent-desktop-logo' => array(
'display' => 'none',
),
),
'',
astra_get_tablet_breakpoint()
);
}
if ( 'desktop' === $transparent_header_devices ) {
$css .= astra_parse_css(
array(
'.transparent-custom-logo' => array(
'display' => 'none',
),
),
'',
astra_get_tablet_breakpoint()
);
$css .= astra_parse_css(
array(
'.ast-transparent-mobile-logo' => array(
'display' => 'none',
),
),
astra_get_tablet_breakpoint()
);
$css .= astra_parse_css(
array(
'.ast-transparent-mobile-logo' => array(
'display' => 'block',
),
),
'',
astra_get_tablet_breakpoint( 1 )
);
}
if ( 'both' === $transparent_header_devices || 'mobile' === $transparent_header_devices ) {
$css .= astra_parse_css( $transparent_header_base, '', astra_get_tablet_breakpoint() );
$css .= astra_parse_css( $transparent_header_tablet, '', astra_get_tablet_breakpoint() );
$css .= astra_parse_css( $transparent_header_mobile, '', astra_get_mobile_breakpoint() );
}
if ( 'both' === $transparent_header_devices ) {
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
$desktop_selector = astra_get_transparent_header_last_active_row( 'desktop' );
$responsive_selector = astra_get_transparent_header_last_active_row( 'mobile' );
// Join $desktop_selector & $responsive_selector.
$selector = ( ! empty( $desktop_selector ) && ! empty( $responsive_selector ) ) ? $desktop_selector . ', ' . $responsive_selector : $desktop_selector . $responsive_selector;
} else {
$selector = '.ast-theme-transparent-header .main-header-bar, .ast-theme-transparent-header.ast-header-break-point .main-header-bar';
}
if ( '' !== $transparent_header_separator && 'inherit' !== $transparent_header_separator ) {
$css .= astra_parse_css(
array(
$selector => array(
'border-bottom-width' => astra_get_css_value( $transparent_header_separator, 'px' ),
'border-bottom-style' => 'solid',
'border-bottom-color' => esc_attr( $transparent_header_separator_color ),
),
)
);
} else {
$css .= astra_parse_css(
array(
$selector => array(
'border-bottom-style' => 'none',
),
)
);
}
}
if ( 'mobile' === $transparent_header_devices ) {
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
$selector = astra_get_transparent_header_last_active_row( 'mobile' );
} else {
$selector = '.ast-theme-transparent-header.ast-header-break-point .main-header-bar';
}
if ( '' !== $transparent_header_separator && 'inherit' !== $transparent_header_separator ) {
$css .= astra_parse_css(
array(
$selector => array(
'border-bottom-width' => astra_get_css_value( $transparent_header_separator, 'px' ),
'border-bottom-style' => 'solid',
'border-bottom-color' => esc_attr( $transparent_header_separator_color ),
),
),
'',
astra_get_tablet_breakpoint()
);
} else {
$css .= astra_parse_css(
array(
$selector => array(
'border-bottom-style' => 'none',
),
),
'',
astra_get_tablet_breakpoint()
);
}
}
if ( 'desktop' === $transparent_header_devices ) {
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
$selector = astra_get_transparent_header_last_active_row( 'desktop' );
} else {
$selector = '.ast-theme-transparent-header .main-header-bar';
}
if ( '' !== $transparent_header_separator && 'inherit' !== $transparent_header_separator ) {
$transparent_header_base = array(
$selector => array(
'border-bottom-width' => astra_get_css_value( $transparent_header_separator, 'px' ),
'border-bottom-style' => 'solid',
'border-bottom-color' => esc_attr( $transparent_header_separator_color ),
),
);
} else {
$transparent_header_base = array(
$selector => array(
'border-bottom-style' => 'none',
),
);
}
$css .= astra_parse_css( $transparent_header_base, strval( astra_get_tablet_breakpoint() ) );
}
$dynamic_css .= $css;
return $dynamic_css;
}

View File

@@ -0,0 +1,561 @@
<?php
/**
* Transparent Header - Dynamic CSS
*
* @package Astra
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Transparent Above Header
*/
add_filter( 'astra_dynamic_theme_css', 'astra_ext_transparent_above_header_sections_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 above header transparent header.
*/
function astra_ext_transparent_above_header_sections_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {
$above_header_layout = astra_get_option( 'above-header-layout', 'disabled' );
if ( 'disabled' === $above_header_layout ) {
return $dynamic_css;
}
if ( false == Astra_Ext_Transparent_Header_Markup::is_transparent_header() ) {
return $dynamic_css;
}
/**
* Set colors
*/
$transparent_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'desktop' );
$transparent_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'tablet' );
$transparent_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'mobile' );
$transparent_color_site_title_desktop = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'desktop' );
$transparent_color_site_title_tablet = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'tablet' );
$transparent_color_site_title_mobile = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'mobile' );
$transparent_color_h_site_title_desktop = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'desktop' );
$transparent_color_h_site_title_tablet = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'tablet' );
$transparent_color_h_site_title_mobile = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'mobile' );
$transparent_menu_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'desktop' );
$transparent_menu_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'desktop' );
$transparent_menu_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'desktop' );
$transparent_menu_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'tablet' );
$transparent_menu_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'tablet' );
$transparent_menu_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'tablet' );
$transparent_menu_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'mobile' );
$transparent_menu_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'mobile' );
$transparent_menu_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'mobile' );
$transparent_sub_menu_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'desktop' );
$transparent_sub_menu_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'desktop' );
$transparent_sub_menu_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'desktop' );
$transparent_sub_menu_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'tablet' );
$transparent_sub_menu_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'tablet' );
$transparent_sub_menu_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'tablet' );
$transparent_sub_menu_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'mobile' );
$transparent_sub_menu_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'mobile' );
$transparent_sub_menu_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'mobile' );
$transparent_content_section_text_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'desktop' );
$transparent_content_section_link_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'desktop' );
$transparent_content_section_link_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'desktop' );
$transparent_content_section_text_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'tablet' );
$transparent_content_section_link_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'tablet' );
$transparent_content_section_link_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'tablet' );
$transparent_content_section_text_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'mobile' );
$transparent_content_section_link_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'mobile' );
$transparent_content_section_link_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'mobile' );
/**
* Generate Dynamic CSS
*/
$css = '';
/**
* Transparent Header Colors
*/
$transparent_header_desktop = array(
'.ast-theme-transparent-header .ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-section-separated .ast-above-header-navigation ul.ast-above-header-menu' => array(
'background-color' => esc_attr( $transparent_menu_bg_color_desktop ),
),
'.ast-theme-transparent-header .ast-above-header .ast-search-menu-icon form' => array(
'background-color' => esc_attr( $transparent_bg_color_desktop ),
),
'.ast-theme-transparent-header .ast-above-header .slide-search .search-field' => array(
'background-color' => esc_attr( $transparent_bg_color_desktop ),
),
'.ast-theme-transparent-header .ast-above-header .slide-search .search-field:focus' => array(
'background-color' => esc_attr( $transparent_bg_color_desktop ),
),
'.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-ancestor > .menu-link' => array(
'color' => esc_attr( $transparent_menu_h_color_desktop ),
),
'.ast-theme-transparent-header .ast-above-header-navigation .menu-item:hover > .menu-link' => array(
'color' => esc_attr( $transparent_menu_h_color_desktop ),
),
'.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation > ul.ast-above-header-menu > .menu-item-has-children:not(.current-menu-item) > .ast-menu-toggle' => array(
'color' => esc_attr( $transparent_menu_color_desktop ),
),
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu' => array(
'background-color' => esc_attr( $transparent_sub_menu_bg_color_desktop ),
),
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .ast-menu-toggle' => array(
'color' => esc_attr( $transparent_sub_menu_h_color_desktop ),
),
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array(
'color' => esc_attr( $transparent_sub_menu_h_color_desktop ),
),
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array(
'color' => esc_attr( $transparent_sub_menu_h_color_desktop ),
),
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu, .ast-theme-transparent-header .ast-above-header-navigation .ast-above-header-menu .sub-menu a' => array(
'color' => esc_attr( $transparent_sub_menu_color_desktop ),
),
// Content Section text color.
'.ast-theme-transparent-header .ast-above-header-section .user-select, .ast-theme-transparent-header .ast-above-header-section .widget, .ast-theme-transparent-header .ast-above-header-section .widget-title' => array(
'color' => esc_attr( $transparent_content_section_text_color_desktop ),
),
// Content Section link color.
'.ast-theme-transparent-header .ast-above-header-section .user-select a, .ast-theme-transparent-header .ast-above-header-section .widget a' => array(
'color' => esc_attr( $transparent_content_section_link_color_desktop ),
),
// Content Section link hover color.
'.ast-theme-transparent-header .ast-above-header-section .user-select a:hover, .ast-theme-transparent-header .ast-above-header-section .widget a:hover' => array(
'color' => esc_attr( $transparent_content_section_link_h_color_desktop ),
),
);
$transparent_header_tablet = array(
'.ast-theme-transparent-header .ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-section-separated .ast-above-header-navigation ul.ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-section-separated .ast-below-header-actual-nav' => array(
'background-color' => esc_attr( $transparent_menu_bg_color_tablet ),
),
'.ast-theme-transparent-header .ast-above-header .ast-search-menu-icon form' => array(
'background-color' => esc_attr( $transparent_bg_color_tablet ),
),
'.ast-theme-transparent-header .ast-above-header .slide-search .search-field' => array(
'background-color' => esc_attr( $transparent_bg_color_tablet ),
),
'.ast-theme-transparent-header .ast-above-header .slide-search .search-field:focus' => array(
'background-color' => esc_attr( $transparent_bg_color_tablet ),
),
'.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-ancestor > .menu-link' => array(
'color' => esc_attr( $transparent_menu_h_color_tablet ),
),
'.ast-theme-transparent-header .ast-above-header-navigation .menu-item:hover > .menu-link' => array(
'color' => esc_attr( $transparent_menu_h_color_tablet ),
),
'.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation > ul.ast-above-header-menu > .menu-item-has-children:not(.current-menu-item) > .ast-menu-toggle' => array(
'color' => esc_attr( $transparent_menu_color_tablet ),
),
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu' => array(
'background-color' => esc_attr( $transparent_sub_menu_bg_color_tablet ),
),
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .ast-menu-toggle' => array(
'color' => esc_attr( $transparent_sub_menu_h_color_tablet ),
),
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array(
'color' => esc_attr( $transparent_sub_menu_h_color_tablet ),
),
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array(
'color' => esc_attr( $transparent_sub_menu_h_color_tablet ),
),
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu, .ast-theme-transparent-header .ast-above-header-navigation .ast-above-header-menu .sub-menu a' => array(
'color' => esc_attr( $transparent_sub_menu_color_tablet ),
),
// Content Section text color.
'.ast-theme-transparent-header .ast-above-header-section .user-select, .ast-theme-transparent-header .ast-above-header-section .widget, .ast-theme-transparent-header .ast-above-header-section .widget-title' => array(
'color' => esc_attr( $transparent_content_section_text_color_tablet ),
),
// Content Section link color.
'.ast-theme-transparent-header .ast-above-header-section .user-select a, .ast-theme-transparent-header .ast-above-header-section .widget a' => array(
'color' => esc_attr( $transparent_content_section_link_color_tablet ),
),
// Content Section link hover color.
'.ast-theme-transparent-header .ast-above-header-section .user-select a:hover, .ast-theme-transparent-header .ast-above-header-section .widget a:hover' => array(
'color' => esc_attr( $transparent_content_section_link_h_color_tablet ),
),
);
$transparent_header_mobile = array(
'.ast-theme-transparent-header .ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-above-header-section-separated .ast-above-header-navigation ul.ast-above-header-menu, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-section-separated .ast-below-header-actual-nav' => array(
'background-color' => esc_attr( $transparent_menu_bg_color_mobile ),
),
'.ast-theme-transparent-header .ast-above-header .ast-search-menu-icon form' => array(
'background-color' => esc_attr( $transparent_bg_color_mobile ),
),
'.ast-theme-transparent-header .ast-above-header .slide-search .search-field' => array(
'background-color' => esc_attr( $transparent_bg_color_mobile ),
),
'.ast-theme-transparent-header .ast-above-header .slide-search .search-field:focus' => array(
'background-color' => esc_attr( $transparent_bg_color_mobile ),
),
'.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-item > .menu-link,.ast-theme-transparent-header .ast-above-header-navigation .menu-item.current-menu-ancestor > .menu-link' => array(
'color' => esc_attr( $transparent_menu_h_color_mobile ),
),
'.ast-theme-transparent-header .ast-above-header-navigation .menu-item:hover > .menu-link' => array(
'color' => esc_attr( $transparent_menu_h_color_mobile ),
),
'.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation a, .ast-header-break-point.ast-theme-transparent-header .ast-above-header-navigation > ul.ast-above-header-menu > .menu-item-has-children:not(.current-menu-item) > .ast-menu-toggle' => array(
'color' => esc_attr( $transparent_menu_color_mobile ),
),
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu' => array(
'background-color' => esc_attr( $transparent_sub_menu_bg_color_mobile ),
),
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .menu-item,.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.focus > .ast-menu-toggle' => array(
'color' => esc_attr( $transparent_sub_menu_h_color_mobile ),
),
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array(
'color' => esc_attr( $transparent_sub_menu_h_color_mobile ),
),
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-above-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array(
'color' => esc_attr( $transparent_sub_menu_h_color_mobile ),
),
'.ast-theme-transparent-header .ast-above-header-menu .sub-menu, .ast-theme-transparent-header .ast-above-header-navigation .ast-above-header-menu .sub-menu a' => array(
'color' => esc_attr( $transparent_sub_menu_color_mobile ),
),
// Content Section text color.
'.ast-theme-transparent-header .ast-above-header-section .user-select, .ast-theme-transparent-header .ast-above-header-section .widget, .ast-theme-transparent-header .ast-above-header-section .widget-title' => array(
'color' => esc_attr( $transparent_content_section_text_color_mobile ),
),
// Content Section link color.
'.ast-theme-transparent-header .ast-above-header-section .user-select a, .ast-theme-transparent-header .ast-above-header-section .widget a' => array(
'color' => esc_attr( $transparent_content_section_link_color_mobile ),
),
// Content Section link hover color.
'.ast-theme-transparent-header .ast-above-header-section .user-select a:hover, .ast-theme-transparent-header .ast-above-header-section .widget a:hover' => array(
'color' => esc_attr( $transparent_content_section_link_h_color_mobile ),
),
);
/* Parse CSS from array() */
$css .= astra_parse_css( $transparent_header_desktop );
$css .= astra_parse_css( $transparent_header_tablet, '', astra_get_tablet_breakpoint() );
$css .= astra_parse_css( $transparent_header_mobile, '', astra_get_mobile_breakpoint() );
return $dynamic_css . $css;
}
/**
* Transparent Below Header
*/
add_filter( 'astra_dynamic_theme_css', 'astra_ext_transparent_below_header_sections_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.
*/
function astra_ext_transparent_below_header_sections_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {
// set page width depending on site layout.
$below_header_layout = astra_get_option( 'below-header-layout', 'disabled' );
if ( 'disabled' === $below_header_layout ) {
return $dynamic_css;
}
if ( false == Astra_Ext_Transparent_Header_Markup::is_transparent_header() ) {
return $dynamic_css;
}
/**
* Set colors
*/
$transparent_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'desktop' );
$transparent_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'tablet' );
$transparent_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-header-bg-color-responsive' ), 'mobile' );
$transparent_color_site_title_desktop = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'desktop' );
$transparent_color_site_title_tablet = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'tablet' );
$transparent_color_site_title_mobile = astra_get_prop( astra_get_option( 'transparent-header-color-site-title-responsive' ), 'mobile' );
$transparent_color_h_site_title_desktop = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'desktop' );
$transparent_color_h_site_title_tablet = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'tablet' );
$transparent_color_h_site_title_mobile = astra_get_prop( astra_get_option( 'transparent-header-color-h-site-title-responsive' ), 'mobile' );
$transparent_menu_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'desktop' );
$transparent_menu_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'desktop' );
$transparent_menu_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'desktop' );
$transparent_menu_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'tablet' );
$transparent_menu_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'tablet' );
$transparent_menu_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'tablet' );
$transparent_menu_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-bg-color-responsive' ), 'mobile' );
$transparent_menu_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-color-responsive' ), 'mobile' );
$transparent_menu_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-menu-h-color-responsive' ), 'mobile' );
$transparent_sub_menu_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'desktop' );
$transparent_sub_menu_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'desktop' );
$transparent_sub_menu_bg_color_desktop = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'desktop' );
$transparent_sub_menu_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'tablet' );
$transparent_sub_menu_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'tablet' );
$transparent_sub_menu_bg_color_tablet = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'tablet' );
$transparent_sub_menu_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-color-responsive' ), 'mobile' );
$transparent_sub_menu_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-h-color-responsive' ), 'mobile' );
$transparent_sub_menu_bg_color_mobile = astra_get_prop( astra_get_option( 'transparent-submenu-bg-color-responsive' ), 'mobile' );
$transparent_content_section_text_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'desktop' );
$transparent_content_section_link_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'desktop' );
$transparent_content_section_link_h_color_desktop = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'desktop' );
$transparent_content_section_text_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'tablet' );
$transparent_content_section_link_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'tablet' );
$transparent_content_section_link_h_color_tablet = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'tablet' );
$transparent_content_section_text_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-text-color-responsive' ), 'mobile' );
$transparent_content_section_link_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-link-color-responsive' ), 'mobile' );
$transparent_content_section_link_h_color_mobile = astra_get_prop( astra_get_option( 'transparent-content-section-link-h-color-responsive' ), 'mobile' );
/**
* Generate Dynamic CSS
*/
$css = '';
/**
* Transparent Header Colors
*/
$transparent_header_desktop = array(
'.ast-theme-transparent-header.ast-no-toggle-below-menu-enable.ast-header-break-point .ast-below-header-navigation-wrap, .ast-theme-transparent-header .ast-below-header-actual-nav, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-actual-nav' => array(
'background-color' => esc_attr( $transparent_menu_bg_color_desktop ),
),
'.ast-theme-transparent-header .ast-below-header .ast-search-menu-icon form' => array(
'background-color' => esc_attr( $transparent_bg_color_desktop ),
),
'.ast-theme-transparent-header .ast-below-header .slide-search .search-field' => array(
'background-color' => esc_attr( $transparent_bg_color_desktop ),
),
'.ast-theme-transparent-header .ast-below-header .slide-search .search-field:focus' => array(
'background-color' => esc_attr( $transparent_bg_color_desktop ),
),
/**
* Below Header Navigation
*/
'.ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu' => array(
'color' => esc_attr( $transparent_menu_color_desktop ),
),
'.ast-theme-transparent-header .ast-below-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.focus > .menu-link' => array(
'color' => esc_attr( $transparent_menu_h_color_desktop ),
),
'.ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array(
'color' => esc_attr( $transparent_menu_h_color_desktop ),
),
/**
* Below Header Dropdown Navigation
*/
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.focus > .menu-item' => array(
'color' => esc_attr( $transparent_sub_menu_h_color_desktop ),
),
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array(
'color' => esc_attr( $transparent_sub_menu_h_color_desktop ),
),
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu' => array(
'background-color' => esc_attr( $transparent_sub_menu_bg_color_desktop ),
),
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu, .ast-theme-transparent-header .ast-below-header-menu .sub-menu a' => array(
'color' => esc_attr( $transparent_sub_menu_color_desktop ),
),
/**
* Content Colors & Typography
*/
'.ast-theme-transparent-header .below-header-user-select, .ast-theme-transparent-header .below-header-user-select .widget,.ast-theme-transparent-header .below-header-user-select .widget-title' => array(
'color' => esc_attr( $transparent_content_section_text_color_desktop ),
),
'.ast-theme-transparent-header .below-header-user-select a, .ast-theme-transparent-header .below-header-user-select .widget a' => array(
'color' => esc_attr( $transparent_content_section_link_color_desktop ),
),
'.ast-theme-transparent-header .below-header-user-select a:hover, .ast-theme-transparent-header .below-header-user-select .widget a:hover' => array(
'color' => esc_attr( $transparent_content_section_link_h_color_desktop ),
),
);
$transparent_header_tablet = array(
'.ast-theme-transparent-header.ast-no-toggle-below-menu-enable.ast-header-break-point .ast-below-header-navigation-wrap, .ast-theme-transparent-header .ast-below-header-actual-nav, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-actual-nav' => array(
'background-color' => esc_attr( $transparent_menu_bg_color_tablet ),
),
'.ast-theme-transparent-header .ast-below-header .ast-search-menu-icon form' => array(
'background-color' => esc_attr( $transparent_bg_color_tablet ),
),
'.ast-theme-transparent-header .ast-below-header .slide-search .search-field' => array(
'background-color' => esc_attr( $transparent_bg_color_tablet ),
),
'.ast-theme-transparent-header .ast-below-header .slide-search .search-field:focus' => array(
'background-color' => esc_attr( $transparent_bg_color_tablet ),
),
/**
* Below Header Navigation
*/
'.ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu' => array(
'color' => esc_attr( $transparent_menu_color_tablet ),
),
'.ast-theme-transparent-header .ast-below-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.focus > .menu-link' => array(
'color' => esc_attr( $transparent_menu_h_color_tablet ),
),
'.ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array(
'color' => esc_attr( $transparent_menu_h_color_tablet ),
),
/**
* Below Header Dropdown Navigation
*/
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.focus > .menu-item' => array(
'color' => esc_attr( $transparent_sub_menu_h_color_tablet ),
),
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array(
'color' => esc_attr( $transparent_sub_menu_h_color_tablet ),
),
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu' => array(
'background-color' => esc_attr( $transparent_sub_menu_bg_color_tablet ),
),
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu, .ast-theme-transparent-header .ast-below-header-menu .sub-menu a' => array(
'color' => esc_attr( $transparent_sub_menu_color_tablet ),
),
/**
* Content Colors & Typography
*/
'.ast-theme-transparent-header .below-header-user-select, .ast-theme-transparent-header .below-header-user-select .widget,.ast-theme-transparent-header .below-header-user-select .widget-title' => array(
'color' => esc_attr( $transparent_content_section_text_color_tablet ),
),
'.ast-theme-transparent-header .below-header-user-select a, .ast-theme-transparent-header .below-header-user-select .widget a' => array(
'color' => esc_attr( $transparent_content_section_link_color_tablet ),
),
'.ast-theme-transparent-header .below-header-user-select a:hover, .ast-theme-transparent-header .below-header-user-select .widget a:hover' => array(
'color' => esc_attr( $transparent_content_section_link_h_color_tablet ),
),
);
$transparent_header_mobile = array(
'.ast-theme-transparent-header.ast-no-toggle-below-menu-enable.ast-header-break-point .ast-below-header-navigation-wrap, .ast-theme-transparent-header .ast-below-header-actual-nav, .ast-theme-transparent-header.ast-header-break-point .ast-below-header-actual-nav' => array(
'background-color' => esc_attr( $transparent_menu_bg_color_mobile ),
),
'.ast-theme-transparent-header .ast-below-header .ast-search-menu-icon form' => array(
'background-color' => esc_attr( $transparent_bg_color_mobile ),
),
'.ast-theme-transparent-header .ast-below-header .slide-search .search-field' => array(
'background-color' => esc_attr( $transparent_bg_color_mobile ),
),
'.ast-theme-transparent-header .ast-below-header .slide-search .search-field:focus' => array(
'background-color' => esc_attr( $transparent_bg_color_mobile ),
),
/**
* Below Header Navigation
*/
'.ast-theme-transparent-header .ast-below-header-menu, .ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu a, .ast-header-break-point.ast-theme-transparent-header .ast-below-header-menu' => array(
'color' => esc_attr( $transparent_menu_color_mobile ),
),
'.ast-theme-transparent-header .ast-below-header-menu .menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.focus > .menu-link' => array(
'color' => esc_attr( $transparent_menu_h_color_mobile ),
),
'.ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-ancestor > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .menu-item.current-menu-item > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .ast-menu-toggle, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .ast-menu-toggle' => array(
'color' => esc_attr( $transparent_menu_h_color_mobile ),
),
/**
* Below Header Dropdown Navigation
*/
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:hover > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item:focus > .menu-item, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.focus > .menu-item' => array(
'color' => esc_attr( $transparent_sub_menu_h_color_mobile ),
),
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-ancestor.focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:hover > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item:focus > .menu-link, .ast-theme-transparent-header .ast-below-header-menu .sub-menu .menu-item.current-menu-item.focus > .menu-link' => array(
'color' => esc_attr( $transparent_sub_menu_h_color_mobile ),
),
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu' => array(
'background-color' => esc_attr( $transparent_sub_menu_bg_color_mobile ),
),
'.ast-theme-transparent-header .ast-below-header-menu .sub-menu, .ast-theme-transparent-header .ast-below-header-menu .sub-menu a' => array(
'color' => esc_attr( $transparent_sub_menu_color_mobile ),
),
/**
* Content Colors & Typography
*/
'.ast-theme-transparent-header .below-header-user-select, .ast-theme-transparent-header .below-header-user-select .widget,.ast-theme-transparent-header .below-header-user-select .widget-title' => array(
'color' => esc_attr( $transparent_content_section_text_color_mobile ),
),
'.ast-theme-transparent-header .below-header-user-select a, .ast-theme-transparent-header .below-header-user-select .widget a' => array(
'color' => esc_attr( $transparent_content_section_link_color_mobile ),
),
'.ast-theme-transparent-header .below-header-user-select a:hover, .ast-theme-transparent-header .below-header-user-select .widget a:hover' => array(
'color' => esc_attr( $transparent_content_section_link_h_color_mobile ),
),
);
/* Parse CSS from array() */
$css .= astra_parse_css( $transparent_header_desktop );
$css .= astra_parse_css( $transparent_header_tablet, '', astra_get_tablet_breakpoint() );
$css .= astra_parse_css( $transparent_header_mobile, '', astra_get_mobile_breakpoint() );
return $dynamic_css . $css;
}

View File

@@ -0,0 +1,9 @@
<?php
/**
* Index file
*
* @package Astra
* @since Astra 1.0.0
*/
/* Silence is golden, and we agree. */

View File

@@ -0,0 +1,308 @@
<?php
/**
* Colors and Background - Header Options for our theme.
*
* @package Astra Addon
* @link https://www.brainstormforce.com
* @since Astra 1.4.3
*/
// Block direct access to the file.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Bail if Customizer config base class does not exist.
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
return;
}
/**
* Customizer Sanitizes
*
* @since 1.4.3
*/
if ( ! class_exists( 'Astra_Customizer_Colors_Transparent_Header_Configs' ) ) {
/**
* Register Colors and Background - Header Options Customizer Configurations.
*/
class Astra_Customizer_Colors_Transparent_Header_Configs extends Astra_Customizer_Config_Base {
/**
* Register Colors and Background - Header Options Customizer Configurations.
*
* @param Array $configurations Astra Customizer Configurations.
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
* @since 1.4.3
* @return Array Astra Customizer Configurations with updated configurations.
*/
public function register_configuration( $configurations, $wp_customize ) {
$_configs = array(
/**
* Option: Transparent Header logo color
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-logo-color]',
'default' => astra_get_option( 'transparent-header-logo-color' ),
'section' => 'section-transparent-header',
'type' => 'control',
'priority' => 34,
'control' => 'ast-color',
'title' => __( 'Logo Color', 'astra' ),
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab,
'responsive' => false,
'rgba' => true,
'description' => __( 'Use it with transparent images for optimal results.', 'astra' ),
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
),
/**
* Option: Above header background overlay color
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[hba-transparent-header-bg-color-responsive]',
'default' => astra_get_option( 'hba-transparent-header-bg-color-responsive' ),
'section' => 'section-transparent-header',
'type' => 'control',
'priority' => 34,
'transport' => 'postMessage',
'control' => 'ast-responsive-color',
'title' => __( 'Above Header', 'astra' ),
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab,
'responsive' => true,
'rgba' => true,
'divider' => array(
'ast_class' => 'ast-top-divider ast-top-dotted-divider',
'ast_title' => __( 'Background Overlay', 'astra' ),
),
),
/**
* Option: Header background overlay color
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-bg-color-responsive]',
'default' => astra_get_option( 'transparent-header-bg-color-responsive' ),
'section' => 'section-transparent-header',
'type' => 'control',
'priority' => 34,
'transport' => 'postMessage',
'control' => 'ast-responsive-color',
'title' => __( 'Primary Header', 'astra' ),
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab,
'responsive' => true,
'rgba' => true,
),
/**
* Option: Below header background overlay color
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[hbb-transparent-header-bg-color-responsive]',
'default' => astra_get_option( 'hbb-transparent-header-bg-color-responsive' ),
'section' => 'section-transparent-header',
'type' => 'control',
'priority' => 34,
'transport' => 'postMessage',
'control' => 'ast-responsive-color',
'title' => __( 'Below Header', 'astra' ),
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab,
'responsive' => true,
'rgba' => true,
),
/**
* Option: Site Title Color
*/
array(
'name' => 'transparent-header-color-site-title-responsive',
'default' => astra_get_option( 'transparent-header-color-site-title-responsive' ),
'type' => 'sub-control',
'priority' => 1,
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors]',
'section' => 'section-transparent-header',
'control' => 'ast-responsive-color',
'transport' => 'postMessage',
'title' => __( 'Normal', 'astra' ),
'tab' => __( 'Normal', 'astra' ),
'responsive' => true,
'rgba' => true,
),
/**
* Option: Site Title Hover Color
*/
array(
'name' => 'transparent-header-color-h-site-title-responsive',
'default' => astra_get_option( 'transparent-header-color-h-site-title-responsive' ),
'type' => 'sub-control',
'priority' => 1,
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors]',
'section' => 'section-transparent-header',
'control' => 'ast-responsive-color',
'transport' => 'postMessage',
'title' => __( 'Hover', 'astra' ),
'tab' => __( 'Hover', 'astra' ),
'responsive' => true,
'rgba' => true,
),
/**
* Option: Primary Menu Color
*/
array(
'name' => 'transparent-menu-color-responsive',
'default' => astra_get_option( 'transparent-menu-color-responsive' ),
'type' => 'sub-control',
'priority' => 2,
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-menu]',
'section' => 'section-transparent-header',
'control' => 'ast-responsive-color',
'transport' => 'postMessage',
'tab' => __( 'Normal', 'astra' ),
'title' => __( 'Normal', 'astra' ),
'responsive' => true,
'rgba' => true,
),
/**
* Option: Menu Background Color
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-menu-bg-color-responsive]',
'default' => astra_get_option( 'transparent-menu-bg-color-responsive' ),
'type' => 'control',
'priority' => 36,
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'control' => 'ast-responsive-color',
'tab' => __( 'Normal', 'astra' ),
'title' => __( 'Background', 'astra' ),
'responsive' => true,
'rgba' => true,
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab,
),
/**
* Option: Menu Hover Color
*/
array(
'name' => 'transparent-menu-h-color-responsive',
'default' => astra_get_option( 'transparent-menu-h-color-responsive' ),
'type' => 'sub-control',
'priority' => 3,
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-menu]',
'section' => 'section-transparent-header',
'control' => 'ast-responsive-color',
'transport' => 'postMessage',
'tab' => __( 'Hover', 'astra' ),
'title' => __( 'Hover / Active', 'astra' ),
'responsive' => true,
'rgba' => true,
),
/**
* Option: Sub menu text color.
*/
array(
'name' => 'transparent-submenu-color-responsive',
'default' => astra_get_option( 'transparent-submenu-color-responsive' ),
'type' => 'sub-control',
'priority' => 3,
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-submenu]',
'section' => 'section-transparent-header',
'control' => 'ast-responsive-color',
'transport' => 'postMessage',
'tab' => __( 'Normal', 'astra' ),
'title' => __( 'Normal', 'astra' ),
'responsive' => true,
'rgba' => true,
),
/**
* Option: Sub menu background color.
*/
array(
'name' => ASTRA_THEME_SETTINGS . '[transparent-submenu-bg-color-responsive]',
'default' => astra_get_option( 'transparent-submenu-bg-color-responsive' ),
'type' => 'control',
'priority' => 38,
'section' => 'section-transparent-header',
'control' => 'ast-responsive-color',
'transport' => 'postMessage',
'tab' => __( 'Normal', 'astra' ),
'title' => __( 'Background', 'astra' ),
'responsive' => true,
'rgba' => true,
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab : Astra_Builder_Helper::$general_tab,
),
/**
* Option: Sub menu active hover color.
*/
array(
'name' => 'transparent-submenu-h-color-responsive',
'default' => astra_get_option( 'transparent-submenu-h-color-responsive' ),
'type' => 'sub-control',
'priority' => 3,
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-submenu]',
'section' => 'section-transparent-header',
'control' => 'ast-responsive-color',
'transport' => 'postMessage',
'tab' => __( 'Hover', 'astra' ),
'title' => __( 'Hover / Active', 'astra' ),
'responsive' => true,
'rgba' => true,
),
/**
* Option: Content Section Link color.
*/
array(
'name' => 'transparent-content-section-link-color-responsive',
'default' => astra_get_option( 'transparent-content-section-link-color-responsive' ),
'type' => 'sub-control',
'priority' => 4,
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-content]',
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'control' => 'ast-responsive-color',
'tab' => __( 'Normal', 'astra' ),
'title' => __( 'Normal', 'astra' ),
'responsive' => true,
'rgba' => true,
),
/**
* Option: Content Section Link Hover color.
*/
array(
'name' => 'transparent-content-section-link-h-color-responsive',
'default' => astra_get_option( 'transparent-content-section-link-h-color-responsive' ),
'type' => 'sub-control',
'priority' => 4,
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-colors-content]',
'section' => 'section-transparent-header',
'transport' => 'postMessage',
'control' => 'ast-responsive-color',
'tab' => __( 'Hover', 'astra' ),
'title' => __( 'Hover', 'astra' ),
'responsive' => true,
'rgba' => true,
),
);
return array_merge( $configurations, $_configs );
}
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
new Astra_Customizer_Colors_Transparent_Header_Configs();

View File

@@ -0,0 +1,9 @@
<?php
/**
* Index file
*
* @package Astra
* @since Astra 1.0.0
*/
/* Silence is golden, and we agree. */

View File

@@ -0,0 +1,9 @@
<?php
/**
* Index file
*
* @package Astra
* @since Astra 1.0.0
*/
/* Silence is golden, and we agree. */

View File

@@ -0,0 +1,85 @@
<?php
/**
* Admin functions - Functions that add some functionality to WordPress admin panel
*
* @package Astra
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Register menus
*/
if ( ! function_exists( 'astra_register_menu_locations' ) ) {
/**
* Register menus
*
* @since 1.0.0
*/
function astra_register_menu_locations() {
/**
* Primary Menus
*/
register_nav_menus(
array(
'primary' => esc_html__( 'Primary Menu', 'astra' ),
)
);
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
/**
* Register the Secondary & Mobile menus.
*/
register_nav_menus(
array(
'secondary_menu' => esc_html__( 'Secondary Menu', 'astra' ),
'mobile_menu' => esc_html__( 'Off-Canvas Menu', 'astra' ),
)
);
$component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_menu;
for ( $index = 3; $index <= $component_limit; $index++ ) {
if ( ! is_customize_preview() && ! Astra_Builder_Helper::is_component_loaded( 'menu-' . $index ) ) {
continue;
}
register_nav_menus(
array(
'menu_' . $index => esc_html__( 'Menu ', 'astra' ) . $index,
)
);
}
/**
* Register the Account menus.
*/
register_nav_menus(
array(
'loggedin_account_menu' => esc_html__( 'Logged In Account Menu', 'astra' ),
)
);
}
/**
* Footer Menus
*/
register_nav_menus(
array(
'footer_menu' => esc_html__( 'Footer Menu', 'astra' ),
)
);
}
}
add_action( 'init', 'astra_register_menu_locations' );

View File

@@ -0,0 +1,15 @@
.e-global__preview-item.e-global__color[data-global-id="astratextcolor"] {
border-top: 2px solid #404349;
}
.e-global__color[data-global-id^="astra"] {
background: rgb(64 67 73 / 30%);
padding-top: 8px;
padding-bottom: 8px;
border-bottom: 0;
border-top: 0;
margin-top: 0;
margin-bottom: 0;
}
.e-global__preview-item.e-global__color[data-global-id="astraextracolor4"] {
border-bottom: 2px solid #404349;
}

View File

@@ -0,0 +1,15 @@
.e-global__preview-item.e-global__color[data-global-id="astratextcolor"] {
border-top: 2px solid #404349;
}
.e-global__color[data-global-id^="astra"] {
background: rgb(64 67 73 / 30%);
padding-top: 8px;
padding-bottom: 8px;
border-bottom: 0;
border-top: 0;
margin-top: 0;
margin-bottom: 0;
}
.e-global__preview-item.e-global__color[data-global-id="astraextracolor4"] {
border-bottom: 2px solid #404349;
}

View File

@@ -0,0 +1,15 @@
.e-global__preview-item.e-global__color[data-global-id="astratextcolor"] {
border-top: 2px solid #c3cbd2;
}
.e-global__color[data-global-id^="astra"] {
background: rgb(241 243 245 / 40%);
padding-top: 8px;
padding-bottom: 8px;
border-bottom: 0;
border-top: 0;
margin-top: 0;
margin-bottom: 0;
}
.e-global__preview-item.e-global__color[data-global-id="astraextracolor4"] {
border-bottom: 2px solid rgb(195 203 210);
}

View File

@@ -0,0 +1,15 @@
.e-global__preview-item.e-global__color[data-global-id="astratextcolor"] {
border-top: 2px solid #c3cbd2;
}
.e-global__color[data-global-id^="astra"] {
background: rgb(241 243 245 / 40%);
padding-top: 8px;
padding-bottom: 8px;
border-bottom: 0;
border-top: 0;
margin-top: 0;
margin-bottom: 0;
}
.e-global__preview-item.e-global__color[data-global-id="astraextracolor4"] {
border-bottom: 2px solid rgb(195 203 210);
}

View File

@@ -0,0 +1,92 @@
/**
* CSS code for all Astra Extensions admin screens
*
* @package Astra
* @since 1.0.0
*/
.ast-clear:before, .ast-clear:after {
content: " ";
display: table;
}
.ast-clear:after {
clear: both;
}
/**
* Error Message
*/
#message {
display: block;
margin-right: 0;
}
/**
* Astra Welcome Page
*/
.ast-container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
box-sizing: border-box;
}
.ast-container .ast-normal-cursor.hndle{
cursor: initial;
}
.ast-container .postbox .hndle{
background: #ffffff;
border-bottom: 1px solid #e6e6e6;
}
.ast-container div.notice,
.ast-container div.updated,
.ast-container div.error{
margin-top: 0;
}
.ast-container #poststuff h2{
padding: 12px 12px;
}
.ast-flex{
-js-display: flex;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
-moz-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-align-content: center;
-ms-flex-line-pack: center;
align-content: center;
}
/**
* Astra Welcome screen sidebar
*/
.ast-sidebar .hndle .dashicons{
margin: 0 0 0 5px;
}
/**
* Astra Custom Notice for static position
*/
.ast-notice{
margin-bottom: 20px;
}
.ast-notice.ast-notice-error{
border-right-color: #dc3232;
}
.ast-notice{
background: #fff;
border-right: 4px solid #fff;
box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
padding: 1px 12px;
}
.ast-notice p{
margin: 0.5em 0;
padding: 2px;
}

View File

@@ -0,0 +1,92 @@
/**
* CSS code for all Astra Extensions admin screens
*
* @package Astra
* @since 1.0.0
*/
.ast-clear:before, .ast-clear:after {
content: " ";
display: table;
}
.ast-clear:after {
clear: both;
}
/**
* Error Message
*/
#message {
display: block;
margin-left: 0;
}
/**
* Astra Welcome Page
*/
.ast-container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
box-sizing: border-box;
}
.ast-container .ast-normal-cursor.hndle{
cursor: initial;
}
.ast-container .postbox .hndle{
background: #ffffff;
border-bottom: 1px solid #e6e6e6;
}
.ast-container div.notice,
.ast-container div.updated,
.ast-container div.error{
margin-top: 0;
}
.ast-container #poststuff h2{
padding: 12px 12px;
}
.ast-flex{
-js-display: flex;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
-moz-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-align-content: center;
-ms-flex-line-pack: center;
align-content: center;
}
/**
* Astra Welcome screen sidebar
*/
.ast-sidebar .hndle .dashicons{
margin: 0 5px 0 0;
}
/**
* Astra Custom Notice for static position
*/
.ast-notice{
margin-bottom: 20px;
}
.ast-notice.ast-notice-error{
border-left-color: #dc3232;
}
.ast-notice{
background: #fff;
border-left: 4px solid #fff;
box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
padding: 1px 12px;
}
.ast-notice p{
margin: 0.5em 0;
padding: 2px;
}

View File

@@ -0,0 +1,276 @@
.astra-review-notice-container {
display: flex;
align-items: center;
padding-top: 10px;
}
.astra-review-notice-container .dashicons {
font-size: 1.4em;
padding-right: 10px;
}
.astra-review-notice-container a {
padding-right: 5px;
text-decoration: none;
}
.astra-review-notice-container .dashicons:first-child {
padding-right: 0;
}
.notice-image img {
max-width: 90px;
}
.notice-content .notice-heading {
padding-bottom: 5px;
}
.notice-content {
margin-right: 15px;
}
.notice-container {
padding-top: 10px;
padding-bottom: 10px;
display: flex;
justify-content: left;
align-items: center;
}
#astra-sites-on-active .notice-image img,
#astra-upgrade-pro-wc .notice-image img {
max-width: 50px;
margin-right: 5px;
}
#astra-sites-on-active .notice-content .notice-heading,
#astra-upgrade-pro-wc .notice-content .notice-heading {
margin: 0 0 10px;
padding: 0;
font-weight: 600;
font-size: 1.3em;
color: #1e293b;
}
#astra-sites-on-active .notice-content p,
#astra-upgrade-pro-wc .notice-content p {
padding-top: 0;
margin-top: 0;
margin-bottom: 6px;
color: #475569;
}
#astra-sites-on-active .notice-container,
#astra-upgrade-pro-wc .notice-container {
padding: 18px 0 18px;
align-items: start;
}
#astra-sites-on-active .button.button-hero {
font-size: 13px;
min-height: 30px;
line-height: 26px;
padding: 0 12px;
height: 30px;
}
#astra-sites-on-active .astra-review-notice-container,
#astra-upgrade-pro-wc .astra-review-notice-container {
padding-top: 5px;
}
#astra-sites-on-active .button-primary,
#astra-upgrade-pro-wc .button-primary {
box-shadow: 0 1px 0 #006799;
}
#astra-sites-on-active .button.updating-message:before,
#astra-sites-on-active .button.updated-message:before,
#astra-sites-on-active .button.installed:before,
#astra-sites-on-active .button.installing:before {
margin: 4px -1px 0px 5px;
}
.wp-core-ui .astra-notice-wrapper:has(.ast-welcome-banner) {
padding-left: 0;
}
.ast-welcome-banner {
width: 100%;
display: flex;
gap: 40px;
justify-content: center;
overflow: hidden;
}
.ast-col-left {
width: 50%;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
padding: 40px 28px 40px 0px;
}
.ast-col-right {
width: 50%;
display: flex;
position: relative;
flex-direction: column;
justify-content: center;
align-items: center;
}
.ast-col-right > img {
width: 100%;
position: relative;
}
.ast-welcome-banner .notice-title {
color: #1e293b;
font-size: 30px;
font-weight: 600;
line-height: 40px;
letter-spacing: -0.2px;
margin-top: 12px;
margin-bottom: 12px;
padding: 0;
}
.ast-welcome-banner .description {
color: #475569;
font-size: 16px;
line-height: 28px;
margin-top: 0px;
margin-bottom: 32px;
padding: 0px;
}
#astra-sites-on-active .astra-notice-container .notice-actions > button {
border-radius: 6px;
background: #046bd2;
padding: 12px 24px;
/* shadow/sm */
color: white;
box-shadow: none;
border: none;
font-size: 16px;
font-weight: 500;
line-height: 24px;
}
.ast-welcome-banner .sub-notice-title {
display: flex;
flex-direction: column;
align-self: stretch;
color: #646970;
font-size: 14px;
line-height: 22px;
margin: 0;
padding: 0;
}
.astra-notice-container:has(.ast-welcome-banner) {
padding-top: 0;
padding-bottom: 0;
}
.ast-welcome-banner .notice-actions button {
font-size: 14px;
line-height: 22px;
font-weight: 500;
padding: 12px 24px;
}
p.sub-notice-description {
color: #475569;
font-size: 13px;
line-height: 20px;
text-decoration: underline;
cursor: pointer;
margin: 0;
padding: 16px 0 0;
}
.ast-st-sites-cta {
border: 1px solid #fff;
border-radius: 9999px;
display: flex;
gap: 12px;
justify-content: center;
align-items: center;
align-content: center;
box-shadow: 0px 16px 40px -16px #00000040;
z-index: 9;
padding: 12px;
position: absolute;
bottom: 40px;
background: rgb(228 228 228 / 50%);
backdrop-filter: blur(4px);
}
.ast-st-sites-cta .ast-page-builder-ico {
padding: 8px;
background: #fff;
border-radius: 24px;
width: 20px;
height: 20px;
}
.ast-st-sites-cta span {
font-size: 16px;
line-height: 20px;
color: #0F172A;
font-weight: 700;
width: 100px;
text-align: center;
padding-left: 6px;
border-left: 1px solid #fff;
}
#astra-sites-on-active {
padding: 0;
}
@media screen and (max-width: 1199px) {
.ast-col-right {
display: none;
}
.ast-col-left {
width: 100%;
padding: 20px 24px;
align-items: unset;
}
#astra-sites-on-active .astra-notice-container .notice-actions > button {
width: 100%;
}
}
@media screen and (max-width: 782px) {
.ast-col-left {
width: 100%;
font-size: 14px;
align-items: unset;
padding-right: 15px;
padding-left: 15px;
}
#astra-sites-on-active .astra-notice-container .notice-actions > button {
font-size: 14px;
width: 100%;
}
.ast-welcome-banner .notice-title {
font-size: 22px;
}
.ast-welcome-banner .sub-notice-title,
.ast-welcome-banner .description {
font-size: 14px;
line-height: 24px;
}
}
@media screen and (min-width: 1199px) and (max-width: 1700px) {
.ast-welcome-banner {
max-height: 350px;
}
.ast-col-left {
width: 45%;
}
.ast-col-right {
width: 65%;
}
#astra-sites-on-active .astra-notice-container .notice-actions > button {
font-size: 14px;
}
.ast-welcome-banner .notice-title {
font-size: 24px;
line-height: 36px;
}
.ast-welcome-banner .sub-notice-title {
font-size: 13px;
}
}

View File

@@ -0,0 +1,276 @@
.astra-review-notice-container {
display: flex;
align-items: center;
padding-top: 10px;
}
.astra-review-notice-container .dashicons {
font-size: 1.4em;
padding-left: 10px;
}
.astra-review-notice-container a {
padding-left: 5px;
text-decoration: none;
}
.astra-review-notice-container .dashicons:first-child {
padding-left: 0;
}
.notice-image img {
max-width: 90px;
}
.notice-content .notice-heading {
padding-bottom: 5px;
}
.notice-content {
margin-left: 15px;
}
.notice-container {
padding-top: 10px;
padding-bottom: 10px;
display: flex;
justify-content: left;
align-items: center;
}
#astra-sites-on-active .notice-image img,
#astra-upgrade-pro-wc .notice-image img {
max-width: 50px;
margin-left: 5px;
}
#astra-sites-on-active .notice-content .notice-heading,
#astra-upgrade-pro-wc .notice-content .notice-heading {
margin: 0 0 10px;
padding: 0;
font-weight: 600;
font-size: 1.3em;
color: #1e293b;
}
#astra-sites-on-active .notice-content p,
#astra-upgrade-pro-wc .notice-content p {
padding-top: 0;
margin-top: 0;
margin-bottom: 6px;
color: #475569;
}
#astra-sites-on-active .notice-container,
#astra-upgrade-pro-wc .notice-container {
padding: 18px 0 18px;
align-items: start;
}
#astra-sites-on-active .button.button-hero {
font-size: 13px;
min-height: 30px;
line-height: 26px;
padding: 0 12px;
height: 30px;
}
#astra-sites-on-active .astra-review-notice-container,
#astra-upgrade-pro-wc .astra-review-notice-container {
padding-top: 5px;
}
#astra-sites-on-active .button-primary,
#astra-upgrade-pro-wc .button-primary {
box-shadow: 0 1px 0 #006799;
}
#astra-sites-on-active .button.updating-message:before,
#astra-sites-on-active .button.updated-message:before,
#astra-sites-on-active .button.installed:before,
#astra-sites-on-active .button.installing:before {
margin: 4px 5px 0px -1px;
}
.wp-core-ui .astra-notice-wrapper:has(.ast-welcome-banner) {
padding-right: 0;
}
.ast-welcome-banner {
width: 100%;
display: flex;
gap: 40px;
justify-content: center;
overflow: hidden;
}
.ast-col-left {
width: 50%;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
padding: 40px 0px 40px 28px;
}
.ast-col-right {
width: 50%;
display: flex;
position: relative;
flex-direction: column;
justify-content: center;
align-items: center;
}
.ast-col-right > img {
width: 100%;
position: relative;
}
.ast-welcome-banner .notice-title {
color: #1e293b;
font-size: 30px;
font-weight: 600;
line-height: 40px;
letter-spacing: -0.2px;
margin-top: 12px;
margin-bottom: 12px;
padding: 0;
}
.ast-welcome-banner .description {
color: #475569;
font-size: 16px;
line-height: 28px;
margin-top: 0px;
margin-bottom: 32px;
padding: 0px;
}
#astra-sites-on-active .astra-notice-container .notice-actions > button {
border-radius: 6px;
background: #046bd2;
padding: 12px 24px;
/* shadow/sm */
color: white;
box-shadow: none;
border: none;
font-size: 16px;
font-weight: 500;
line-height: 24px;
}
.ast-welcome-banner .sub-notice-title {
display: flex;
flex-direction: column;
align-self: stretch;
color: #646970;
font-size: 14px;
line-height: 22px;
margin: 0;
padding: 0;
}
.astra-notice-container:has(.ast-welcome-banner) {
padding-top: 0;
padding-bottom: 0;
}
.ast-welcome-banner .notice-actions button {
font-size: 14px;
line-height: 22px;
font-weight: 500;
padding: 12px 24px;
}
p.sub-notice-description {
color: #475569;
font-size: 13px;
line-height: 20px;
text-decoration: underline;
cursor: pointer;
margin: 0;
padding: 16px 0 0;
}
.ast-st-sites-cta {
border: 1px solid #fff;
border-radius: 9999px;
display: flex;
gap: 12px;
justify-content: center;
align-items: center;
align-content: center;
box-shadow: 0px 16px 40px -16px #00000040;
z-index: 9;
padding: 12px;
position: absolute;
bottom: 40px;
background: rgb(228 228 228 / 50%);
backdrop-filter: blur(4px);
}
.ast-st-sites-cta .ast-page-builder-ico {
padding: 8px;
background: #fff;
border-radius: 24px;
width: 20px;
height: 20px;
}
.ast-st-sites-cta span {
font-size: 16px;
line-height: 20px;
color: #0F172A;
font-weight: 700;
width: 100px;
text-align: center;
padding-right: 6px;
border-right: 1px solid #fff;
}
#astra-sites-on-active {
padding: 0;
}
@media screen and (max-width: 1199px) {
.ast-col-right {
display: none;
}
.ast-col-left {
width: 100%;
padding: 20px 24px;
align-items: unset;
}
#astra-sites-on-active .astra-notice-container .notice-actions > button {
width: 100%;
}
}
@media screen and (max-width: 782px) {
.ast-col-left {
width: 100%;
font-size: 14px;
align-items: unset;
padding-left: 15px;
padding-right: 15px;
}
#astra-sites-on-active .astra-notice-container .notice-actions > button {
font-size: 14px;
width: 100%;
}
.ast-welcome-banner .notice-title {
font-size: 22px;
}
.ast-welcome-banner .sub-notice-title,
.ast-welcome-banner .description {
font-size: 14px;
line-height: 24px;
}
}
@media screen and (min-width: 1199px) and (max-width: 1700px) {
.ast-welcome-banner {
max-height: 350px;
}
.ast-col-left {
width: 45%;
}
.ast-col-right {
width: 65%;
}
#astra-sites-on-active .astra-notice-container .notice-actions > button {
font-size: 14px;
}
.ast-welcome-banner .notice-title {
font-size: 24px;
line-height: 36px;
}
.ast-welcome-banner .sub-notice-title {
font-size: 13px;
}
}

View File

@@ -0,0 +1,767 @@
html {
font-size: 93.75%;
}
/* Variables */
/*---------- Media Query min-width Structure ----------*/
/*---------- Media Query max-width Structure ----------*/
/*---------- Break-point min-width Structure ----------*/
/*---------- Break-point max-width Structure ----------*/
/*---------- Font Size ----------*/
/*---------- Line Height ----------*/
/*---------- Site Basic Structure ----------*/
/*---------- z-index Structure ----------*/
/*
* Button mixin- creates a button effect with correct
* highlights/shadows, based on a base color.
*/
.ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block {
transition: all 0.2s;
}
.ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted, .ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block:hover {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
}
.ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted:after {
box-shadow: none;
}
.edit-post-visual-editor {
/* must have higher specificity than alternative color schemes inline styles */
}
.edit-post-visual-editor ::selection {
color: #fff;
background: royalblue;
}
.edit-post-visual-editor body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.edit-post-visual-editor body:not(.logged-in) {
position: relative;
}
.edit-post-visual-editor #page {
position: relative;
}
.edit-post-visual-editor a,
.edit-post-visual-editor a:focus {
text-decoration: none;
}
.edit-post-visual-editor a,
.edit-post-visual-editor .site-header a *,
.edit-post-visual-editor .site-footer a *,
.edit-post-visual-editor .secondary a * {
transition: all 0.2s linear;
}
.edit-post-visual-editor .capitalize {
text-transform: uppercase;
}
.edit-post-visual-editor img {
vertical-align: middle;
}
.edit-post-visual-editor .entry-content h1,
.edit-post-visual-editor .entry-content h2,
.edit-post-visual-editor .entry-content h3,
.edit-post-visual-editor .entry-content h4,
.edit-post-visual-editor .entry-content h5,
.edit-post-visual-editor .entry-content h6 {
margin-bottom: 20px;
}
.edit-post-visual-editor p {
margin-bottom: 1.75em;
}
.edit-post-visual-editor blockquote {
margin: 1.5em 3em 1.5em 1em;
font-size: 1.1em;
line-height: inherit;
position: relative;
}
.edit-post-visual-editor .ast-button,
.edit-post-visual-editor .button,
.edit-post-visual-editor input[type="button"],
.edit-post-visual-editor input[type="submit"] {
border-radius: 0;
padding: 18px 30px;
border: 0;
box-shadow: none;
text-shadow: none;
}
.edit-post-visual-editor .ast-button:hover,
.edit-post-visual-editor .button:hover,
.edit-post-visual-editor input[type="button"]:hover,
.edit-post-visual-editor input[type="submit"]:hover {
box-shadow: none;
}
.edit-post-visual-editor .ast-button:active, .edit-post-visual-editor .ast-button:focus,
.edit-post-visual-editor .button:active,
.edit-post-visual-editor .button:focus,
.edit-post-visual-editor input[type="button"]:active,
.edit-post-visual-editor input[type="button"]:focus,
.edit-post-visual-editor input[type="submit"]:active,
.edit-post-visual-editor input[type="submit"]:focus {
box-shadow: none;
}
.edit-post-visual-editor .site-title {
font-weight: normal;
}
.edit-post-visual-editor .site-title,
.edit-post-visual-editor .site-description {
margin-bottom: 0;
}
.edit-post-visual-editor .site-title a,
.edit-post-visual-editor .site-title:hover a,
.edit-post-visual-editor .site-title:focus a,
.edit-post-visual-editor .site-description a,
.edit-post-visual-editor .site-description:hover a,
.edit-post-visual-editor .site-description:focus a {
transition: all 0.2s linear;
}
.edit-post-visual-editor .site-title a,
.edit-post-visual-editor .site-title a:focus,
.edit-post-visual-editor .site-title a:hover,
.edit-post-visual-editor .site-title a:visited {
color: #222;
}
.edit-post-visual-editor .site-description a,
.edit-post-visual-editor .site-description a:focus,
.edit-post-visual-editor .site-description a:hover,
.edit-post-visual-editor .site-description a:visited {
color: #999;
}
.edit-post-visual-editor .search-form .search-field {
outline: none;
}
.edit-post-visual-editor .ast-search-menu-icon {
position: relative;
z-index: 3;
}
.edit-post-visual-editor .site .skip-link {
background-color: #f1f1f1;
box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.2);
color: #21759b;
display: block;
font-family: Montserrat, "Helvetica Neue", sans-serif;
font-size: 14px;
font-weight: 700;
right: -9999em;
outline: none;
padding: 15px 23px 14px;
text-decoration: none;
text-transform: none;
top: -9999em;
}
.edit-post-visual-editor .site .skip-link:focus {
clip: auto;
height: auto;
right: 6px;
top: 7px;
width: auto;
z-index: 100000;
outline: thin dotted;
}
.logged-in .edit-post-visual-editor .site .skip-link {
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.2);
font-family: "Open Sans", sans-serif;
}
.edit-post-visual-editor h1, .edit-post-visual-editor h2, .edit-post-visual-editor h3, .edit-post-visual-editor h4, .edit-post-visual-editor h5, .edit-post-visual-editor h6 {
clear: both;
}
.edit-post-visual-editor h1,
.edit-post-visual-editor .entry-content h1 {
color: #808285;
font-size: 2em;
line-height: 1.2;
}
.edit-post-visual-editor h2,
.edit-post-visual-editor .entry-content h2 {
color: #808285;
font-size: 1.7em;
line-height: 1.3;
}
.edit-post-visual-editor h3,
.edit-post-visual-editor .entry-content h3 {
color: #808285;
font-size: 1.5em;
line-height: 1.4;
}
.edit-post-visual-editor h4,
.edit-post-visual-editor .entry-content h4 {
color: #808285;
line-height: 1.5;
font-size: 1.3em;
}
.edit-post-visual-editor h5,
.edit-post-visual-editor .entry-content h5 {
color: #808285;
line-height: 1.6;
font-size: 1.2em;
}
.edit-post-visual-editor h6,
.edit-post-visual-editor .entry-content h6 {
color: #808285;
line-height: 1.7;
font-size: 1.1em;
}
.edit-post-visual-editor .wp-block-heading h1 {
line-height: 1.2;
}
.edit-post-visual-editor .wp-block-heading h2 {
line-height: 1.3;
}
.edit-post-visual-editor .wp-block-heading h3 {
line-height: 1.4;
}
.edit-post-visual-editor .wp-block-heading h4 {
line-height: 1.5;
}
.edit-post-visual-editor .wp-block-heading h5 {
line-height: 1.6;
}
.edit-post-visual-editor .wp-block-heading h6 {
line-height: 1.7;
}
.edit-post-visual-editor button.components-button {
color: inherit;
}
#editor .edit-post-visual-editor.responsive-enabled {
background-color: #2f2f2f;
}
.editor-styles-wrapper .block-editor-block-list__block h1 {
line-height: 1.2;
}
.editor-styles-wrapper .block-editor-block-list__block h2 {
line-height: 1.3;
}
.editor-styles-wrapper .block-editor-block-list__block h3 {
line-height: 1.4;
}
.editor-styles-wrapper .block-editor-block-list__block h4 {
line-height: 1.5;
}
.editor-styles-wrapper .block-editor-block-list__block h5 {
line-height: 1.6;
}
.editor-styles-wrapper .block-editor-block-list__block h6 {
line-height: 1.7;
}
.edit-post-visual-editor p,
.block-editor-block-list__block p,
.editor-default-block-appender textarea.editor-default-block-appender__content {
font-size: 15px;
font-size: 1rem;
}
.editor-post-title__block .editor-post-title__input {
font-size: 30px;
font-size: 2rem;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
font-weight: normal;
}
@media (min-width: 600px) {
.edit-post-visual-editor .block-editor-block-list__block {
padding-right: 0;
padding-left: 0;
}
}
.edit-post-visual-editor .block-editor-block-list__block .editor-block-list__block-edit {
margin-right: 0;
margin-left: 0;
}
.edit-post-visual-editor .block-editor-block-list__block > .editor-block-mover {
right: -50px;
top: -5px;
}
@media (min-width: 600px) {
.edit-post-visual-editor .block-editor-block-list__block.wp-block-quote {
padding: 1.2em;
}
}
.block-editor-block-list__block[data-align=full] {
max-width: none;
}
@media (min-width: 600px) {
.block-editor-block-list__block[data-align=full] .editor-block-list__block-edit {
padding-right: 0;
padding-left: 0;
}
}
.block-editor-block-list__block[data-align=wide] {
max-width: 1400px;
}
.editor-default-block-appender__content {
margin-top: 32px;
}
.wp-block-latest-posts.is-grid {
list-style: none;
}
.blocks-gallery-grid {
margin: 0;
}
.wp-block-gallery {
margin: 0;
}
.wp-block-gallery.is-cropped .blocks-gallery-item img {
height: 100%;
}
.edit-post-visual-editor .blocks-gallery-grid {
margin: 0;
}
.wp-block-latest-posts {
margin-right: 0;
}
.wp-block-latest-posts li {
list-style: none;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: inherit;
}
.mce-widget i {
font-style: normal;
}
#elementor-editor-button {
background: #0073aa;
border-color: #0073aa;
color: #fff;
font-size: 14px;
height: 46px;
line-height: 44px;
padding: 0 36px;
display: inline-block;
border-width: 1px;
border-style: solid;
-webkit-appearance: none;
border-radius: 3px;
white-space: nowrap;
box-sizing: border-box;
box-shadow: 0 2px 0 #006799;
}
#elementor-editor-button:hover, #elementor-editor-button:focus {
background: #007db9;
border-color: #00699b;
color: #fff;
}
#elementor-editor-button:focus {
box-shadow: 0 0 0 1px #fff, 0 0 0 3px #0073aa;
}
#elementor-editor-button:active {
background: #006291;
border-color: #006291;
color: #fff;
}
#elementor-editor-button.active, #elementor-editor-button.active:focus, #elementor-editor-button.active:hover {
background: #0073aa;
color: #fff;
border-color: #003f5e;
box-shadow: inset 0 2px 5px -3px black;
}
#elementor-editor-button i {
font-style: normal;
color: white;
}
.editor-media-placeholder button,
.fl-builder-layout-launch-view button {
margin: 2px;
}
.fl-builder-layout-launch-view .is-primary.is-primary {
color: white;
}
.ast-separate-container #wpwrap .edit-post-visual-editor {
background-color: #f5f5f5;
}
/**
* Woocommerce Gutenberg Blocks Product Grid CSS Compatibility.
*/
.wc-block-grid .wc-block-grid__products .wc-block-grid__product {
text-align: right;
margin-bottom: 2.5em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product.product-category > a {
display: inline-block;
position: relative;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product a img {
width: 100%;
height: auto;
display: block;
margin: 0 0 .8em 0;
box-shadow: none;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-title {
margin-bottom: .5em;
padding: 0;
font-size: 1em;
line-height: 1.2;
font-weight: inherit;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .star-rating {
margin: 0 0 .5em auto;
backface-visibility: hidden;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-product__link {
position: relative;
display: block;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-product__link:hover .ast-shop-product-out-of-stock {
background-color: white;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product.product-category > a:hover .woocommerce-loop-category__title {
background-color: white;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-category__title {
bottom: 1.8em;
font-size: 0.9em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-category__title .count {
font-size: .7em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .price {
line-height: 1.3;
margin-bottom: 0;
font-weight: 700;
margin-bottom: .5em;
font-size: .9em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .price del {
display: initial;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wp-block-button__link {
margin-top: .5em;
margin-bottom: .5em;
white-space: normal;
line-height: 1.3;
font-size: 100%;
font-weight: 700;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wp-block-button__link.added {
margin-bottom: 0;
transition: margin 0s;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-category__title {
text-transform: uppercase;
font-weight: bold;
line-height: 1.5;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-category__title .count {
display: block;
background: none;
opacity: .5;
font-size: .75em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-onsale {
min-width: 3em;
min-height: 3em;
line-height: 3em;
padding: 0;
font-size: 1em;
font-weight: normal;
text-transform: capitalize;
position: absolute;
text-align: center;
border-radius: 100%;
z-index: 9;
top: 0;
left: 15px;
right: auto;
margin: -0.5em 0 0 -0.5em;
}
.edit-post-visual-editor__post-title-wrapper {
position: relative;
max-width: var(--wp--custom--ast-content-width-size);
margin-right: auto !important;
margin-left: auto !important;
margin-bottom: 1.5em;
}
.edit-post-visual-editor__post-title-wrapper.invisible {
opacity: 0.5;
}
.edit-post-visual-editor__post-title-wrapper .title-visibility {
cursor: pointer;
font-size: 18px;
width: 36px;
height: 100%;
text-align: center;
color: var(--wp-admin-theme-color);
vertical-align: middle;
position: absolute;
right: -37px;
bottom: 0;
opacity: 0;
margin: 0 !important;
padding: 0 !important;
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
transition: all 0.2s;
}
.edit-post-visual-editor__post-title-wrapper .title-visibility:before {
width: 100%;
height: 100%;
display: inline-flex;
align-items: center;
justify-content: center;
}
.edit-post-visual-editor__post-title-wrapper .title-visibility:after {
content: attr(data-tooltip);
white-space: nowrap;
border-radius: 2px;
pointer-events: none;
color: #fff;
background: #1e1e1e;
opacity: 0;
visibility: hidden;
width: max-content;
line-height: 26px;
margin-right: -1px;
display: flex;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
align-items: flex-start;
padding: 0 6px;
font-size: 12px;
transition: all 0.2s;
}
.edit-post-visual-editor__post-title-wrapper h1.editor-post-title__input {
padding: 10px 6px;
transition: all 0.2s;
}
.edit-post-visual-editor__post-title-wrapper h1.editor-post-title__input.is-selected {
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
}
.edit-post-visual-editor__post-title-wrapper h1.editor-post-title__input.is-selected + .title-visibility {
opacity: 1;
color: var(--wp-admin-theme-color);
}
.edit-post-visual-editor__post-title-wrapper .ast-show-visibility-icon {
opacity: 1;
color: var(--wp-admin-theme-color);
}
.edit-post-visual-editor__post-title-wrapper .ast-show-editor-title-outline {
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
}
.ast-page-builder-template .edit-post-visual-editor__post-title-wrapper, .ast-stacked-title-visibility .edit-post-visual-editor__post-title-wrapper {
max-width: none;
padding: 0 20px;
}
.ast-page-builder-template .edit-post-visual-editor__post-title-wrapper .title-visibility, .ast-stacked-title-visibility .edit-post-visual-editor__post-title-wrapper .title-visibility {
right: unset;
top: -41px;
height: 40px;
}
/**
* Gutenberg editor improving UI/UX.
*/
.edit-post-visual-editor ul.block-editor-block-list__block,
.edit-post-visual-editor ol.block-editor-block-list__block {
margin-right: 20px;
}
.block-editor-block-list__block.wp-block.wp-social-link {
font-size: inherit;
}
.edit-post-visual-editor .block-editor-block-list__block.wp-social-link {
padding: 0;
}
.wp-block ol, .wp-block ul {
margin-right: 20px;
margin-left: 20px;
}
.edit-post-visual-editor .wp-block.wp-block-shortcode {
padding: 20px;
}
.wp-block-table td, .wp-block-table th {
padding: 0.5em;
border: 1px solid;
word-break: normal;
}
.edit-post-visual-editor pre.wp-block, .edit-post-visual-editor .wp-block.wp-block-query-title {
padding-right: 20px;
}
.block-editor-block-list__layout .block-editor-block-list__block.wp-block-button:not(:first-child) {
padding-right: 0;
padding-left: 0;
}
.block-editor-block-list__empty-block-inserter .block-editor-inserter__toggle.components-button.has-icon {
margin: 6px 0 0 -2px;
border-radius: 0;
}
.components-dropdown__content .components-popover__content {
min-width: 290px;
}
.components-color-palette__custom-color-dropdown-content .components-popover__content {
min-width: auto;
}
.wp-block-buttons > .wp-block.wp-block-button {
padding-left: 0;
}
.wp-block .wp-block-categories__list {
padding-right: 0;
}
.wp-block-latest-comments .wp-block-latest-comments {
margin-right: 0;
}
.wp-block-quote.is-style-large cite {
text-align: right;
}
.editor-styles-wrapper p {
line-height: 1.85714285714286;
}
.wp-block-paragraph.has-background {
padding: 1.25em 2.375em;
}
.ast-theme-block-color-name {
mix-blend-mode: difference;
}
.components-color-palette__custom-color {
text-align: right;
padding-right: 5px;
}
h1.wp-block.has-background,
h2.wp-block.has-background,
h3.wp-block.has-background,
h4.wp-block.has-background,
h5.wp-block.has-background,
h6.wp-block.has-background {
padding: 1.25em 2.375em;
}
/**
* 6.3 Compatibility fixes in block editor.
*/
span.title-visibility svg {
position: absolute;
top: 50%;
right: 50%;
transform: translate(50%, -50%);
width: 16px;
height: 40px;
fill: var(--wp-admin-theme-color);
}
#astra_settings_meta_box .components-button.is-primary:hover:not(:disabled),
.ast-meta-settings-content .components-button.is-primary:hover:not(:disabled) {
background: var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #2145e6)) !important;
color: var(--wp-components-color-accent-inverted, #fff) !important;
}

View File

@@ -0,0 +1,767 @@
html {
font-size: 93.75%;
}
/* Variables */
/*---------- Media Query min-width Structure ----------*/
/*---------- Media Query max-width Structure ----------*/
/*---------- Break-point min-width Structure ----------*/
/*---------- Break-point max-width Structure ----------*/
/*---------- Font Size ----------*/
/*---------- Line Height ----------*/
/*---------- Site Basic Structure ----------*/
/*---------- z-index Structure ----------*/
/*
* Button mixin- creates a button effect with correct
* highlights/shadows, based on a base color.
*/
.ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block {
transition: all 0.2s;
}
.ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted, .ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block:hover {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
}
.ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted:after {
box-shadow: none;
}
.edit-post-visual-editor {
/* must have higher specificity than alternative color schemes inline styles */
}
.edit-post-visual-editor ::selection {
color: #fff;
background: royalblue;
}
.edit-post-visual-editor body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.edit-post-visual-editor body:not(.logged-in) {
position: relative;
}
.edit-post-visual-editor #page {
position: relative;
}
.edit-post-visual-editor a,
.edit-post-visual-editor a:focus {
text-decoration: none;
}
.edit-post-visual-editor a,
.edit-post-visual-editor .site-header a *,
.edit-post-visual-editor .site-footer a *,
.edit-post-visual-editor .secondary a * {
transition: all 0.2s linear;
}
.edit-post-visual-editor .capitalize {
text-transform: uppercase;
}
.edit-post-visual-editor img {
vertical-align: middle;
}
.edit-post-visual-editor .entry-content h1,
.edit-post-visual-editor .entry-content h2,
.edit-post-visual-editor .entry-content h3,
.edit-post-visual-editor .entry-content h4,
.edit-post-visual-editor .entry-content h5,
.edit-post-visual-editor .entry-content h6 {
margin-bottom: 20px;
}
.edit-post-visual-editor p {
margin-bottom: 1.75em;
}
.edit-post-visual-editor blockquote {
margin: 1.5em 1em 1.5em 3em;
font-size: 1.1em;
line-height: inherit;
position: relative;
}
.edit-post-visual-editor .ast-button,
.edit-post-visual-editor .button,
.edit-post-visual-editor input[type="button"],
.edit-post-visual-editor input[type="submit"] {
border-radius: 0;
padding: 18px 30px;
border: 0;
box-shadow: none;
text-shadow: none;
}
.edit-post-visual-editor .ast-button:hover,
.edit-post-visual-editor .button:hover,
.edit-post-visual-editor input[type="button"]:hover,
.edit-post-visual-editor input[type="submit"]:hover {
box-shadow: none;
}
.edit-post-visual-editor .ast-button:active, .edit-post-visual-editor .ast-button:focus,
.edit-post-visual-editor .button:active,
.edit-post-visual-editor .button:focus,
.edit-post-visual-editor input[type="button"]:active,
.edit-post-visual-editor input[type="button"]:focus,
.edit-post-visual-editor input[type="submit"]:active,
.edit-post-visual-editor input[type="submit"]:focus {
box-shadow: none;
}
.edit-post-visual-editor .site-title {
font-weight: normal;
}
.edit-post-visual-editor .site-title,
.edit-post-visual-editor .site-description {
margin-bottom: 0;
}
.edit-post-visual-editor .site-title a,
.edit-post-visual-editor .site-title:hover a,
.edit-post-visual-editor .site-title:focus a,
.edit-post-visual-editor .site-description a,
.edit-post-visual-editor .site-description:hover a,
.edit-post-visual-editor .site-description:focus a {
transition: all 0.2s linear;
}
.edit-post-visual-editor .site-title a,
.edit-post-visual-editor .site-title a:focus,
.edit-post-visual-editor .site-title a:hover,
.edit-post-visual-editor .site-title a:visited {
color: #222;
}
.edit-post-visual-editor .site-description a,
.edit-post-visual-editor .site-description a:focus,
.edit-post-visual-editor .site-description a:hover,
.edit-post-visual-editor .site-description a:visited {
color: #999;
}
.edit-post-visual-editor .search-form .search-field {
outline: none;
}
.edit-post-visual-editor .ast-search-menu-icon {
position: relative;
z-index: 3;
}
.edit-post-visual-editor .site .skip-link {
background-color: #f1f1f1;
box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.2);
color: #21759b;
display: block;
font-family: Montserrat, "Helvetica Neue", sans-serif;
font-size: 14px;
font-weight: 700;
left: -9999em;
outline: none;
padding: 15px 23px 14px;
text-decoration: none;
text-transform: none;
top: -9999em;
}
.edit-post-visual-editor .site .skip-link:focus {
clip: auto;
height: auto;
left: 6px;
top: 7px;
width: auto;
z-index: 100000;
outline: thin dotted;
}
.logged-in .edit-post-visual-editor .site .skip-link {
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.2);
font-family: "Open Sans", sans-serif;
}
.edit-post-visual-editor h1, .edit-post-visual-editor h2, .edit-post-visual-editor h3, .edit-post-visual-editor h4, .edit-post-visual-editor h5, .edit-post-visual-editor h6 {
clear: both;
}
.edit-post-visual-editor h1,
.edit-post-visual-editor .entry-content h1 {
color: #808285;
font-size: 2em;
line-height: 1.2;
}
.edit-post-visual-editor h2,
.edit-post-visual-editor .entry-content h2 {
color: #808285;
font-size: 1.7em;
line-height: 1.3;
}
.edit-post-visual-editor h3,
.edit-post-visual-editor .entry-content h3 {
color: #808285;
font-size: 1.5em;
line-height: 1.4;
}
.edit-post-visual-editor h4,
.edit-post-visual-editor .entry-content h4 {
color: #808285;
line-height: 1.5;
font-size: 1.3em;
}
.edit-post-visual-editor h5,
.edit-post-visual-editor .entry-content h5 {
color: #808285;
line-height: 1.6;
font-size: 1.2em;
}
.edit-post-visual-editor h6,
.edit-post-visual-editor .entry-content h6 {
color: #808285;
line-height: 1.7;
font-size: 1.1em;
}
.edit-post-visual-editor .wp-block-heading h1 {
line-height: 1.2;
}
.edit-post-visual-editor .wp-block-heading h2 {
line-height: 1.3;
}
.edit-post-visual-editor .wp-block-heading h3 {
line-height: 1.4;
}
.edit-post-visual-editor .wp-block-heading h4 {
line-height: 1.5;
}
.edit-post-visual-editor .wp-block-heading h5 {
line-height: 1.6;
}
.edit-post-visual-editor .wp-block-heading h6 {
line-height: 1.7;
}
.edit-post-visual-editor button.components-button {
color: inherit;
}
#editor .edit-post-visual-editor.responsive-enabled {
background-color: #2f2f2f;
}
.editor-styles-wrapper .block-editor-block-list__block h1 {
line-height: 1.2;
}
.editor-styles-wrapper .block-editor-block-list__block h2 {
line-height: 1.3;
}
.editor-styles-wrapper .block-editor-block-list__block h3 {
line-height: 1.4;
}
.editor-styles-wrapper .block-editor-block-list__block h4 {
line-height: 1.5;
}
.editor-styles-wrapper .block-editor-block-list__block h5 {
line-height: 1.6;
}
.editor-styles-wrapper .block-editor-block-list__block h6 {
line-height: 1.7;
}
.edit-post-visual-editor p,
.block-editor-block-list__block p,
.editor-default-block-appender textarea.editor-default-block-appender__content {
font-size: 15px;
font-size: 1rem;
}
.editor-post-title__block .editor-post-title__input {
font-size: 30px;
font-size: 2rem;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
font-weight: normal;
}
@media (min-width: 600px) {
.edit-post-visual-editor .block-editor-block-list__block {
padding-left: 0;
padding-right: 0;
}
}
.edit-post-visual-editor .block-editor-block-list__block .editor-block-list__block-edit {
margin-left: 0;
margin-right: 0;
}
.edit-post-visual-editor .block-editor-block-list__block > .editor-block-mover {
left: -50px;
top: -5px;
}
@media (min-width: 600px) {
.edit-post-visual-editor .block-editor-block-list__block.wp-block-quote {
padding: 1.2em;
}
}
.block-editor-block-list__block[data-align=full] {
max-width: none;
}
@media (min-width: 600px) {
.block-editor-block-list__block[data-align=full] .editor-block-list__block-edit {
padding-left: 0;
padding-right: 0;
}
}
.block-editor-block-list__block[data-align=wide] {
max-width: 1400px;
}
.editor-default-block-appender__content {
margin-top: 32px;
}
.wp-block-latest-posts.is-grid {
list-style: none;
}
.blocks-gallery-grid {
margin: 0;
}
.wp-block-gallery {
margin: 0;
}
.wp-block-gallery.is-cropped .blocks-gallery-item img {
height: 100%;
}
.edit-post-visual-editor .blocks-gallery-grid {
margin: 0;
}
.wp-block-latest-posts {
margin-left: 0;
}
.wp-block-latest-posts li {
list-style: none;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: inherit;
}
.mce-widget i {
font-style: normal;
}
#elementor-editor-button {
background: #0073aa;
border-color: #0073aa;
color: #fff;
font-size: 14px;
height: 46px;
line-height: 44px;
padding: 0 36px;
display: inline-block;
border-width: 1px;
border-style: solid;
-webkit-appearance: none;
border-radius: 3px;
white-space: nowrap;
box-sizing: border-box;
box-shadow: 0 2px 0 #006799;
}
#elementor-editor-button:hover, #elementor-editor-button:focus {
background: #007db9;
border-color: #00699b;
color: #fff;
}
#elementor-editor-button:focus {
box-shadow: 0 0 0 1px #fff, 0 0 0 3px #0073aa;
}
#elementor-editor-button:active {
background: #006291;
border-color: #006291;
color: #fff;
}
#elementor-editor-button.active, #elementor-editor-button.active:focus, #elementor-editor-button.active:hover {
background: #0073aa;
color: #fff;
border-color: #003f5e;
box-shadow: inset 0 2px 5px -3px black;
}
#elementor-editor-button i {
font-style: normal;
color: white;
}
.editor-media-placeholder button,
.fl-builder-layout-launch-view button {
margin: 2px;
}
.fl-builder-layout-launch-view .is-primary.is-primary {
color: white;
}
.ast-separate-container #wpwrap .edit-post-visual-editor {
background-color: #f5f5f5;
}
/**
* Woocommerce Gutenberg Blocks Product Grid CSS Compatibility.
*/
.wc-block-grid .wc-block-grid__products .wc-block-grid__product {
text-align: left;
margin-bottom: 2.5em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product.product-category > a {
display: inline-block;
position: relative;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product a img {
width: 100%;
height: auto;
display: block;
margin: 0 0 .8em 0;
box-shadow: none;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-title {
margin-bottom: .5em;
padding: 0;
font-size: 1em;
line-height: 1.2;
font-weight: inherit;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .star-rating {
margin: 0 auto .5em 0;
backface-visibility: hidden;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-product__link {
position: relative;
display: block;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-product__link:hover .ast-shop-product-out-of-stock {
background-color: white;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product.product-category > a:hover .woocommerce-loop-category__title {
background-color: white;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-category__title {
bottom: 1.8em;
font-size: 0.9em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-category__title .count {
font-size: .7em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .price {
line-height: 1.3;
margin-bottom: 0;
font-weight: 700;
margin-bottom: .5em;
font-size: .9em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .price del {
display: initial;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wp-block-button__link {
margin-top: .5em;
margin-bottom: .5em;
white-space: normal;
line-height: 1.3;
font-size: 100%;
font-weight: 700;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wp-block-button__link.added {
margin-bottom: 0;
transition: margin 0s;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-category__title {
text-transform: uppercase;
font-weight: bold;
line-height: 1.5;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-category__title .count {
display: block;
background: none;
opacity: .5;
font-size: .75em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-onsale {
min-width: 3em;
min-height: 3em;
line-height: 3em;
padding: 0;
font-size: 1em;
font-weight: normal;
text-transform: capitalize;
position: absolute;
text-align: center;
border-radius: 100%;
z-index: 9;
top: 0;
right: 15px;
left: auto;
margin: -0.5em -0.5em 0 0;
}
.edit-post-visual-editor__post-title-wrapper {
position: relative;
max-width: var(--wp--custom--ast-content-width-size);
margin-left: auto !important;
margin-right: auto !important;
margin-bottom: 1.5em;
}
.edit-post-visual-editor__post-title-wrapper.invisible {
opacity: 0.5;
}
.edit-post-visual-editor__post-title-wrapper .title-visibility {
cursor: pointer;
font-size: 18px;
width: 36px;
height: 100%;
text-align: center;
color: var(--wp-admin-theme-color);
vertical-align: middle;
position: absolute;
left: -37px;
bottom: 0;
opacity: 0;
margin: 0 !important;
padding: 0 !important;
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
transition: all 0.2s;
}
.edit-post-visual-editor__post-title-wrapper .title-visibility:before {
width: 100%;
height: 100%;
display: inline-flex;
align-items: center;
justify-content: center;
}
.edit-post-visual-editor__post-title-wrapper .title-visibility:after {
content: attr(data-tooltip);
white-space: nowrap;
border-radius: 2px;
pointer-events: none;
color: #fff;
background: #1e1e1e;
opacity: 0;
visibility: hidden;
width: max-content;
line-height: 26px;
margin-left: -1px;
display: flex;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
align-items: flex-start;
padding: 0 6px;
font-size: 12px;
transition: all 0.2s;
}
.edit-post-visual-editor__post-title-wrapper h1.editor-post-title__input {
padding: 10px 6px;
transition: all 0.2s;
}
.edit-post-visual-editor__post-title-wrapper h1.editor-post-title__input.is-selected {
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
}
.edit-post-visual-editor__post-title-wrapper h1.editor-post-title__input.is-selected + .title-visibility {
opacity: 1;
color: var(--wp-admin-theme-color);
}
.edit-post-visual-editor__post-title-wrapper .ast-show-visibility-icon {
opacity: 1;
color: var(--wp-admin-theme-color);
}
.edit-post-visual-editor__post-title-wrapper .ast-show-editor-title-outline {
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
}
.ast-page-builder-template .edit-post-visual-editor__post-title-wrapper, .ast-stacked-title-visibility .edit-post-visual-editor__post-title-wrapper {
max-width: none;
padding: 0 20px;
}
.ast-page-builder-template .edit-post-visual-editor__post-title-wrapper .title-visibility, .ast-stacked-title-visibility .edit-post-visual-editor__post-title-wrapper .title-visibility {
left: unset;
top: -41px;
height: 40px;
}
/**
* Gutenberg editor improving UI/UX.
*/
.edit-post-visual-editor ul.block-editor-block-list__block,
.edit-post-visual-editor ol.block-editor-block-list__block {
margin-left: 20px;
}
.block-editor-block-list__block.wp-block.wp-social-link {
font-size: inherit;
}
.edit-post-visual-editor .block-editor-block-list__block.wp-social-link {
padding: 0;
}
.wp-block ol, .wp-block ul {
margin-left: 20px;
margin-right: 20px;
}
.edit-post-visual-editor .wp-block.wp-block-shortcode {
padding: 20px;
}
.wp-block-table td, .wp-block-table th {
padding: 0.5em;
border: 1px solid;
word-break: normal;
}
.edit-post-visual-editor pre.wp-block, .edit-post-visual-editor .wp-block.wp-block-query-title {
padding-left: 20px;
}
.block-editor-block-list__layout .block-editor-block-list__block.wp-block-button:not(:first-child) {
padding-left: 0;
padding-right: 0;
}
.block-editor-block-list__empty-block-inserter .block-editor-inserter__toggle.components-button.has-icon {
margin: 6px -2px 0 0;
border-radius: 0;
}
.components-dropdown__content .components-popover__content {
min-width: 290px;
}
.components-color-palette__custom-color-dropdown-content .components-popover__content {
min-width: auto;
}
.wp-block-buttons > .wp-block.wp-block-button {
padding-right: 0;
}
.wp-block .wp-block-categories__list {
padding-left: 0;
}
.wp-block-latest-comments .wp-block-latest-comments {
margin-left: 0;
}
.wp-block-quote.is-style-large cite {
text-align: left;
}
.editor-styles-wrapper p {
line-height: 1.85714285714286;
}
.wp-block-paragraph.has-background {
padding: 1.25em 2.375em;
}
.ast-theme-block-color-name {
mix-blend-mode: difference;
}
.components-color-palette__custom-color {
text-align: left;
padding-left: 5px;
}
h1.wp-block.has-background,
h2.wp-block.has-background,
h3.wp-block.has-background,
h4.wp-block.has-background,
h5.wp-block.has-background,
h6.wp-block.has-background {
padding: 1.25em 2.375em;
}
/**
* 6.3 Compatibility fixes in block editor.
*/
span.title-visibility svg {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 16px;
height: 40px;
fill: var(--wp-admin-theme-color);
}
#astra_settings_meta_box .components-button.is-primary:hover:not(:disabled),
.ast-meta-settings-content .components-button.is-primary:hover:not(:disabled) {
background: var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #2145e6)) !important;
color: var(--wp-components-color-accent-inverted, #fff) !important;
}

View File

@@ -0,0 +1,198 @@
/**
* Customizer Header-n-Footer section edit highligheting CSS.
*
* With new design improvements.
*/
.ast-primary-header-bar, .ast-above-header-bar, .ast-below-header-bar, .site-footer-focus-item, .customizer-item-block-preview {
outline: 1px solid transparent;
position: relative;
transition: outline 0.15s ease;
outline-offset: -1px;
}
.site-header-focus-item .customize-partial-edit-shortcut, .site-footer-focus-item .customize-partial-edit-shortcut, .customizer-item-block-preview .customize-partial-edit-shortcut{
opacity: 0;
transition: all 0.2s;
top: 5px;
}
.ast-builder-grid-row-container > .customize-partial-edit-shortcut.row-editor-shortcut, .customize-partial-edit-shortcut.row-editor-shortcut {
right: 26px;
}
/**
* Customizer edit icon custom positioning.
*/
.ast-builder-layout-element.site-header-focus-item .customize-partial-edit-shortcut button, .site-footer-focus-item .customize-partial-edit-shortcut button {
right: 0;
top: 5px;
border-radius: 2px;
}
body.customize-partial-edit-shortcuts-shown .customize-partial-edit-shortcut button {
width: 26px;
height: 26px;
min-width: 26px;
min-height: 26px;
border-width: 1px;
border-radius: 2px;
box-shadow: none;
text-shadow: none;
}
.site-footer-focus-item .customize-partial-edit-shortcut button {
top: 0;
}
.ast-below-header .ast-header-button-2 .customize-partial-edit-shortcut-button, .ast-below-header .ast-header-button-1 .customize-partial-edit-shortcut-button {
top: -10px;
}
.ast-builder-layout-element.site-header-focus-item[data-section="title_tagline"] .customize-partial-edit-shortcut {
top: 25px;
}
.site-header-focus-item[data-section="section-header-mobile-trigger"] .customize-partial-edit-shortcut {
top: -10px;
right: 0px;
}
.ast-primary-header-bar:hover, .ast-above-header-bar:hover, .ast-below-header-bar:hover,
.site-primary-footer-wrap.site-footer-focus-item:hover, .site-above-footer-wrap.site-footer-focus-item:hover, .site-below-footer-wrap.site-footer-focus-item:hover,.customizer-item-block-preview:hover {
outline: 1px solid #007cba;
}
.site-footer-focus-item:hover > * > .customize-partial-edit-shortcut,.site-footer-focus-item:hover > div.customize-partial-edit-shortcut, .ast-primary-header-bar:hover .row-editor-shortcut, .customizer-item-block-preview:hover .row-editor-shortcut, .ast-above-header-bar:hover .row-editor-shortcut, .ast-below-header-bar:hover .row-editor-shortcut, .site-header-focus-item:hover > * > .customize-partial-edit-shortcut, .site-header-focus-item:hover > .customize-partial-edit-shortcut, .customizer-item-block-preview:hover > .customize-partial-edit-shortcut {
opacity: 1;
}
.customize-partial-edit-shortcut-astra-settings-disable-primary-nav, .customize-partial-edit-shortcut-custom_logo {
display: none;
}
.customize-partial-edit-shortcut.row-editor-shortcut > button {
box-shadow: unset;
border: unset;
top: -3px;
right: -24px;
border-radius: 0 0 0 2px;
}
.customize-partial-edit-shortcut > button {
width: 26px;
height: 26px;
min-width: 26px;
min-height: 26px;
border: 1px solid #fff;
box-shadow: none;
text-shadow: none;
}
.elementor-page .customize-partial-edit-shortcut button {
width: 26px !important;
height: 26px !important;
min-width: 26px !important;
min-height: 26px !important;
border-radius: 2px !important;
border: 1px solid #fff !important;
box-shadow: none !important;
text-shadow: none !important;
padding: 3px !important;
}
.customize-partial-edit-shortcut > button svg {
min-width: 16px;
min-height: 16px;
width: 16px;
height: 16px;
}
/**
* Footer widget edit icon compatible CSS.
*/
.footer-widget-area .widget {
position: relative;
}
.footer-widget-area .widget:hover > .customize-partial-edit-shortcut {
opacity: 1;
}
/**
* Customizer Edit pencil - Set Position
*/
.customize-partial-edit-shortcut-blogname button.customize-partial-edit-shortcut-button, .customize-partial-edit-shortcut-blogdescription button.customize-partial-edit-shortcut-button, .customize-partial-edit-shortcut-astra-settings-display-site-title-responsive button.customize-partial-edit-shortcut-button, .customize-partial-edit-shortcut-astra-settings-display-site-tagline-responsive button.customize-partial-edit-shortcut-button, .customize-partial-edit-shortcut-custom_logo button.customize-partial-edit-shortcut-button, .customize-partial-edit-shortcut-astra-settings-disable-primary-nav button.customize-partial-edit-shortcut-button, .ast-related-posts-title .customize-partial-edit-shortcut-button {
display: none;
}
.ast-site-title-wrap:hover .customize-partial-edit-shortcut-blogname button.customize-partial-edit-shortcut-button, .ast-site-title-wrap:hover .customize-partial-edit-shortcut-blogdescription button.customize-partial-edit-shortcut-button, .site-logo-img:hover .customize-partial-edit-shortcut-custom_logo button.customize-partial-edit-shortcut-button, .main-navigation:hover .customize-partial-edit-shortcut-astra-settings-disable-primary-nav button.customize-partial-edit-shortcut-button, .ast-related-posts-title:hover .customize-partial-edit-shortcut-button {
display: inline-block;
}
/* Sticky Header CSS */
.ast-primary-sticky-header-active .customize-partial-edit-shortcut-astra-settings-header-main-stick .customize-partial-edit-shortcut-button {
right: 100px;
}
.ast-primary-sticky-header-active.ast-full-width-header .customize-partial-edit-shortcut-astra-settings-header-main-stick .customize-partial-edit-shortcut-button {
right: 5px;
}
/* Primary Header common CSS */
.customize-partial-edit-shortcut-astra-settings-disable-primary-nav .customize-partial-edit-shortcut-button {
top: 15px;
}
/* Above Header common CSS */
.ast-above-header .customize-partial-edit-shortcut {
top: 0.3em;
}
.customize-partial-edit-shortcut-astra-settings-above-header-layout .customize-partial-edit-shortcut-button,
.customize-partial-edit-shortcut-astra-settings-below-header-layout .customize-partial-edit-shortcut-button {
right: -60px;
}
.customize-partial-edit-shortcut-astra-settings-header-desktop-items,
.customize-partial-edit-shortcut-astra-settings-header-mobile-items,
.customize-partial-edit-shortcut-astra-settings-header-mobile-popup-items {
display: none;
}
/* Mobile popup content - Edit shortcuts compatibility */
.ast-mobile-popup-content .ast-builder-layout-element, .ast-mobile-header-wrap .ast-builder-layout-element, .ast-desktop-popup-content .ast-builder-layout-element, .ast-desktop-header-wrap .ast-builder-layout-element {
position: relative;
}
/** EDD & Woo cart Pencil icon */
.ast-builder-layout-element.site-header-focus-item.ast-header-edd-cart .customize-partial-edit-shortcut button,
.ast-builder-layout-element.site-header-focus-item.ast-header-woo-cart .customize-partial-edit-shortcut button {
right: -25px;
}
/*Hiding footer builder pencil icon as we converted section into builder layout, so no longer this needed.*/
.customize-partial-edit-shortcut-astra-settings-footer-desktop-items > button.customize-partial-edit-shortcut-button {
display: none;
}
.ast-post-banner-highlight:hover {
outline: 1px solid #007cba;
z-index: 9;
}
.ast-post-banner-highlight .banner-editor-shortcut {
top: -2px;
right: 30px;
}
.ast-post-banner-highlight .banner-editor-shortcut > button {
box-shadow: unset;
border: unset;
border-radius: 0 0 2px 0;
}
.ast-archive-entry-banner .customize-partial-edit-shortcut button, .ast-single-entry-banner .customize-partial-edit-shortcut button {
font-size: 20px;
line-height: 1em;
}
/* Hide Scroll to Top button for non Astra theme customizer previews */
body:not(.astra-theme) #ast-scroll-top {
display: none;
}

View File

@@ -0,0 +1,198 @@
/**
* Customizer Header-n-Footer section edit highligheting CSS.
*
* With new design improvements.
*/
.ast-primary-header-bar, .ast-above-header-bar, .ast-below-header-bar, .site-footer-focus-item, .customizer-item-block-preview {
outline: 1px solid transparent;
position: relative;
transition: outline 0.15s ease;
outline-offset: -1px;
}
.site-header-focus-item .customize-partial-edit-shortcut, .site-footer-focus-item .customize-partial-edit-shortcut, .customizer-item-block-preview .customize-partial-edit-shortcut{
opacity: 0;
transition: all 0.2s;
top: 5px;
}
.ast-builder-grid-row-container > .customize-partial-edit-shortcut.row-editor-shortcut, .customize-partial-edit-shortcut.row-editor-shortcut {
left: 26px;
}
/**
* Customizer edit icon custom positioning.
*/
.ast-builder-layout-element.site-header-focus-item .customize-partial-edit-shortcut button, .site-footer-focus-item .customize-partial-edit-shortcut button {
left: 0;
top: 5px;
border-radius: 2px;
}
body.customize-partial-edit-shortcuts-shown .customize-partial-edit-shortcut button {
width: 26px;
height: 26px;
min-width: 26px;
min-height: 26px;
border-width: 1px;
border-radius: 2px;
box-shadow: none;
text-shadow: none;
}
.site-footer-focus-item .customize-partial-edit-shortcut button {
top: 0;
}
.ast-below-header .ast-header-button-2 .customize-partial-edit-shortcut-button, .ast-below-header .ast-header-button-1 .customize-partial-edit-shortcut-button {
top: -10px;
}
.ast-builder-layout-element.site-header-focus-item[data-section="title_tagline"] .customize-partial-edit-shortcut {
top: 25px;
}
.site-header-focus-item[data-section="section-header-mobile-trigger"] .customize-partial-edit-shortcut {
top: -10px;
left: 0px;
}
.ast-primary-header-bar:hover, .ast-above-header-bar:hover, .ast-below-header-bar:hover,
.site-primary-footer-wrap.site-footer-focus-item:hover, .site-above-footer-wrap.site-footer-focus-item:hover, .site-below-footer-wrap.site-footer-focus-item:hover,.customizer-item-block-preview:hover {
outline: 1px solid #007cba;
}
.site-footer-focus-item:hover > * > .customize-partial-edit-shortcut,.site-footer-focus-item:hover > div.customize-partial-edit-shortcut, .ast-primary-header-bar:hover .row-editor-shortcut, .customizer-item-block-preview:hover .row-editor-shortcut, .ast-above-header-bar:hover .row-editor-shortcut, .ast-below-header-bar:hover .row-editor-shortcut, .site-header-focus-item:hover > * > .customize-partial-edit-shortcut, .site-header-focus-item:hover > .customize-partial-edit-shortcut, .customizer-item-block-preview:hover > .customize-partial-edit-shortcut {
opacity: 1;
}
.customize-partial-edit-shortcut-astra-settings-disable-primary-nav, .customize-partial-edit-shortcut-custom_logo {
display: none;
}
.customize-partial-edit-shortcut.row-editor-shortcut > button {
box-shadow: unset;
border: unset;
top: -3px;
left: -24px;
border-radius: 0 0 2px 0;
}
.customize-partial-edit-shortcut > button {
width: 26px;
height: 26px;
min-width: 26px;
min-height: 26px;
border: 1px solid #fff;
box-shadow: none;
text-shadow: none;
}
.elementor-page .customize-partial-edit-shortcut button {
width: 26px !important;
height: 26px !important;
min-width: 26px !important;
min-height: 26px !important;
border-radius: 2px !important;
border: 1px solid #fff !important;
box-shadow: none !important;
text-shadow: none !important;
padding: 3px !important;
}
.customize-partial-edit-shortcut > button svg {
min-width: 16px;
min-height: 16px;
width: 16px;
height: 16px;
}
/**
* Footer widget edit icon compatible CSS.
*/
.footer-widget-area .widget {
position: relative;
}
.footer-widget-area .widget:hover > .customize-partial-edit-shortcut {
opacity: 1;
}
/**
* Customizer Edit pencil - Set Position
*/
.customize-partial-edit-shortcut-blogname button.customize-partial-edit-shortcut-button, .customize-partial-edit-shortcut-blogdescription button.customize-partial-edit-shortcut-button, .customize-partial-edit-shortcut-astra-settings-display-site-title-responsive button.customize-partial-edit-shortcut-button, .customize-partial-edit-shortcut-astra-settings-display-site-tagline-responsive button.customize-partial-edit-shortcut-button, .customize-partial-edit-shortcut-custom_logo button.customize-partial-edit-shortcut-button, .customize-partial-edit-shortcut-astra-settings-disable-primary-nav button.customize-partial-edit-shortcut-button, .ast-related-posts-title .customize-partial-edit-shortcut-button {
display: none;
}
.ast-site-title-wrap:hover .customize-partial-edit-shortcut-blogname button.customize-partial-edit-shortcut-button, .ast-site-title-wrap:hover .customize-partial-edit-shortcut-blogdescription button.customize-partial-edit-shortcut-button, .site-logo-img:hover .customize-partial-edit-shortcut-custom_logo button.customize-partial-edit-shortcut-button, .main-navigation:hover .customize-partial-edit-shortcut-astra-settings-disable-primary-nav button.customize-partial-edit-shortcut-button, .ast-related-posts-title:hover .customize-partial-edit-shortcut-button {
display: inline-block;
}
/* Sticky Header CSS */
.ast-primary-sticky-header-active .customize-partial-edit-shortcut-astra-settings-header-main-stick .customize-partial-edit-shortcut-button {
left: 100px;
}
.ast-primary-sticky-header-active.ast-full-width-header .customize-partial-edit-shortcut-astra-settings-header-main-stick .customize-partial-edit-shortcut-button {
left: 5px;
}
/* Primary Header common CSS */
.customize-partial-edit-shortcut-astra-settings-disable-primary-nav .customize-partial-edit-shortcut-button {
top: 15px;
}
/* Above Header common CSS */
.ast-above-header .customize-partial-edit-shortcut {
top: 0.3em;
}
.customize-partial-edit-shortcut-astra-settings-above-header-layout .customize-partial-edit-shortcut-button,
.customize-partial-edit-shortcut-astra-settings-below-header-layout .customize-partial-edit-shortcut-button {
left: -60px;
}
.customize-partial-edit-shortcut-astra-settings-header-desktop-items,
.customize-partial-edit-shortcut-astra-settings-header-mobile-items,
.customize-partial-edit-shortcut-astra-settings-header-mobile-popup-items {
display: none;
}
/* Mobile popup content - Edit shortcuts compatibility */
.ast-mobile-popup-content .ast-builder-layout-element, .ast-mobile-header-wrap .ast-builder-layout-element, .ast-desktop-popup-content .ast-builder-layout-element, .ast-desktop-header-wrap .ast-builder-layout-element {
position: relative;
}
/** EDD & Woo cart Pencil icon */
.ast-builder-layout-element.site-header-focus-item.ast-header-edd-cart .customize-partial-edit-shortcut button,
.ast-builder-layout-element.site-header-focus-item.ast-header-woo-cart .customize-partial-edit-shortcut button {
left: -25px;
}
/*Hiding footer builder pencil icon as we converted section into builder layout, so no longer this needed.*/
.customize-partial-edit-shortcut-astra-settings-footer-desktop-items > button.customize-partial-edit-shortcut-button {
display: none;
}
.ast-post-banner-highlight:hover {
outline: 1px solid #007cba;
z-index: 9;
}
.ast-post-banner-highlight .banner-editor-shortcut {
top: -2px;
left: 30px;
}
.ast-post-banner-highlight .banner-editor-shortcut > button {
box-shadow: unset;
border: unset;
border-radius: 0 0 0 2px;
}
.ast-archive-entry-banner .customize-partial-edit-shortcut button, .ast-single-entry-banner .customize-partial-edit-shortcut button {
font-size: 20px;
line-height: 1em;
}
/* Hide Scroll to Top button for non Astra theme customizer previews */
body:not(.astra-theme) #ast-scroll-top {
display: none;
}

View File

@@ -0,0 +1,18 @@
/* Intentionally hiding the other NPS popups when enabled at the same time with Astra. */
body:has([data-id="nps-survey-astra"]) .nps-survey-root:not([data-id="nps-survey-astra"]) {
display: none;
}
/* Bring the Astra NPS popup in front on the theme builder pages. */
.ast-theme-builder [data-id="nps-survey-astra"] {
position: relative;
z-index: 9999999;
}
/* Prevent stacking of the Astra NPS popup, make it placed correctly */
[data-id="nps-survey-astra"] .nps-survey-wrapper > div {
right: auto !important;
left: 8px !important;
bottom: 8px !important;
max-width: min(30rem, calc(100vw - 16px));
}

View File

@@ -0,0 +1,18 @@
/* Intentionally hiding the other NPS popups when enabled at the same time with Astra. */
body:has([data-id="nps-survey-astra"]) .nps-survey-root:not([data-id="nps-survey-astra"]) {
display: none;
}
/* Bring the Astra NPS popup in front on the theme builder pages. */
.ast-theme-builder [data-id="nps-survey-astra"] {
position: relative;
z-index: 9999999;
}
/* Prevent stacking of the Astra NPS popup, make it placed correctly */
[data-id="nps-survey-astra"] .nps-survey-wrapper > div {
left: auto !important;
right: 8px !important;
bottom: 8px !important;
max-width: min(30rem, calc(100vw - 16px));
}

View File

@@ -0,0 +1,751 @@
html {
font-size: 93.75%;
}
/* Variables */
/*---------- Media Query min-width Structure ----------*/
/*---------- Media Query max-width Structure ----------*/
/*---------- Break-point min-width Structure ----------*/
/*---------- Break-point max-width Structure ----------*/
/*---------- Font Size ----------*/
/*---------- Line Height ----------*/
/*---------- Site Basic Structure ----------*/
/*---------- z-index Structure ----------*/
/*
* Button mixin- creates a button effect with correct
* highlights/shadows, based on a base color.
*/
.edit-post-visual-editor {
/* must have higher specificity than alternative color schemes inline styles */
}
.edit-post-visual-editor ::selection {
color: #fff;
background: royalblue;
}
.edit-post-visual-editor body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.edit-post-visual-editor body:not(.logged-in) {
position: relative;
}
.edit-post-visual-editor #page {
position: relative;
}
.edit-post-visual-editor a,
.edit-post-visual-editor a:focus {
text-decoration: none;
}
.edit-post-visual-editor a,
.edit-post-visual-editor .site-header a *,
.edit-post-visual-editor .site-footer a *,
.edit-post-visual-editor .secondary a * {
transition: all 0.2s linear;
}
.edit-post-visual-editor .capitalize {
text-transform: uppercase;
}
.edit-post-visual-editor img {
vertical-align: middle;
}
.edit-post-visual-editor .entry-content h1,
.edit-post-visual-editor .entry-content h2,
.edit-post-visual-editor .entry-content h3,
.edit-post-visual-editor .entry-content h4,
.edit-post-visual-editor .entry-content h5,
.edit-post-visual-editor .entry-content h6 {
margin-bottom: 20px;
}
.edit-post-visual-editor p {
margin-bottom: 1.75em;
}
.edit-post-visual-editor blockquote {
margin: 1.5em 3em 1.5em 1em;
font-size: 1.1em;
line-height: inherit;
position: relative;
}
.edit-post-visual-editor .ast-button,
.edit-post-visual-editor .button,
.edit-post-visual-editor input[type="button"],
.edit-post-visual-editor input[type="submit"] {
border-radius: 0;
padding: 18px 30px;
border: 0;
box-shadow: none;
text-shadow: none;
}
.edit-post-visual-editor .ast-button:hover,
.edit-post-visual-editor .button:hover,
.edit-post-visual-editor input[type="button"]:hover,
.edit-post-visual-editor input[type="submit"]:hover {
box-shadow: none;
}
.edit-post-visual-editor .ast-button:active, .edit-post-visual-editor .ast-button:focus,
.edit-post-visual-editor .button:active,
.edit-post-visual-editor .button:focus,
.edit-post-visual-editor input[type="button"]:active,
.edit-post-visual-editor input[type="button"]:focus,
.edit-post-visual-editor input[type="submit"]:active,
.edit-post-visual-editor input[type="submit"]:focus {
box-shadow: none;
}
.edit-post-visual-editor .site-title {
font-weight: normal;
}
.edit-post-visual-editor .site-title,
.edit-post-visual-editor .site-description {
margin-bottom: 0;
}
.edit-post-visual-editor .site-title a,
.edit-post-visual-editor .site-title:hover a,
.edit-post-visual-editor .site-title:focus a,
.edit-post-visual-editor .site-description a,
.edit-post-visual-editor .site-description:hover a,
.edit-post-visual-editor .site-description:focus a {
transition: all 0.2s linear;
}
.edit-post-visual-editor .site-title a,
.edit-post-visual-editor .site-title a:focus,
.edit-post-visual-editor .site-title a:hover,
.edit-post-visual-editor .site-title a:visited {
color: #222;
}
.edit-post-visual-editor .site-description a,
.edit-post-visual-editor .site-description a:focus,
.edit-post-visual-editor .site-description a:hover,
.edit-post-visual-editor .site-description a:visited {
color: #999;
}
.edit-post-visual-editor .search-form .search-field {
outline: none;
}
.edit-post-visual-editor .ast-search-menu-icon {
position: relative;
z-index: 3;
}
.edit-post-visual-editor .site .skip-link {
background-color: #f1f1f1;
box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.2);
color: #21759b;
display: block;
font-family: Montserrat, "Helvetica Neue", sans-serif;
font-size: 14px;
font-weight: 700;
right: -9999em;
outline: none;
padding: 15px 23px 14px;
text-decoration: none;
text-transform: none;
top: -9999em;
}
.edit-post-visual-editor .site .skip-link:focus {
clip: auto;
height: auto;
right: 6px;
top: 7px;
width: auto;
z-index: 100000;
outline: thin dotted;
}
.logged-in .edit-post-visual-editor .site .skip-link {
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.2);
font-family: "Open Sans", sans-serif;
}
.edit-post-visual-editor .editor-styles-wrapper > .is-root-container {
padding-top: 20px;
}
/**
* Responsive view management CSS.
*/
.responsive-enabled #editor .edit-post-visual-editor {
background-color: #2f2f2f;
}
.wp-embed-responsive.editor-styles-wrapper {
padding-right: 10px;
padding-left: 10px;
}
.wp-embed-responsive.editor-styles-wrapper .wp-block-pullquote {
border: none;
}
.ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block {
transition: all 0.2s;
}
.ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted, .ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block:not(.editor-post-title__input):hover {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
}
.ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted:after {
box-shadow: none;
}
/**
* Editor core layout supportive CSS.
*/
.edit-post-visual-editor__post-title-wrapper {
position: relative;
max-width: calc(var(--wp--custom--ast-content-width-size) + 10px) !important;
margin-right: auto !important;
margin-left: auto !important;
margin-bottom: 1.5em;
}
.edit-post-visual-editor__post-title-wrapper .title-visibility {
cursor: pointer;
font-size: 18px;
width: 36px;
height: 100%;
text-align: center;
color: var(--wp-admin-theme-color);
vertical-align: middle;
position: absolute;
right: -37px;
bottom: 0;
opacity: 0;
margin: 0 !important;
padding: 0 !important;
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
transition: all 0.2s;
}
.edit-post-visual-editor__post-title-wrapper .title-visibility:before {
width: 100%;
height: 100%;
display: inline-flex;
align-items: center;
justify-content: center;
}
.edit-post-visual-editor__post-title-wrapper .title-visibility:after {
content: attr(data-tooltip);
white-space: nowrap;
border-radius: 2px;
pointer-events: none;
color: #fff;
background: #1e1e1e;
opacity: 0;
visibility: hidden;
width: max-content;
line-height: 26px;
margin-right: -1px;
display: flex;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
align-items: flex-start;
padding: 0 6px;
font-size: 12px;
transition: all 0.2s;
}
.edit-post-visual-editor__post-title-wrapper > .wp-block-post-title {
max-width: 100% !important;
}
.edit-post-visual-editor__post-title-wrapper h1.editor-post-title__input {
padding: 10px 6px;
transition: all 0.2s;
}
.edit-post-visual-editor__post-title-wrapper h1.editor-post-title__input.is-selected {
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
}
.edit-post-visual-editor__post-title-wrapper h1.editor-post-title__input.is-selected + .title-visibility {
opacity: 1;
color: var(--wp-admin-theme-color);
}
.edit-post-visual-editor__post-title-wrapper .ast-show-visibility-icon {
opacity: 1;
color: var(--wp-admin-theme-color);
}
.edit-post-visual-editor__post-title-wrapper .ast-show-editor-title-outline {
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
}
.edit-post-visual-editor__post-title-wrapper.invisible {
opacity: 0.5;
}
.ast-page-builder-template .edit-post-visual-editor__post-title-wrapper, .ast-stacked-title-visibility .edit-post-visual-editor__post-title-wrapper {
max-width: none;
}
.ast-page-builder-template .edit-post-visual-editor__post-title-wrapper .title-visibility, .ast-stacked-title-visibility .edit-post-visual-editor__post-title-wrapper .title-visibility {
right: unset;
top: -41px;
height: 40px;
}
/**
* For widget screen.
*/
html .edit-widgets-main-block-list :where(.wp-block) {
margin-bottom: 28px;
}
/**
* ast-separate-container layout compatibility.
*/
.ast-separate-container .edit-post-visual-editor__content-area, .ast-separate-container .edit-post-visual-editor {
padding: 20px !important;
}
/**
* Color control's name adjustment.
*/
.ast-theme-block-color-name {
mix-blend-mode: difference;
}
/**
* Page builder triggers support.
*/
#elementor-editor-button {
background: #0073aa;
border-color: #0073aa;
color: #fff;
font-size: 14px;
height: 46px;
line-height: 44px;
padding: 0 36px;
display: inline-block;
border-width: 1px;
border-style: solid;
-webkit-appearance: none;
border-radius: 3px;
white-space: nowrap;
box-sizing: border-box;
box-shadow: 0 2px 0 #006799;
}
#elementor-editor-button:hover, #elementor-editor-button:focus {
background: #007db9;
border-color: #00699b;
color: #fff;
}
#elementor-editor-button:focus {
box-shadow: 0 0 0 1px #fff, 0 0 0 3px #0073aa;
}
#elementor-editor-button:active {
background: #006291;
border-color: #006291;
color: #fff;
}
#elementor-editor-button.active, #elementor-editor-button.active:focus, #elementor-editor-button.active:hover {
background: #0073aa;
color: #fff;
border-color: #003f5e;
box-shadow: inset 0 2px 5px -3px black;
}
#elementor-editor-button i {
font-style: normal;
color: white;
}
.editor-media-placeholder button,
.fl-builder-layout-launch-view button {
margin: 2px;
}
.fl-builder-layout-launch-view .is-primary.is-primary {
color: white;
}
/**
* Modern Gutenberg editor improved UI/UX.
*/
body .editor-styles-wrapper .edit-post-visual-editor__post-title-wrapper > * + *, body .editor-styles-wrapper .block-editor-block-list__layout.is-root-container > * + * {
margin-block-start: 0;
}
.wp-block-separator {
height: 0;
}
.wp-block-separator:not(.is-style-wide) {
margin-right: auto;
margin-left: auto;
}
.wp-block-separator:not(.is-style-wide):not(.is-style-dots) {
width: 100px;
}
.editor-styles-wrapper hr {
margin-bottom: 1.5em;
padding: 0;
}
.editor-styles-wrapper .wp-block-columns {
margin-bottom: 0;
}
.editor-styles-wrapper cite {
font-style: initial;
}
.editor-styles-wrapper .block-editor-block-variation-picker {
margin-right: auto;
margin-left: auto;
}
.editor-styles-wrapper .is-root-container > .wp-block-buttons,
.editor-styles-wrapper .is-root-container > .wp-block:has(.uagb-buttons__wrap) {
/* Spacing for WP Core and Spectra's buttons block */
margin-bottom: 1.5em;
}
.wp-block-cover:not([class*='background-color']) .wp-block-cover__inner-container, .wp-block-cover:not([class*='background-color']) .wp-block-cover-image-text, .wp-block-cover:not([class*='background-color']) .wp-block-cover-text, .wp-block-cover:not([class*='background-color']) .block-editor-block-list__block, .wp-block-cover-image:not([class*='background-color']) .wp-block-cover__inner-container, .wp-block-cover-image:not([class*='background-color']) .wp-block-cover-image-text,
.wp-block-cover-image:not([class*='background-color']) .wp-block-cover-text, .wp-block-cover-image:not([class*='background-color']) .block-editor-block-list__block {
color: var(--ast-global-color-5);
}
.wp-block-file__content-wrapper {
display: flex;
align-items: center;
flex-wrap: wrap;
justify-content: space-between;
}
pre.wp-block {
background: #ECEFF3;
overflow: auto;
max-width: 100%;
padding: 1.6em;
font-size: 1em;
line-height: 1.8;
}
pre.wp-block.wp-block-preformatted {
font-family: "Courier 10 Pitch", Courier, monospace;
}
pre.wp-block code {
font-size: 15px;
font-family: "Courier 10 Pitch", Courier, monospace;
}
.wp-block-freeform.block-library-rich-text__tinymce blockquote {
border-right: 5px solid rgba(0, 0, 0, 0.05);
padding: 0 1.2em 1.2em;
}
.editor-styles-wrapper blockquote {
padding: 20px 20px 20px;
margin: 1.5em;
border: none;
}
.editor-styles-wrapper blockquote.has-text-align-left,
.editor-styles-wrapper .has-text-align-left blockquote {
border-right: 5px solid rgba(0, 0, 0, 0.05);
}
.editor-styles-wrapper blockquote.has-text-align-right,
.editor-styles-wrapper .has-text-align-right blockquote {
border-left: 5px solid rgba(0, 0, 0, 0.05);
}
.wp-block-pullquote blockquote:before {
content: "\201D";
font-family: "Helvetica",sans-serif;
display: flex;
transform: rotate(-180deg);
font-size: 6rem;
font-style: normal;
line-height: 1;
font-weight: bold;
align-items: center;
justify-content: center;
}
.wp-block-pullquote.has-text-align-left blockquote:before {
justify-content: flex-end;
}
.wp-block-pullquote.has-text-align-right blockquote:before {
justify-content: flex-start;
}
.wp-block-media-text .wp-block-media-text__content {
padding: 0 8% 0 0;
}
.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content {
padding: 0 0 0 8%;
}
.wp-block-media-text.has-background .wp-block-media-text__content {
padding: 8%;
}
@media (max-width: 600px) {
.wp-block-media-text .wp-block-media-text__content {
padding: 8% 0;
}
}
.editor-styles-wrapper .wp-block-latest-posts > li > *:first-child,
.editor-styles-wrapper .wp-block-latest-posts:not(.is-grid) > li:first-child {
margin-top: 0;
}
.editor-styles-wrapper .wp-block-latest-posts > li > *,
.editor-styles-wrapper .wp-block-latest-posts:not(.is-grid) > li {
margin-top: 15px;
margin-bottom: 15px;
}
.editor-styles-wrapper .wp-block-latest-posts > li > *:last-child,
.editor-styles-wrapper .wp-block-latest-posts:not(.is-grid) > li:last-child {
margin-bottom: 0;
}
.editor-styles-wrapper .wp-block-latest-posts .wp-block-latest-posts__post-author, .editor-styles-wrapper .wp-block-latest-posts .wp-block-latest-posts__post-date {
font-size: 15px;
}
.editor-styles-wrapper .wp-block-latest-posts > li > a {
font-size: 28px;
}
.wp-block-gallery.has-nested-images figure.wp-block-image img {
width: 100%;
}
.wp-block-table td, .wp-block-table th {
padding: 0.5em;
border: 1px solid;
word-break: normal;
}
.wp-block-quote.is-style-large cite {
text-align: right;
}
.components-color-palette__custom-color {
text-align: right;
padding-right: 5px;
}
/**
* Woocommerce Gutenberg Blocks Product Grid CSS Compatibility.
*/
.wc-block-grid .wc-block-grid__products .wc-block-grid__product {
text-align: right;
margin-bottom: 2.5em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product.product-category > a {
display: inline-block;
position: relative;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product a img {
width: 100%;
height: auto;
display: block;
margin: 0 0 .8em 0;
box-shadow: none;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-title {
margin-bottom: .5em;
padding: 0;
font-size: 1em;
line-height: 1.2;
font-weight: inherit;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .star-rating {
margin: 0 0 .5em auto;
backface-visibility: hidden;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-product__link {
position: relative;
display: block;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-product__link:hover .ast-shop-product-out-of-stock {
background-color: white;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product.product-category > a:hover .woocommerce-loop-category__title {
background-color: white;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-category__title {
bottom: 1.8em;
font-size: 0.9em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-category__title .count {
font-size: .7em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .price {
line-height: 1.3;
font-weight: 700;
margin-bottom: .5em;
font-size: .9em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .price del {
display: initial;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wp-block-button__link {
margin-top: .5em;
margin-bottom: .5em;
white-space: normal;
line-height: 1.3;
font-size: 100%;
font-weight: 700;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wp-block-button__link.added {
margin-bottom: 0;
transition: margin 0s;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-category__title {
text-transform: uppercase;
font-weight: bold;
line-height: 1.5;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-category__title .count {
display: block;
background: none;
opacity: .5;
font-size: .75em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-onsale {
min-width: 3em;
min-height: 3em;
line-height: 3em;
padding: 0;
font-size: 1em;
font-weight: normal;
text-transform: capitalize;
position: absolute;
text-align: center;
border-radius: 100%;
z-index: 9;
top: 0;
left: 15px;
right: auto;
margin: -0.5em 0 0 -0.5em;
}
.wp-core-ui .components-angle-picker-control .components-input-control__container .components-input-control__input {
padding-right: 10px;
padding-left: 10px;
}
.editor-styles-wrapper .is-root-container .wp-block-code, .editor-styles-wrapper .is-root-container pre.wp-block {
margin-bottom: 1.6em;
}
.editor-styles-wrapper .is-root-container .wp-block-image, .editor-styles-wrapper .is-root-container .wp-block-gallery, .editor-styles-wrapper .is-root-container .wp-block-audio, .editor-styles-wrapper .is-root-container .wp-block-video, .editor-styles-wrapper .is-root-container .wp-block-table, .editor-styles-wrapper .is-root-container .wp-block-pullquote {
margin-bottom: 1em;
}
.editor-styles-wrapper .is-root-container .wp-block-quote {
margin-top: 1.5em;
margin-bottom: 1.5em;
}
.editor-styles-wrapper .is-root-container .wp-block-file {
margin-bottom: 1.5em;
}
.editor-styles-wrapper .is-root-container ol, .editor-styles-wrapper .is-root-container ul {
line-height: 1.85714285714286;
}
.editor-styles-wrapper .is-root-container .wp-block-separator {
margin-top: 20px;
margin-bottom: 20px;
}
body .editor-styles-wrapper > .block-editor-block-list__layout.is-root-container > .wp-block + .wp-block-separator {
margin-top: 20px;
}
body .editor-styles-wrapper > .block-editor-block-list__layout.is-root-container > .wp-block + .wp-block-list {
margin-top: 1em;
margin-bottom: 1em;
}
body .editor-styles-wrapper > .block-editor-block-list__layout.edit-post-visual-editor__post-title-wrapper {
padding-top: 0;
}
.wp-block-table table {
margin-bottom: 1.5em;
}
.wp-block-table figcaption {
font-size: 1rem;
}
.wp-block-button button {
border-radius: 2px;
}
/**
* 6.3 Compatibility fixes in block editor.
*/
span.title-visibility svg {
position: absolute;
top: 50%;
right: 50%;
transform: translate(50%, -50%);
width: 16px;
height: 40px;
fill: var(--wp-admin-theme-color);
}
#astra_settings_meta_box .components-button.is-primary:hover:not(:disabled),
.ast-meta-settings-content .components-button.is-primary:hover:not(:disabled) {
background: var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #2145e6)) !important;
color: var(--wp-components-color-accent-inverted, #fff) !important;
}

View File

@@ -0,0 +1,751 @@
html {
font-size: 93.75%;
}
/* Variables */
/*---------- Media Query min-width Structure ----------*/
/*---------- Media Query max-width Structure ----------*/
/*---------- Break-point min-width Structure ----------*/
/*---------- Break-point max-width Structure ----------*/
/*---------- Font Size ----------*/
/*---------- Line Height ----------*/
/*---------- Site Basic Structure ----------*/
/*---------- z-index Structure ----------*/
/*
* Button mixin- creates a button effect with correct
* highlights/shadows, based on a base color.
*/
.edit-post-visual-editor {
/* must have higher specificity than alternative color schemes inline styles */
}
.edit-post-visual-editor ::selection {
color: #fff;
background: royalblue;
}
.edit-post-visual-editor body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.edit-post-visual-editor body:not(.logged-in) {
position: relative;
}
.edit-post-visual-editor #page {
position: relative;
}
.edit-post-visual-editor a,
.edit-post-visual-editor a:focus {
text-decoration: none;
}
.edit-post-visual-editor a,
.edit-post-visual-editor .site-header a *,
.edit-post-visual-editor .site-footer a *,
.edit-post-visual-editor .secondary a * {
transition: all 0.2s linear;
}
.edit-post-visual-editor .capitalize {
text-transform: uppercase;
}
.edit-post-visual-editor img {
vertical-align: middle;
}
.edit-post-visual-editor .entry-content h1,
.edit-post-visual-editor .entry-content h2,
.edit-post-visual-editor .entry-content h3,
.edit-post-visual-editor .entry-content h4,
.edit-post-visual-editor .entry-content h5,
.edit-post-visual-editor .entry-content h6 {
margin-bottom: 20px;
}
.edit-post-visual-editor p {
margin-bottom: 1.75em;
}
.edit-post-visual-editor blockquote {
margin: 1.5em 1em 1.5em 3em;
font-size: 1.1em;
line-height: inherit;
position: relative;
}
.edit-post-visual-editor .ast-button,
.edit-post-visual-editor .button,
.edit-post-visual-editor input[type="button"],
.edit-post-visual-editor input[type="submit"] {
border-radius: 0;
padding: 18px 30px;
border: 0;
box-shadow: none;
text-shadow: none;
}
.edit-post-visual-editor .ast-button:hover,
.edit-post-visual-editor .button:hover,
.edit-post-visual-editor input[type="button"]:hover,
.edit-post-visual-editor input[type="submit"]:hover {
box-shadow: none;
}
.edit-post-visual-editor .ast-button:active, .edit-post-visual-editor .ast-button:focus,
.edit-post-visual-editor .button:active,
.edit-post-visual-editor .button:focus,
.edit-post-visual-editor input[type="button"]:active,
.edit-post-visual-editor input[type="button"]:focus,
.edit-post-visual-editor input[type="submit"]:active,
.edit-post-visual-editor input[type="submit"]:focus {
box-shadow: none;
}
.edit-post-visual-editor .site-title {
font-weight: normal;
}
.edit-post-visual-editor .site-title,
.edit-post-visual-editor .site-description {
margin-bottom: 0;
}
.edit-post-visual-editor .site-title a,
.edit-post-visual-editor .site-title:hover a,
.edit-post-visual-editor .site-title:focus a,
.edit-post-visual-editor .site-description a,
.edit-post-visual-editor .site-description:hover a,
.edit-post-visual-editor .site-description:focus a {
transition: all 0.2s linear;
}
.edit-post-visual-editor .site-title a,
.edit-post-visual-editor .site-title a:focus,
.edit-post-visual-editor .site-title a:hover,
.edit-post-visual-editor .site-title a:visited {
color: #222;
}
.edit-post-visual-editor .site-description a,
.edit-post-visual-editor .site-description a:focus,
.edit-post-visual-editor .site-description a:hover,
.edit-post-visual-editor .site-description a:visited {
color: #999;
}
.edit-post-visual-editor .search-form .search-field {
outline: none;
}
.edit-post-visual-editor .ast-search-menu-icon {
position: relative;
z-index: 3;
}
.edit-post-visual-editor .site .skip-link {
background-color: #f1f1f1;
box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.2);
color: #21759b;
display: block;
font-family: Montserrat, "Helvetica Neue", sans-serif;
font-size: 14px;
font-weight: 700;
left: -9999em;
outline: none;
padding: 15px 23px 14px;
text-decoration: none;
text-transform: none;
top: -9999em;
}
.edit-post-visual-editor .site .skip-link:focus {
clip: auto;
height: auto;
left: 6px;
top: 7px;
width: auto;
z-index: 100000;
outline: thin dotted;
}
.logged-in .edit-post-visual-editor .site .skip-link {
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.2);
font-family: "Open Sans", sans-serif;
}
.edit-post-visual-editor .editor-styles-wrapper > .is-root-container {
padding-top: 20px;
}
/**
* Responsive view management CSS.
*/
.responsive-enabled #editor .edit-post-visual-editor {
background-color: #2f2f2f;
}
.wp-embed-responsive.editor-styles-wrapper {
padding-left: 10px;
padding-right: 10px;
}
.wp-embed-responsive.editor-styles-wrapper .wp-block-pullquote {
border: none;
}
.ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block {
transition: all 0.2s;
}
.ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted, .ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block:not(.editor-post-title__input):hover {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
}
.ast-highlight-wpblock-onhover .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted:after {
box-shadow: none;
}
/**
* Editor core layout supportive CSS.
*/
.edit-post-visual-editor__post-title-wrapper {
position: relative;
max-width: calc(var(--wp--custom--ast-content-width-size) + 10px) !important;
margin-left: auto !important;
margin-right: auto !important;
margin-bottom: 1.5em;
}
.edit-post-visual-editor__post-title-wrapper .title-visibility {
cursor: pointer;
font-size: 18px;
width: 36px;
height: 100%;
text-align: center;
color: var(--wp-admin-theme-color);
vertical-align: middle;
position: absolute;
left: -37px;
bottom: 0;
opacity: 0;
margin: 0 !important;
padding: 0 !important;
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
transition: all 0.2s;
}
.edit-post-visual-editor__post-title-wrapper .title-visibility:before {
width: 100%;
height: 100%;
display: inline-flex;
align-items: center;
justify-content: center;
}
.edit-post-visual-editor__post-title-wrapper .title-visibility:after {
content: attr(data-tooltip);
white-space: nowrap;
border-radius: 2px;
pointer-events: none;
color: #fff;
background: #1e1e1e;
opacity: 0;
visibility: hidden;
width: max-content;
line-height: 26px;
margin-left: -1px;
display: flex;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
align-items: flex-start;
padding: 0 6px;
font-size: 12px;
transition: all 0.2s;
}
.edit-post-visual-editor__post-title-wrapper > .wp-block-post-title {
max-width: 100% !important;
}
.edit-post-visual-editor__post-title-wrapper h1.editor-post-title__input {
padding: 10px 6px;
transition: all 0.2s;
}
.edit-post-visual-editor__post-title-wrapper h1.editor-post-title__input.is-selected {
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
}
.edit-post-visual-editor__post-title-wrapper h1.editor-post-title__input.is-selected + .title-visibility {
opacity: 1;
color: var(--wp-admin-theme-color);
}
.edit-post-visual-editor__post-title-wrapper .ast-show-visibility-icon {
opacity: 1;
color: var(--wp-admin-theme-color);
}
.edit-post-visual-editor__post-title-wrapper .ast-show-editor-title-outline {
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
}
.edit-post-visual-editor__post-title-wrapper.invisible {
opacity: 0.5;
}
.ast-page-builder-template .edit-post-visual-editor__post-title-wrapper, .ast-stacked-title-visibility .edit-post-visual-editor__post-title-wrapper {
max-width: none;
}
.ast-page-builder-template .edit-post-visual-editor__post-title-wrapper .title-visibility, .ast-stacked-title-visibility .edit-post-visual-editor__post-title-wrapper .title-visibility {
left: unset;
top: -41px;
height: 40px;
}
/**
* For widget screen.
*/
html .edit-widgets-main-block-list :where(.wp-block) {
margin-bottom: 28px;
}
/**
* ast-separate-container layout compatibility.
*/
.ast-separate-container .edit-post-visual-editor__content-area, .ast-separate-container .edit-post-visual-editor {
padding: 20px !important;
}
/**
* Color control's name adjustment.
*/
.ast-theme-block-color-name {
mix-blend-mode: difference;
}
/**
* Page builder triggers support.
*/
#elementor-editor-button {
background: #0073aa;
border-color: #0073aa;
color: #fff;
font-size: 14px;
height: 46px;
line-height: 44px;
padding: 0 36px;
display: inline-block;
border-width: 1px;
border-style: solid;
-webkit-appearance: none;
border-radius: 3px;
white-space: nowrap;
box-sizing: border-box;
box-shadow: 0 2px 0 #006799;
}
#elementor-editor-button:hover, #elementor-editor-button:focus {
background: #007db9;
border-color: #00699b;
color: #fff;
}
#elementor-editor-button:focus {
box-shadow: 0 0 0 1px #fff, 0 0 0 3px #0073aa;
}
#elementor-editor-button:active {
background: #006291;
border-color: #006291;
color: #fff;
}
#elementor-editor-button.active, #elementor-editor-button.active:focus, #elementor-editor-button.active:hover {
background: #0073aa;
color: #fff;
border-color: #003f5e;
box-shadow: inset 0 2px 5px -3px black;
}
#elementor-editor-button i {
font-style: normal;
color: white;
}
.editor-media-placeholder button,
.fl-builder-layout-launch-view button {
margin: 2px;
}
.fl-builder-layout-launch-view .is-primary.is-primary {
color: white;
}
/**
* Modern Gutenberg editor improved UI/UX.
*/
body .editor-styles-wrapper .edit-post-visual-editor__post-title-wrapper > * + *, body .editor-styles-wrapper .block-editor-block-list__layout.is-root-container > * + * {
margin-block-start: 0;
}
.wp-block-separator {
height: 0;
}
.wp-block-separator:not(.is-style-wide) {
margin-left: auto;
margin-right: auto;
}
.wp-block-separator:not(.is-style-wide):not(.is-style-dots) {
width: 100px;
}
.editor-styles-wrapper hr {
margin-bottom: 1.5em;
padding: 0;
}
.editor-styles-wrapper .wp-block-columns {
margin-bottom: 0;
}
.editor-styles-wrapper cite {
font-style: initial;
}
.editor-styles-wrapper .block-editor-block-variation-picker {
margin-left: auto;
margin-right: auto;
}
.editor-styles-wrapper .is-root-container > .wp-block-buttons,
.editor-styles-wrapper .is-root-container > .wp-block:has(.uagb-buttons__wrap) {
/* Spacing for WP Core and Spectra's buttons block */
margin-bottom: 1.5em;
}
.wp-block-cover:not([class*='background-color']) .wp-block-cover__inner-container, .wp-block-cover:not([class*='background-color']) .wp-block-cover-image-text, .wp-block-cover:not([class*='background-color']) .wp-block-cover-text, .wp-block-cover:not([class*='background-color']) .block-editor-block-list__block, .wp-block-cover-image:not([class*='background-color']) .wp-block-cover__inner-container, .wp-block-cover-image:not([class*='background-color']) .wp-block-cover-image-text,
.wp-block-cover-image:not([class*='background-color']) .wp-block-cover-text, .wp-block-cover-image:not([class*='background-color']) .block-editor-block-list__block {
color: var(--ast-global-color-5);
}
.wp-block-file__content-wrapper {
display: flex;
align-items: center;
flex-wrap: wrap;
justify-content: space-between;
}
pre.wp-block {
background: #ECEFF3;
overflow: auto;
max-width: 100%;
padding: 1.6em;
font-size: 1em;
line-height: 1.8;
}
pre.wp-block.wp-block-preformatted {
font-family: "Courier 10 Pitch", Courier, monospace;
}
pre.wp-block code {
font-size: 15px;
font-family: "Courier 10 Pitch", Courier, monospace;
}
.wp-block-freeform.block-library-rich-text__tinymce blockquote {
border-left: 5px solid rgba(0, 0, 0, 0.05);
padding: 0 1.2em 1.2em;
}
.editor-styles-wrapper blockquote {
padding: 20px 20px 20px;
margin: 1.5em;
border: none;
}
.editor-styles-wrapper blockquote.has-text-align-left,
.editor-styles-wrapper .has-text-align-left blockquote {
border-left: 5px solid rgba(0, 0, 0, 0.05);
}
.editor-styles-wrapper blockquote.has-text-align-right,
.editor-styles-wrapper .has-text-align-right blockquote {
border-right: 5px solid rgba(0, 0, 0, 0.05);
}
.wp-block-pullquote blockquote:before {
content: "\201D";
font-family: "Helvetica",sans-serif;
display: flex;
transform: rotate(180deg);
font-size: 6rem;
font-style: normal;
line-height: 1;
font-weight: bold;
align-items: center;
justify-content: center;
}
.wp-block-pullquote.has-text-align-left blockquote:before {
justify-content: flex-end;
}
.wp-block-pullquote.has-text-align-right blockquote:before {
justify-content: flex-start;
}
.wp-block-media-text .wp-block-media-text__content {
padding: 0 0 0 8%;
}
.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content {
padding: 0 8% 0 0;
}
.wp-block-media-text.has-background .wp-block-media-text__content {
padding: 8%;
}
@media (max-width: 600px) {
.wp-block-media-text .wp-block-media-text__content {
padding: 8% 0;
}
}
.editor-styles-wrapper .wp-block-latest-posts > li > *:first-child,
.editor-styles-wrapper .wp-block-latest-posts:not(.is-grid) > li:first-child {
margin-top: 0;
}
.editor-styles-wrapper .wp-block-latest-posts > li > *,
.editor-styles-wrapper .wp-block-latest-posts:not(.is-grid) > li {
margin-top: 15px;
margin-bottom: 15px;
}
.editor-styles-wrapper .wp-block-latest-posts > li > *:last-child,
.editor-styles-wrapper .wp-block-latest-posts:not(.is-grid) > li:last-child {
margin-bottom: 0;
}
.editor-styles-wrapper .wp-block-latest-posts .wp-block-latest-posts__post-author, .editor-styles-wrapper .wp-block-latest-posts .wp-block-latest-posts__post-date {
font-size: 15px;
}
.editor-styles-wrapper .wp-block-latest-posts > li > a {
font-size: 28px;
}
.wp-block-gallery.has-nested-images figure.wp-block-image img {
width: 100%;
}
.wp-block-table td, .wp-block-table th {
padding: 0.5em;
border: 1px solid;
word-break: normal;
}
.wp-block-quote.is-style-large cite {
text-align: left;
}
.components-color-palette__custom-color {
text-align: left;
padding-left: 5px;
}
/**
* Woocommerce Gutenberg Blocks Product Grid CSS Compatibility.
*/
.wc-block-grid .wc-block-grid__products .wc-block-grid__product {
text-align: left;
margin-bottom: 2.5em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product.product-category > a {
display: inline-block;
position: relative;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product a img {
width: 100%;
height: auto;
display: block;
margin: 0 0 .8em 0;
box-shadow: none;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-title {
margin-bottom: .5em;
padding: 0;
font-size: 1em;
line-height: 1.2;
font-weight: inherit;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .star-rating {
margin: 0 auto .5em 0;
backface-visibility: hidden;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-product__link {
position: relative;
display: block;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-product__link:hover .ast-shop-product-out-of-stock {
background-color: white;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product.product-category > a:hover .woocommerce-loop-category__title {
background-color: white;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-category__title {
bottom: 1.8em;
font-size: 0.9em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-category__title .count {
font-size: .7em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .price {
line-height: 1.3;
font-weight: 700;
margin-bottom: .5em;
font-size: .9em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .price del {
display: initial;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wp-block-button__link {
margin-top: .5em;
margin-bottom: .5em;
white-space: normal;
line-height: 1.3;
font-size: 100%;
font-weight: 700;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wp-block-button__link.added {
margin-bottom: 0;
transition: margin 0s;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-category__title {
text-transform: uppercase;
font-weight: bold;
line-height: 1.5;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .woocommerce-loop-category__title .count {
display: block;
background: none;
opacity: .5;
font-size: .75em;
}
.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-onsale {
min-width: 3em;
min-height: 3em;
line-height: 3em;
padding: 0;
font-size: 1em;
font-weight: normal;
text-transform: capitalize;
position: absolute;
text-align: center;
border-radius: 100%;
z-index: 9;
top: 0;
right: 15px;
left: auto;
margin: -0.5em -0.5em 0 0;
}
.wp-core-ui .components-angle-picker-control .components-input-control__container .components-input-control__input {
padding-left: 10px;
padding-right: 10px;
}
.editor-styles-wrapper .is-root-container .wp-block-code, .editor-styles-wrapper .is-root-container pre.wp-block {
margin-bottom: 1.6em;
}
.editor-styles-wrapper .is-root-container .wp-block-image, .editor-styles-wrapper .is-root-container .wp-block-gallery, .editor-styles-wrapper .is-root-container .wp-block-audio, .editor-styles-wrapper .is-root-container .wp-block-video, .editor-styles-wrapper .is-root-container .wp-block-table, .editor-styles-wrapper .is-root-container .wp-block-pullquote {
margin-bottom: 1em;
}
.editor-styles-wrapper .is-root-container .wp-block-quote {
margin-top: 1.5em;
margin-bottom: 1.5em;
}
.editor-styles-wrapper .is-root-container .wp-block-file {
margin-bottom: 1.5em;
}
.editor-styles-wrapper .is-root-container ol, .editor-styles-wrapper .is-root-container ul {
line-height: 1.85714285714286;
}
.editor-styles-wrapper .is-root-container .wp-block-separator {
margin-top: 20px;
margin-bottom: 20px;
}
body .editor-styles-wrapper > .block-editor-block-list__layout.is-root-container > .wp-block + .wp-block-separator {
margin-top: 20px;
}
body .editor-styles-wrapper > .block-editor-block-list__layout.is-root-container > .wp-block + .wp-block-list {
margin-top: 1em;
margin-bottom: 1em;
}
body .editor-styles-wrapper > .block-editor-block-list__layout.edit-post-visual-editor__post-title-wrapper {
padding-top: 0;
}
.wp-block-table table {
margin-bottom: 1.5em;
}
.wp-block-table figcaption {
font-size: 1rem;
}
.wp-block-button button {
border-radius: 2px;
}
/**
* 6.3 Compatibility fixes in block editor.
*/
span.title-visibility svg {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 16px;
height: 40px;
fill: var(--wp-admin-theme-color);
}
#astra_settings_meta_box .components-button.is-primary:hover:not(:disabled),
.ast-meta-settings-content .components-button.is-primary:hover:not(:disabled) {
background: var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #2145e6)) !important;
color: var(--wp-components-color-accent-inverted, #fff) !important;
}

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="ast-logo" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
<glyph unicode="&#xe900;" glyph-name="LogoFontIcon2" horiz-adv-x="785" d="M743.803 919.040v-942.080h-706.56v942.080h706.56zM784.763 960h-788.48v-1024h788.48v1024zM594.002 383.775c0 13.691-1.28 28.877-3.82 45.609-2.56 16.742-8.018 32.44-16.445 47.145-8.407 14.705-20.634 27.003-36.7 36.874-16.056 9.882-41.636 14.828-69.181 14.828-35.174 0-51.036-4.608-76.257-17.091-25.508-12.616-43.325-29.962-60.017-49.807v59.3h-149.699v-399.944h149.084v186.747c6.625 16.742 16.824 30.423 30.597 41.052 13.752 10.65 26.767 15.964 39.014 15.964 11.715 0 22.036-4.444 30.966-13.292 8.919-8.878 13.394-23.214 13.394-42.967v-187.515h149.074v263.096zM181.883 765h408.422v-148.367h-408.422v148.367z" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,9 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.476 15.5L6.188 4.3H8.38L12.796 15.5H10.476ZM1.628 15.5L6.044 4.3H8.236L3.948 15.5H1.628ZM3.708 13.036V11.1H10.732V13.036H3.708ZM14.1379 15.5V4.3H16.3299V15.5H14.1379Z" fill="url(#paint0_linear_28695_116299)"/>
<defs>
<linearGradient id="paint0_linear_28695_116299" x1="18.5" y1="15.5" x2="8.46585" y2="-0.00731707" gradientUnits="userSpaceOnUse">
<stop stop-color="#FE5BE4"/>
<stop offset="1" stop-color="#5A03EF"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

View File

@@ -0,0 +1,11 @@
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="40" height="40" rx="20" fill="url(#paint0_linear_2349_55861)"/>
<path d="M19.7688 8.00063C19.7679 7.99979 19.7688 7.99979 19.7688 8.00063C16.5122 14.6651 13.2557 21.333 10 27.9975C11.3949 27.9975 12.7907 27.9975 14.1865 27.9975C16.8208 22.8376 19.4568 17.6759 22.0919 12.5126L19.7688 8.00063Z" fill="white"/>
<path d="M24.1092 16.2694C22.7652 18.976 21.4213 21.6833 20.0774 24.3899L19.9996 24.5408H20.0774C21.3695 24.5408 22.6615 24.5408 23.9536 24.5408C24.4704 25.6933 24.9873 26.8475 25.5041 28C27.0027 28 28.5014 28 30 28C28.0364 24.0881 26.0719 20.1788 24.1092 16.2694Z" fill="white"/>
<defs>
<linearGradient id="paint0_linear_2349_55861" x1="-5.96046e-07" y1="40" x2="47.0588" y2="28.2353" gradientUnits="userSpaceOnUse">
<stop stop-color="#492CDD"/>
<stop offset="1" stop-color="#AD38E2"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 938 B

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="ast-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" role="img" x="0px" y="0px"
width="864px" height="250px" viewBox="0 0 864 250" enable-background="new 0 0 864 250" xml:space="preserve">
<g>
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="31.8491" y1="207.9727" x2="216.1504" y2="42.0271">
<stop offset="0" style="stop-color:#5437DC"/>
<stop offset="1" style="stop-color:#EE79FF"/>
</linearGradient>
<circle fill="url(#SVGID_1_)" cx="124" cy="125" r="124"/>
</g>
<g>
<path fill="#453E6B" d="M359.749,165.565h-53.84L293.656,189.7h-29.147l66.278-130.144h7.611L399.85,189.7h-28.776L359.749,165.565
z M347.496,139.574l-13.553-28.963l-14.667,28.963H347.496z"/>
<path fill="#453E6B" d="M446.824,134.561c-4.27-1.113-12.252-3.156-19.678-8.168c-10.396-6.869-16.152-16.895-16.709-29.334
c-0.557-10.396,2.785-19.493,9.469-26.548c9.652-10.025,23.578-12.811,30.26-12.811c18.938,0,29.52,6.87,38.988,12.996l4.27,2.784
l-13.553,22.094l-4.641-2.971c-8.355-5.385-13.738-8.912-25.064-8.912c-1.67,0-8.168,1.301-11.51,4.828
c-1.113,1.113-2.414,3.155-2.229,7.426c0.186,6.684,4.828,10.396,16.709,13.367c1.486,0.371,2.6,0.742,3.713,1.113
c12.439,4.271,22.094,10.025,28.777,17.266c6.684,7.427,10.211,16.152,10.211,25.435c0,9.098-3.898,18.566-10.396,25.807
c-7.611,8.539-18.193,13.367-29.891,13.367c-5.756,0-13.553-0.372-22.836-3.156c-11.695-3.713-22.092-10.211-31.004-19.68
l18.938-17.822c13.738,14.666,29.146,14.666,34.902,14.666c10.768,0,14.295-9.84,14.295-13.182c0-7.054-7.982-13.552-21.535-18.194
l-0.557-0.186L446.824,134.561z"/>
<path fill="#453E6B" d="M607.975,59.557v25.992h-36.016V189.7h-25.992V85.549h-36.203V59.557H607.975z"/>
<path fill="#453E6B" d="M690.781,189.7l-24.32-52.169h-12.996v51.983h-25.992V59.371h49.014c21.535,0,38.986,17.637,38.986,39.174
c0,15.779-9.283,29.332-22.836,35.459l25.807,55.696H690.781z M653.465,85.363v26.177h23.021c7.24,0,12.996-5.755,12.996-12.995
c0-7.241-5.756-13.182-12.996-13.182H653.465z"/>
<path fill="#453E6B" d="M823.898,165.565h-53.84L757.807,189.7h-29.148l66.279-130.144h7.611L864,189.7h-28.775L823.898,165.565z
M811.646,139.574l-13.553-28.963l-14.668,28.963H811.646z"/>
</g>
<g>
<path fill="#FFFFFF" d="M122.508,56.006c-0.003-0.002-0.005-0.004-0.008-0.006c-20.998,44.329-42.002,88.671-63,133
c8.999,0,18.001,0,27,0c16.994-34.32,33.993-68.651,50.986-102.972L122.508,56.006z"/>
</g>
<path fill="#FFFFFF" d="M150.5,111c-8.666,17.998-17.334,36.002-26,54l-0.5,1h0.5c8.333,0,16.668,0,25,0
c3.333,7.666,6.667,15.334,10,23c9.666,0,19.334,0,29,0C175.835,163.002,163.166,136.998,150.5,111z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM7.5 14.16H5.84V5.84H7.5V14.16ZM14.16 14.16H9.16V12.5H14.16V14.16ZM14.16 10.84H9.16V9.16H14.16V10.84ZM14.16 7.5H9.16V5.84H14.16V7.5Z" fill="#92003B"/>
</svg>

After

Width:  |  Height:  |  Size: 355 B

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#FFAC33" d="M32.938 15.651C32.792 15.26 32.418 15 32 15H19.925L26.89 1.458c.219-.426.106-.947-.271-1.243C26.437.071 26.218 0 26 0c-.233 0-.466.082-.653.243L18 6.588 3.347 19.243c-.316.273-.43.714-.284 1.105S3.582 21 4 21h12.075L9.11 34.542c-.219.426-.106.947.271 1.243.182.144.401.215.619.215.233 0 .466-.082.653-.243L18 29.412l14.653-12.655c.317-.273.43-.714.285-1.106z"/></svg>

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -0,0 +1,11 @@
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M22 10H12C9.79086 10 8 11.7909 8 14V36C8 38.2091 9.79086 40 12 40H34C36.2091 40 38 38.2091 38 36V26M35.1716 7.17157C36.7337 5.60948 39.2663 5.60948 40.8284 7.17157C42.3905 8.73367 42.3905 11.2663 40.8284 12.8284L23.6568 30H18L18 24.3431L35.1716 7.17157Z" stroke="url(#paint0_radial_128_659)" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="16" cy="16" r="16" fill="#5F06DE" fill-opacity="0.16"/>
<defs>
<radialGradient id="paint0_radial_128_659" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(7.50417 40) rotate(-44.7252) scale(59.8801 215.176)">
<stop stop-color="#0800B5"/>
<stop offset="0.500518" stop-color="#7807E9"/>
<stop offset="1" stop-color="#CB37FF"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

@@ -0,0 +1,11 @@
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="16" cy="16" r="16" fill="#5F06DE" fill-opacity="0.16"/>
<path d="M38 42V10C38 7.79086 36.2091 6 34 6H14C11.7909 6 10 7.79086 10 10V42M38 42L42 41.9999M38 42H28M10 42L6 41.9999M10 42H20M18 14H20M18 22H20M28 14H30M28 22H30M20 42V32C20 30.8954 20.8954 30 22 30H26C27.1046 30 28 30.8954 28 32V42M20 42H28" stroke="url(#paint0_radial_128_645)" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>
<defs>
<radialGradient id="paint0_radial_128_645" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(5.475 42) rotate(-44.7252) scale(63.4025 227.834)">
<stop stop-color="#0800B5"/>
<stop offset="0.500518" stop-color="#7807E9"/>
<stop offset="1" stop-color="#CB37FF"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 846 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@@ -0,0 +1,127 @@
<svg width="512" height="444" viewBox="0 0 512 444" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_128_546)">
<path opacity="0.2" d="M455.651 54.1804C505.133 118.027 486.943 216.595 450.308 282.476C422.45 332.587 380.981 362.475 333.152 374.685C293.591 384.732 249.579 386.767 209.382 381.807C171.475 377.101 133.822 364.255 101.639 338.437C87.5194 327.118 74.5445 313.382 63.4777 297.865C53.1741 283.366 39.1815 263.144 36.2558 243.685C35.2382 236.817 36.5102 228.804 40.9624 224.48C46.5594 219.011 54.5733 220.664 61.4424 223.081C70.2195 226.261 78.8695 230.33 87.265 235.036C103.42 244.448 116.395 250.426 132.804 237.453C156.592 218.757 174.909 190.522 190.301 161.778C206.456 131.763 218.922 98.4405 236.731 69.6968C275.528 7.12222 350.452 -18.3146 408.966 14.2445C426.648 24.1649 442.803 37.5192 455.651 54.1804Z" fill="#300B8D"/>
<path d="M468.752 38.9185V346.323C468.752 351.537 464.555 355.734 459.339 355.734H73.5264C68.311 355.734 64.1133 351.537 64.1133 346.323V38.9185C64.1133 33.7039 68.311 29.5068 73.5264 29.5068H459.339C464.555 29.5068 468.752 33.7039 468.752 38.9185Z" fill="#240E8C" stroke="#751DFF" stroke-width="0.5" stroke-miterlimit="10"/>
<path d="M64.1133 60.0312H468.752V355.735H67.9294C65.7669 355.735 64.1133 354.081 64.1133 351.919V60.0312Z" fill="#6900FF"/>
<g opacity="0.5">
<path d="M86 44.999C86 47.6776 83.6429 49.999 80.5 49.999C77.3571 49.999 75 47.8562 75 44.999C75 42.1419 77.3571 39.999 80.5 39.999C83.6429 39.999 86 42.1419 86 44.999Z" fill="#6900FF"/>
<path d="M104 44.999C104 47.6776 101.857 49.999 99 49.999C96.1429 49.999 94 47.8562 94 44.999C94 42.1419 96.1429 39.999 99 39.999C101.857 39.999 104 42.1419 104 44.999Z" fill="#6900FF"/>
<path d="M123 44.999C123 47.6776 120.643 49.999 117.5 49.999C114.357 49.999 112 47.8562 112 44.999C112 42.1419 114.357 39.999 117.5 39.999C120.643 39.999 123 42.1419 123 44.999Z" fill="#6900FF"/>
</g>
<path d="M94.5126 299.646H437.839C446.87 299.646 454.248 292.27 454.248 283.24V131.763C454.248 122.733 446.87 115.356 437.839 115.356H94.5126C85.4811 115.356 78.1032 122.733 78.1032 131.763V283.24C77.976 292.27 85.3539 299.646 94.5126 299.646Z" fill="#0E074F"/>
<g opacity="0.4">
<path d="M196.153 187.215H162.825C161.553 187.215 160.281 186.579 160.281 185.816C160.281 184.926 161.299 184.417 162.825 184.417H196.153C197.425 184.417 198.697 185.053 198.697 185.816C198.697 186.579 197.425 187.215 196.153 187.215Z" fill="#D9D9D9"/>
<path d="M196.153 194.337H162.825C161.553 194.337 160.281 193.701 160.281 192.938C160.281 192.048 161.299 191.539 162.825 191.539H196.153C197.425 191.539 198.697 192.175 198.697 192.938C198.697 193.701 197.425 194.337 196.153 194.337Z" fill="#D9D9D9"/>
<path d="M179.998 201.459H162.825C161.553 201.459 160.281 200.823 160.281 200.06C160.281 199.17 161.299 198.661 162.825 198.661H179.998C181.27 198.661 182.542 199.297 182.542 200.06C182.542 200.95 181.27 201.459 179.998 201.459Z" fill="#D9D9D9"/>
<path d="M145.397 268.026H103.038C100.621 268.026 98.5859 266.118 98.5859 263.575V234.449C98.5859 232.033 100.494 229.998 103.038 229.998H145.397C147.814 229.998 149.85 231.906 149.85 234.449V263.575C149.85 266.118 147.814 268.026 145.397 268.026Z" fill="#D9D9D9"/>
<path d="M196.153 242.716H162.825C161.553 242.716 160.281 242.081 160.281 241.19C160.281 240.3 161.299 239.664 162.825 239.664H196.153C197.425 239.664 198.697 240.3 198.697 241.19C198.697 242.081 197.425 242.716 196.153 242.716Z" fill="#D9D9D9"/>
<path d="M196.153 250.934H162.825C161.553 250.934 160.281 250.298 160.281 249.408C160.281 248.518 161.299 247.882 162.825 247.882H196.153C197.425 247.882 198.697 248.518 198.697 249.408C198.697 250.298 197.425 250.934 196.153 250.934Z" fill="#D9D9D9"/>
<path d="M179.998 258.692H162.825C161.553 258.692 160.281 258.056 160.281 257.166C160.281 256.276 161.299 255.64 162.825 255.64H179.998C181.27 255.64 182.542 256.276 182.542 257.166C182.542 258.056 181.27 258.692 179.998 258.692Z" fill="#D9D9D9"/>
</g>
<rect opacity="0.5" x="218" y="123" width="229" height="169" rx="8" fill="#6900FF"/>
<path opacity="0.9" d="M314.45 87.5612H280.868C280.105 87.5612 279.469 86.7981 279.469 85.7806C279.469 84.7631 280.105 84 280.868 84H314.45C315.213 84 315.849 84.7631 315.849 85.7806C315.849 86.7981 315.213 87.5612 314.45 87.5612Z" fill="#D9D9D9"/>
<path opacity="0.9" d="M363.423 87.5612H329.841C329.077 87.5612 328.441 86.7981 328.441 85.7806C328.441 84.7631 329.077 84 329.841 84H363.423C364.186 84 364.822 84.7631 364.822 85.7806C364.822 86.7981 364.186 87.5612 363.423 87.5612Z" fill="#D9D9D9"/>
<path opacity="0.9" d="M412.27 87.5612H378.688C377.925 87.5612 377.289 86.7981 377.289 85.7806C377.289 84.7631 377.925 84 378.688 84H412.27C413.034 84 413.67 84.7631 413.67 85.7806C413.67 86.7981 413.034 87.5612 412.27 87.5612Z" fill="#D9D9D9"/>
<path d="M329.969 223.717C318.011 223.717 308.344 214.051 308.344 202.096C308.344 190.141 318.011 180.475 329.969 180.475C341.926 180.475 351.593 190.141 351.593 202.096C351.466 214.051 341.799 223.717 329.969 223.717Z" fill="#13A8E7"/>
<path d="M342.435 201.206L323.99 190.522C323.863 190.395 323.608 190.395 323.481 190.522C323.354 190.649 323.227 190.777 323.227 191.031V212.271C323.227 212.525 323.354 212.652 323.481 212.779C323.608 212.779 323.608 212.907 323.735 212.907C323.863 212.907 323.863 212.907 323.99 212.779L333.276 207.565L342.435 202.223C342.562 202.096 342.689 201.969 342.689 201.714C342.689 201.46 342.562 201.206 342.435 201.206Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M466.077 259.837C469.257 256.403 471.419 252.206 471.038 247.373C470.02 233.765 449.54 236.69 445.469 243.558C441.526 250.426 441.908 267.977 447.123 269.122C449.158 269.631 453.61 268.359 458.063 265.942L455.264 284.257H471.801L466.077 259.837Z" fill="#CE844D"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M478.289 242.795C478.798 242.286 479.053 241.65 479.307 240.887C479.561 240.251 479.816 239.488 479.943 238.725C480.325 237.326 480.325 235.672 479.18 234.528C478.289 233.637 477.017 233.256 475.745 233.129C474.982 233.129 474.092 233.129 473.328 233.383C472.565 233.637 471.929 234.146 471.166 234.401C471.166 232.874 470.912 231.221 470.021 229.949C469.258 228.677 467.859 227.914 466.459 227.787C464.933 227.533 463.406 227.914 462.134 228.55C461.753 228.677 461.498 228.932 461.117 229.059C460.862 229.186 460.608 229.44 460.226 229.44C459.845 229.568 459.717 229.313 459.463 229.059C459.209 228.804 458.827 228.55 458.573 228.296C457.173 227.278 455.265 226.897 453.612 227.533C452.848 227.787 452.085 228.296 451.576 228.932C451.068 229.44 450.813 230.331 450.177 230.712C449.923 230.839 449.668 230.712 449.414 230.458C449.032 230.203 448.651 229.949 448.269 229.695C447.76 229.313 447.124 229.059 446.615 228.932C445.725 228.804 444.453 228.804 444.198 229.822C444.071 230.203 444.198 230.712 444.198 231.094C444.198 231.602 444.326 232.238 444.326 232.747C444.326 233.129 444.453 233.637 444.453 234.019C444.453 234.273 444.58 234.655 444.58 234.909C444.453 235.164 443.817 235.036 443.562 235.036C443.054 235.036 442.545 235.164 442.036 235.291C441.654 235.418 441.273 235.672 441.146 236.054C441.018 236.308 441.018 236.563 441.146 236.817C441.146 237.071 441.146 237.199 441.146 237.58C440.51 237.326 438.093 236.563 437.838 237.707C437.711 238.089 437.965 238.47 438.093 238.852C438.347 239.361 438.729 239.869 439.237 240.378C440.128 241.396 441.018 242.286 442.163 242.922C440.891 243.431 440.637 244.957 441.654 245.847C442.163 246.229 442.799 246.356 443.435 246.356C443.69 246.356 443.944 246.229 444.198 246.356C444.326 246.356 444.453 246.483 444.58 246.483C445.471 246.483 446.361 246.356 447.251 246.229C448.778 245.974 450.177 245.211 451.322 244.321C451.576 244.067 451.831 243.939 452.212 243.939C452.594 243.939 452.848 244.067 453.23 244.067C454.12 244.067 455.011 243.685 455.774 243.431C455.774 244.448 456.156 245.72 456.665 246.61C457.046 247.373 457.809 247.5 458.573 247.628C461.117 247.882 460.608 247.882 463.152 247.882C460.735 248.391 461.117 248.391 458.7 248.9C457.555 249.154 458.445 249.79 458.954 250.299C459.717 251.062 460.354 252.079 460.735 253.097C461.88 251.698 464.042 250.68 465.951 251.189C467.986 251.698 469.512 254.241 468.113 256.149C467.35 257.166 465.951 257.675 464.806 258.057C465.696 258.947 465.951 260.219 466.459 261.236C466.714 261.745 467.095 262.381 467.731 262.508C467.986 262.635 468.24 262.635 468.367 262.763C468.622 263.017 468.622 263.144 468.876 263.399C470.021 264.162 471.675 264.034 472.692 263.144C473.583 262.254 473.328 260.982 472.565 260.092C473.71 259.583 475.873 259.074 475.364 257.421C477.908 257.294 484.014 253.478 480.706 250.68C482.614 249.663 484.268 247.373 483.123 245.211C482.233 243.685 480.07 242.922 478.289 242.795Z" fill="#0B0456"/>
<g opacity="0.6">
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" d="M495.082 353.191H456.284L441.528 443.238H512L495.082 353.191Z" fill="#A6A4F7"/>
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" d="M495.082 353.191H480.453L471.803 443.238H512L495.082 353.191Z" fill="#A6A4F7"/>
</g>
<path fill-rule="evenodd" clip-rule="evenodd" d="M387.847 350.521C382.123 347.341 372.71 351.411 372.71 355.99C372.71 369.471 386.066 433.063 386.702 437.133C387.338 441.203 394.843 442.22 395.225 437.133C395.861 429.12 395.607 401.14 394.334 388.167C393.826 382.825 394.716 377.738 394.207 373.287C401.204 384.988 412.016 401.649 426.645 423.397L434.531 420.09C428.298 401.14 423.21 387.658 419.267 379.773C412.398 366.419 406.037 354.845 403.366 350.902C399.041 344.543 391.663 346.705 387.847 350.521Z" fill="#CE844D"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M434.023 409.533L406.802 349.757C400.314 340.091 381.997 351.792 384.159 357.388C389.247 370.233 414.943 411.568 416.342 415.384L434.023 409.533Z" fill="#140666"/>
<g opacity="0.7">
<path fill-rule="evenodd" clip-rule="evenodd" d="M435.495 416.325C437.11 417.595 438.314 418.663 438.823 419.544C439.395 420.535 440.176 422.141 441.037 424.141C439.825 424.84 428.554 430.759 407.352 442.117C404.771 439.935 404.384 438.249 406.13 436.947C407.939 435.756 409.354 434.646 410.502 433.836L422.096 419.066C422.363 418.765 422.757 418.684 423.058 418.951L425.495 420.628C427.703 420.382 429.39 419.996 430.445 419.534C431.326 419.025 432.411 418.105 433.461 416.618C433.931 415.906 434.783 415.855 435.495 416.325C435.431 416.215 435.431 416.215 435.495 416.325Z" fill="#300B8D"/>
</g>
<g opacity="0.7">
<path fill-rule="evenodd" clip-rule="evenodd" d="M397.008 433.953C397.771 435.861 398.152 437.26 398.152 438.277C398.152 439.422 397.898 441.075 397.516 443.364C396.117 443.364 383.142 443.364 358.719 443.364C357.701 440.312 358.337 438.659 360.5 438.404C362.662 438.15 364.443 437.896 365.969 437.768L384.033 430.264C384.414 430.137 384.796 430.264 384.923 430.646L386.068 433.317C388.103 434.207 389.757 434.589 391.029 434.589C392.046 434.589 393.446 434.207 395.227 433.444C395.735 432.935 396.626 433.19 397.008 433.953C397.008 433.826 396.88 433.826 397.008 433.953Z" fill="#300B8D"/>
</g>
<path fill-rule="evenodd" clip-rule="evenodd" d="M370.674 360.568C370.674 377.483 379.323 417.037 379.323 420.726H398.023C395.224 385.496 394.334 367.563 395.097 367.181C396.242 366.673 444.071 371.633 458.318 371.633C478.925 371.633 487.448 359.55 488.211 337.293H447.251C438.983 338.056 395.479 346.196 379.323 348.994C372.582 350.266 370.674 355.862 370.674 360.568Z" fill="#1E0489"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M343.455 269.885L379.836 234.782C381.871 232.747 384.415 231.729 386.705 231.729C389.758 231.729 392.683 233.383 394.464 236.562L411.128 265.433C414.435 271.029 413.29 279.424 408.457 284.129L373.348 317.96C368.514 322.666 362.281 321.267 357.447 317.452L340.784 288.581C337.349 282.985 338.621 274.463 343.455 269.885Z" fill="url(#paint0_linear_128_546)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M441.02 297.611L417.105 285.529C413.162 281.205 409.218 277.771 405.402 275.354C404.257 274.845 402.222 274.591 404.13 277.771C406.038 280.95 407.946 284.384 406.929 285.275C405.911 286.292 403.494 284.893 402.349 286.546C401.586 287.691 405.784 289.344 414.943 291.634L432.37 306.387L441.02 297.611ZM403.621 307.786L393.063 302.444C391.537 297.23 389.883 294.686 387.721 294.559C386.194 293.923 388.865 300.409 385.94 299.901C383.014 299.392 375.636 294.305 374.364 295.322C372.456 296.848 374.11 301.427 376.145 303.716C379.834 308.04 382.76 309.44 390.265 311.474C394.208 312.492 398.406 314.527 402.858 317.579L403.621 307.786Z" fill="#CE844D"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M452.724 294.813C444.328 294.686 433.134 293.032 421.304 286.037L416.597 295.703C424.866 303.207 436.314 309.439 446.491 309.185C454.377 309.057 458.448 300.155 452.724 294.813Z" fill="url(#paint1_linear_128_546)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M441.402 310.329C432.497 312.364 417.614 309.948 396.626 303.08C391.41 313 388.993 320.123 389.375 324.32C407.311 332.968 422.703 336.911 435.423 337.165C435.041 344.16 435.932 350.774 438.985 356.879C445.345 369.343 482.362 357.769 494.828 360.058C502.587 336.657 487.577 327.118 487.577 312.11C487.577 295.703 473.33 270.394 471.168 270.394H452.087C451.069 282.858 445.854 296.721 441.402 310.329Z" fill="url(#paint2_linear_128_546)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M39.3256 157.779C34.7988 154.646 31.3031 150.447 30.19 144.82C27.048 128.676 49.9953 126.347 56.4358 133.181C62.8763 140.014 67.8179 160.417 62.6513 163.249C60.6044 164.456 55.5405 164.232 49.9915 162.69L58.6367 183.154L40.9446 187.893L39.3256 157.779Z" fill="#FCBB89"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M59.0824 136.252C58.6961 135.302 57.8753 134.205 57.2433 133.321C56.4226 132.224 55.479 131.16 54.4784 130.375C52.6 128.771 50.3859 127.389 48.1148 126.286C43.9502 124.504 39.2217 124.059 35.1759 125.67C33.153 126.475 31.2948 127.895 29.8139 129.74C28.5459 131.396 27.4425 133.667 25.5096 134.316C23.3309 135.032 20.7153 133.626 18.543 132.891C16.0921 132.099 13.7399 131.676 11.1508 131.842C7.05442 132.281 3.60771 134.653 1.76072 138.572C-0.266156 142.801 -0.971975 148.521 2.21221 152.54C2.8113 153.301 9.57966 166.762 11.4492 167.842C13.3187 168.921 15.2365 169.197 17.3341 169.162C18.6286 169.079 20.0131 168.84 21.3317 168.355C22.1588 168.001 22.8302 167.558 23.7802 167.172C26.8873 168.446 29.9108 168.427 32.9166 167.358C35.1853 166.487 37.7566 165.271 39.1716 163.181C40.7994 160.901 40.1409 158.444 38.925 155.873C39.4823 155.987 40.9897 155.715 39.8662 154.962C39.3988 154.692 38.7186 154.611 38.1613 154.497C37.6039 154.383 37.0137 154.146 36.3905 153.786C34.2993 152.372 34.8759 148.135 36.8 146.961C39.6083 145.156 41.375 149.291 43.883 149.804C45.2763 150.089 46.3974 148.867 47.027 147.777C47.9264 146.219 48.3913 144.515 48.7005 142.72C48.9526 141.204 49.0819 139.721 49.367 138.328C49.4481 137.648 49.97 135.664 49.281 135.059C51.3609 133.975 53.9588 134.332 56.0982 134.944C56.9671 135.238 57.7131 135.565 58.3122 136.327C58.468 136.416 58.7555 136.998 59.0013 136.932C59.5257 136.923 59.1482 136.498 59.0824 136.252Z" fill="#190649"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.3711 324.174C39.6886 329.261 55.5892 331.932 68.9458 331.932C82.3023 331.932 94.6412 327.99 106.09 320.104C88.1537 314.89 73.2707 312.219 61.6951 312.219C50.1194 312.219 36.6357 316.161 21.3711 324.174Z" fill="#176084"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M72.5078 337.529C72.3806 337.274 72.1261 337.02 72.1261 336.638C69.582 330.152 37.0176 259.819 33.0742 246.974H77.3416C80.2673 256.64 93.751 317.815 95.6591 329.898C101.638 349.103 113.849 411.296 115.376 415.62C117.03 420.199 107.744 424.904 105.327 419.308C101.383 410.405 87.1363 381.662 83.0658 366.654C79.1224 352.664 74.0342 344.651 72.5078 337.529Z" fill="#FCBB89"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M102.557 418.718C101.667 421.007 101.285 422.661 101.285 423.805C101.285 425.205 101.54 427.239 101.921 429.783C103.575 429.783 117.949 429.783 145.044 429.783C146.189 426.095 145.552 424.06 143.136 423.805C140.719 423.551 138.683 423.297 137.157 423.042L117.059 414.139C116.677 414.012 116.168 414.139 116.041 414.521L114.769 417.701C112.479 418.718 110.698 419.227 109.299 419.227C108.154 419.227 106.628 418.718 104.592 417.828C103.829 417.446 102.939 417.828 102.557 418.718C102.557 418.591 102.557 418.591 102.557 418.718Z" fill="url(#paint3_linear_128_546)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M102.557 418.718C101.667 421.007 101.285 422.661 101.285 423.805C101.285 425.205 101.54 427.239 101.921 429.783C103.575 429.783 117.949 429.783 145.044 429.783C146.189 426.095 145.552 424.06 143.136 423.805C140.719 423.551 138.683 423.297 137.157 423.042L117.059 414.139C116.677 414.012 116.168 414.139 116.041 414.521L114.769 417.701C112.479 418.718 110.698 419.227 109.299 419.227C108.154 419.227 106.628 418.718 104.592 417.828C103.829 417.446 102.939 417.828 102.557 418.718C102.557 418.591 102.557 418.591 102.557 418.718Z" fill="url(#paint4_linear_128_546)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.7286 332.696C34.7286 332.441 34.6014 332.06 34.7286 331.678C35.1102 324.81 33.5837 244.048 35.1102 230.821L69.0739 249.263C67.9291 259.311 60.424 318.451 57.371 330.407C55.0814 350.502 36.7638 414.602 36.5094 419.181C36.255 424.014 25.8242 424.65 25.8242 418.545C25.8242 408.879 26.9691 382.552 29.1315 367.163C31.1668 352.791 33.3293 339.945 34.7286 332.696Z" fill="#FCBB89"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.5626 416.811C21.9089 418.591 20.7641 419.99 20.3824 421.008C19.8736 422.28 19.2376 424.187 18.6016 426.858C20.128 427.494 33.2301 433.218 58.1623 444.155C60.7064 441.23 60.8336 439.068 58.7983 437.923C56.7631 436.651 54.9822 435.634 53.5829 434.744L38.8272 418.591C38.5728 418.337 38.0639 418.21 37.8095 418.591L35.3926 420.881C32.9757 420.881 31.0677 420.753 29.7956 420.118C28.778 419.609 27.5059 418.591 25.9795 416.938C25.2162 416.175 24.1986 416.175 23.5626 416.811C23.5626 416.811 23.5626 416.684 23.5626 416.811Z" fill="url(#paint5_linear_128_546)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M36.3824 249.136C53.6823 244.176 69.9645 244.176 85.3563 249.136C90.6989 273.683 103.674 283.349 105.963 320.741C79.8865 333.714 47.8308 311.584 20.9906 324.175C13.4855 306.496 24.1707 264.144 36.3824 249.136Z" fill="url(#paint6_linear_128_546)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M62.6327 186.797L88.1818 170.541C92.2499 165.045 96.2664 160.721 100.356 157.546C101.668 156.927 103.901 156.405 102.014 160.353C100.127 164.302 98.2845 168.501 99.5076 169.577C100.731 170.653 103.266 168.915 104.747 170.72C105.741 171.966 101.246 174.308 91.2611 177.747L73.0141 196.591L62.6327 186.797Z" fill="#FCBB89"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M49.4134 184.349C58.7128 183.614 70.8789 180.824 83.591 171.609L89.5731 182.824C81.0685 192.459 68.7029 200.709 57.5392 201.127C48.6967 201.524 43.5177 191.201 49.4134 184.349Z" fill="url(#paint7_linear_128_546)"/>
<path d="M155.11 215.31L96.6728 185.703C93.416 184.082 92.0975 179.535 94.2126 175.417L118.069 128.334C120.103 124.488 124.392 122.441 127.818 124.291L186.13 153.92C189.387 155.542 190.705 160.088 188.59 164.206L164.712 211.164C162.722 215.26 158.367 216.932 155.11 215.31Z" fill="url(#paint8_linear_128_546)"/>
<g opacity="0.6">
<path d="M151.58 204.826L106.612 182.013C104.07 180.782 103.053 177.216 104.697 174.085L123.092 137.78C124.632 134.796 127.985 133.301 130.549 134.657L175.517 157.47C178.059 158.7 179.075 162.267 177.432 165.398L159.037 201.703C157.519 204.812 154.122 206.056 151.58 204.826Z" stroke="white" stroke-width="2" stroke-miterlimit="10"/>
</g>
<path opacity="0.3" d="M164.474 172.461L146.81 190.944C144.842 192.969 141.32 192.04 140.583 189.329L132.018 145.894C131.237 142.932 127.487 142.173 125.585 144.574L110.573 173.696C109.084 175.509 109.696 178.242 111.818 179.289L150.921 198.872C152.748 199.712 154.959 199.064 155.799 197.237L167.274 174.421C168.136 172.72 165.778 171.069 164.474 172.461Z" fill="white"/>
<path opacity="0.5" d="M151.813 171.721C155.48 171.075 157.928 167.579 157.281 163.912C156.635 160.246 153.138 157.798 149.471 158.444C145.804 159.09 143.356 162.586 144.003 166.253C144.65 169.919 148.146 172.368 151.813 171.721Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M128.71 201.107L139.13 192.813C139.676 186.388 141.003 182.926 143.257 182.528C144.879 181.467 143.22 189.638 146.366 188.438C149.513 187.237 156.47 179.812 158.069 180.821C160.382 182.222 159.6 188.042 157.957 191.173C154.854 197.015 151.884 199.218 144.161 203.033C140.101 204.911 135.908 208.233 131.516 212.623L128.71 201.107Z" fill="#FFAF78"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M79.4295 213.927C89.6203 214.584 105.419 208.958 126.886 196.65C134.599 207.43 138.71 215.359 139.218 220.435C121.362 234.173 105.268 241.788 91.5327 244.468C89.4463 253.876 90.9561 260.972 91.7364 268.325C87.4313 284.194 37.4955 269.104 24.305 274.142C30.3586 239.625 32.4141 242.491 29.2771 224.705C25.8529 205.29 36.2537 172.719 38.5086 172.322L59.4287 168.634C63.185 183.341 71.8415 198.733 79.4295 213.927Z" fill="url(#paint9_linear_128_546)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M88.1523 170.172C92.2229 164.703 96.2935 160.252 100.364 157.072C101.636 156.437 103.926 155.928 102.018 159.87C100.11 163.813 98.3287 168.01 99.4736 169.155C100.618 170.3 103.29 168.392 104.689 170.3C105.579 171.571 101.127 173.861 91.2053 177.422L88.1523 170.172Z" fill="#FCBB89"/>
<path opacity="0.9" fill-rule="evenodd" clip-rule="evenodd" d="M365.46 265.688C365.588 265.179 365.842 264.67 366.224 264.162C366.732 263.653 367.241 263.526 367.496 263.653C367.75 263.78 368.386 264.416 369.149 265.179L383.142 281.331C383.905 282.222 384.287 282.73 384.414 283.112C384.923 284.129 384.668 285.147 383.778 286.164C383.396 286.546 383.015 286.673 382.76 286.673C382.379 286.673 382.124 286.546 381.87 286.292C381.615 286.037 381.234 285.656 380.725 285.02L366.732 268.74C366.096 267.977 365.588 267.468 365.46 267.087C365.46 266.705 365.333 266.196 365.46 265.688ZM365.079 270.902L354.902 292.524L356.938 296.721L374.746 290.234L372.329 285.401L360.118 290.489L367.496 275.862L365.079 270.902ZM393.445 253.732L375.637 260.219L378.181 265.179L390.265 260.092L383.015 274.718L385.432 279.551L395.481 257.93L393.445 253.732Z" fill="url(#paint10_linear_128_546)"/>
<path d="M132.546 91.7204H91.8407C88.279 91.7204 85.4805 88.7951 85.4805 85.3612C85.4805 81.8 88.4062 79.002 91.8407 79.002H132.546C136.108 79.002 138.907 81.9272 138.907 85.3612C139.034 88.7951 136.108 91.7204 132.546 91.7204Z" fill="url(#paint11_linear_128_546)"/>
<circle cx="439" cy="86" r="7" fill="#D9D9D9"/>
</g>
<defs>
<linearGradient id="paint0_linear_128_546" x1="338.856" y1="276.323" x2="264.707" y2="276.323" gradientUnits="userSpaceOnUse">
<stop stop-color="#F3B412"/>
<stop offset="1" stop-color="#EE2616"/>
</linearGradient>
<linearGradient id="paint1_linear_128_546" x1="416.577" y1="297.735" x2="454.998" y2="297.998" gradientUnits="userSpaceOnUse">
<stop stop-color="#00AAEB"/>
<stop offset="1" stop-color="#06EDA4"/>
</linearGradient>
<linearGradient id="paint2_linear_128_546" x1="432.499" y1="327.001" x2="344.999" y2="302.001" gradientUnits="userSpaceOnUse">
<stop stop-color="#06EDA4"/>
<stop offset="1" stop-color="#00AAEB"/>
</linearGradient>
<linearGradient id="paint3_linear_128_546" x1="101.219" y1="421.933" x2="145.6" y2="421.933" gradientUnits="userSpaceOnUse">
<stop stop-color="#6900FF"/>
<stop offset="1" stop-color="#B600FF"/>
</linearGradient>
<linearGradient id="paint4_linear_128_546" x1="101.191" y1="421.898" x2="145.509" y2="421.898" gradientUnits="userSpaceOnUse">
<stop stop-color="#FA00FF"/>
<stop offset="1" stop-color="#B600FF"/>
</linearGradient>
<linearGradient id="paint5_linear_128_546" x1="18.5132" y1="430.182" x2="60.1279" y2="430.182" gradientUnits="userSpaceOnUse">
<stop stop-color="#FA00FF"/>
<stop offset="1" stop-color="#B600FF"/>
</linearGradient>
<linearGradient id="paint6_linear_128_546" x1="18.5136" y1="285.247" x2="106.02" y2="285.247" gradientUnits="userSpaceOnUse">
<stop stop-color="#06EDA4"/>
<stop offset="1" stop-color="#00AAEB"/>
</linearGradient>
<linearGradient id="paint7_linear_128_546" x1="46.8919" y1="186.408" x2="88.9319" y2="178.994" gradientUnits="userSpaceOnUse">
<stop stop-color="#EE2616"/>
<stop offset="0.1834" stop-color="#EE2B16"/>
<stop offset="0.3893" stop-color="#EF3815"/>
<stop offset="0.6062" stop-color="#F04F14"/>
<stop offset="0.829" stop-color="#F26E13"/>
<stop offset="1" stop-color="#F38B12"/>
</linearGradient>
<linearGradient id="paint8_linear_128_546" x1="93.2046" y1="169.764" x2="188.195" y2="153.009" gradientUnits="userSpaceOnUse">
<stop stop-color="#FF954B"/>
<stop offset="1" stop-color="#FF0E95"/>
</linearGradient>
<linearGradient id="paint9_linear_128_546" x1="24.2751" y1="222.344" x2="137.43" y2="202.386" gradientUnits="userSpaceOnUse">
<stop stop-color="#F38B12"/>
<stop offset="1" stop-color="#EE2616"/>
</linearGradient>
<linearGradient id="paint10_linear_128_546" x1="355.005" y1="275.181" x2="395.597" y2="275.249" gradientUnits="userSpaceOnUse">
<stop stop-color="#F2F2F2"/>
<stop offset="1" stop-color="#F2F2F2" stop-opacity="0.64"/>
</linearGradient>
<linearGradient id="paint11_linear_128_546" x1="85.4665" y1="85.2828" x2="138.977" y2="85.2828" gradientUnits="userSpaceOnUse">
<stop stop-color="#06EDA4"/>
<stop offset="1" stop-color="#00AAEB"/>
</linearGradient>
<clipPath id="clip0_128_546">
<rect width="512" height="444" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,11 @@
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="24" cy="24" r="24" fill="#E5D7FA"/>
<path d="M11.5147 16.8477C6.82843 21.534 6.82843 29.132 11.5147 33.8183L32.0001 54.3037L52.4853 33.8183C57.1716 29.132 57.1716 21.534 52.4853 16.8477C47.799 12.1614 40.201 12.1614 35.5147 16.8477L32.0001 20.3626L28.4853 16.8477C23.799 12.1614 16.201 12.1614 11.5147 16.8477Z" stroke="url(#paint0_radial_128_793)" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"/>
<defs>
<radialGradient id="paint0_radial_128_793" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(7.3 54.3037) rotate(-40.2114) scale(78.6501 278.699)">
<stop stop-color="#0800B5"/>
<stop offset="0.500518" stop-color="#7807E9"/>
<stop offset="1" stop-color="#CB37FF"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 859 B

View File

@@ -0,0 +1,11 @@
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18.0012 24.0002L22.0012 28.0002L30.0012 20.0002M15.6707 9.39434C17.1058 9.27982 18.4681 8.71551 19.5639 7.78174C22.1208 5.6027 25.8816 5.6027 28.4386 7.78174C29.5343 8.71551 30.8967 9.27982 32.3317 9.39434C35.6806 9.66158 38.3399 12.3209 38.6071 15.6697C38.7216 17.1048 39.286 18.4672 40.2197 19.5629C42.3988 22.1199 42.3988 25.8806 40.2197 28.4376C39.286 29.5333 38.7216 30.8957 38.6071 32.3308C38.3399 35.6796 35.6806 38.3389 32.3317 38.6062C30.8967 38.7207 29.5343 39.285 28.4386 40.2188C25.8816 42.3978 22.1208 42.3978 19.5639 40.2188C18.4681 39.285 17.1058 38.7207 15.6707 38.6062C12.3218 38.3389 9.66256 35.6796 9.39531 32.3308C9.2808 30.8957 8.71648 29.5333 7.78272 28.4376C5.60368 25.8806 5.60368 22.1199 7.78272 19.5629C8.71648 18.4672 9.2808 17.1048 9.39531 15.6697C9.66256 12.3209 12.3218 9.66158 15.6707 9.39434Z" stroke="url(#paint0_radial_128_666)" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="16" cy="16" r="16" fill="#5F06DE" fill-opacity="0.16"/>
<defs>
<radialGradient id="paint0_radial_128_666" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(5.62773 41.853) rotate(-44.7252) scale(62.8839 225.97)">
<stop stop-color="#0800B5"/>
<stop offset="0.500518" stop-color="#7807E9"/>
<stop offset="1" stop-color="#CB37FF"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,11 @@
<svg width="65" height="64" viewBox="0 0 65 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="24.668" cy="24" r="24" fill="#E5D7FA"/>
<path d="M27.3331 26.6667H14.6293C10.6646 26.6667 8.08593 30.839 9.859 34.3851L19.1923 53.0518C20.0958 54.8587 21.9425 56 23.9626 56H34.6765C35.1126 56 35.547 55.9465 35.9701 55.8408L45.9998 53.3333M27.3331 26.6667V13.3333C27.3331 10.3878 29.7209 8 32.6664 8H32.921C34.2532 8 35.3331 9.07992 35.3331 10.4121C35.3331 12.3169 35.8969 14.1791 36.9535 15.764L45.9998 29.3333V53.3333M27.3331 26.6667H32.6664M45.9998 53.3333H51.3331C54.2786 53.3333 56.6664 50.9455 56.6664 48V32C56.6664 29.0545 54.2786 26.6667 51.3331 26.6667H44.6664" stroke="url(#paint0_radial_128_800)" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"/>
<defs>
<radialGradient id="paint0_radial_128_800" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(8.59814 8.00001) rotate(45.0992) scale(83.9849 301.807)">
<stop stop-color="#0800B5"/>
<stop offset="0.500518" stop-color="#7807E9"/>
<stop offset="1" stop-color="#CB37FF"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,11 @@
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M32 22V14C32 9.58172 28.4183 6 24 6C19.5817 6 16 9.58172 16 14V22M10 18H38L40 42H8L10 18Z" stroke="url(#paint0_radial_128_652)" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="16" cy="16" r="16" fill="#5F06DE" fill-opacity="0.16"/>
<defs>
<radialGradient id="paint0_radial_128_652" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(7.53333 42) rotate(-48.0934) scale(59.9499 214.182)">
<stop stop-color="#0800B5"/>
<stop offset="0.500518" stop-color="#7807E9"/>
<stop offset="1" stop-color="#CB37FF"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 702 B

View File

@@ -0,0 +1,11 @@
<svg width="65" height="64" viewBox="0 0 65 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="24.332" cy="24" r="24" fill="#E5D7FA"/>
<path d="M54.732 32C54.732 44.3712 44.7032 54.4 32.332 54.4V57.6C46.4705 57.6 57.932 46.1385 57.932 32H54.732ZM32.332 54.4C19.9609 54.4 9.93203 44.3712 9.93203 32H6.73203C6.73203 46.1385 18.1935 57.6 32.332 57.6V54.4ZM9.93203 32C9.93203 19.6288 19.9609 9.6 32.332 9.6V6.4C18.1935 6.4 6.73203 17.8615 6.73203 32H9.93203ZM32.332 9.6C44.7032 9.6 54.732 19.6288 54.732 32H57.932C57.932 17.8615 46.4705 6.4 32.332 6.4V9.6ZM41.3987 32C41.3987 37.0074 37.3394 41.0667 32.332 41.0667V44.2667C39.1067 44.2667 44.5987 38.7747 44.5987 32H41.3987ZM32.332 41.0667C27.3246 41.0667 23.2654 37.0074 23.2654 32H20.0654C20.0654 38.7747 25.5573 44.2667 32.332 44.2667V41.0667ZM23.2654 32C23.2654 26.9926 27.3246 22.9333 32.332 22.9333V19.7333C25.5573 19.7333 20.0654 25.2253 20.0654 32H23.2654ZM32.332 22.9333C37.3394 22.9333 41.3987 26.9926 41.3987 32H44.5987C44.5987 25.2253 39.1067 19.7333 32.332 19.7333V22.9333ZM48.1712 13.8981L38.7431 23.3262L41.0059 25.5889L50.434 16.1608L48.1712 13.8981ZM38.7431 40.6738L48.1712 50.1019L50.434 47.8392L41.0059 38.4111L38.7431 40.6738ZM25.9209 23.3262L16.4928 13.8981L14.2301 16.1608L23.6582 25.5889L25.9209 23.3262ZM23.6582 38.4111L14.2301 47.8392L16.4928 50.1019L25.9209 40.6738L23.6582 38.4111Z" fill="url(#paint0_radial_128_807)"/>
<defs>
<radialGradient id="paint0_radial_128_807" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(7.63203 56) rotate(-44.7252) scale(84.5367 303.778)">
<stop stop-color="#0800B5"/>
<stop offset="0.500518" stop-color="#7807E9"/>
<stop offset="1" stop-color="#CB37FF"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@@ -0,0 +1,12 @@
function parseSVG ( svg ) {
svg = svg.replace( "far ", "" )
svg = svg.replace( "fas ", "" )
svg = svg.replace( "fab ", "" )
svg = svg.replace( "fa-", "" )
svg = svg.replace( "fa ", "" )
return svg
}
export default parseSVG

View File

@@ -0,0 +1,30 @@
/**
* Set inline CSS class.
* @param {object} props - The block object.
* @return {array} The inline CSS class.
*/
import astIcons from "../../../assets/svg/ast-social-icons"
import parseSVG from "./ast-parse-svg"
import React from 'react';
function renderSVG ( svg ) {
svg = parseSVG( svg )
var fontAwesome = astIcons[svg]
if ( "undefined" != typeof fontAwesome ) {
var viewbox_array = ( fontAwesome["svg"].hasOwnProperty("brands") ) ? fontAwesome["svg"]["brands"]["viewBox"] : fontAwesome["svg"]["solid"]["viewBox"]
var path = ( fontAwesome["svg"].hasOwnProperty("brands") ) ? fontAwesome["svg"]["brands"]["path"] : fontAwesome["svg"]["solid"]["path"]
var viewBox = viewbox_array.join( " " )
return (
<svg xmlns="http://www.w3.org/2000/svg" viewBox={viewBox}><path d={path}></path></svg>
)
}
}
export default renderSVG;

View File

@@ -0,0 +1,185 @@
/**
* Install Starter Templates
*
*
* @since 1.2.4
*/
(function($){
AstraThemeAdmin = {
init: function()
{
this._bind();
},
/**
* Binds events for the Astra Theme.
*
* @since 1.0.0
* @method _bind
*/
_bind: function()
{
$( document ).on('ast-after-plugin-active', AstraThemeAdmin._disableActivcationNotice );
$( document ).on('click' , '.astra-install-recommended-plugin', AstraThemeAdmin._installNow );
$( document ).on('click' , '.astra-activate-recommended-plugin', AstraThemeAdmin._activatePlugin);
$( document ).on('wp-plugin-install-success' , AstraThemeAdmin._activatePlugin);
$( document ).on('wp-plugin-install-error' , AstraThemeAdmin._installError);
$( document ).on('wp-plugin-installing' , AstraThemeAdmin._pluginInstalling);
},
/**
* Plugin Installation Error.
*/
_installError: function( event, response ) {
var $card = jQuery( '.astra-install-recommended-plugin' );
$card
.removeClass( 'button-primary' )
.addClass( 'disabled' )
.html( wp.updates.l10n.installFailedShort );
},
/**
* Installing Plugin
*/
_pluginInstalling: function(event, args) {
event.preventDefault();
var slug = args.slug;
var $card = jQuery( '.astra-install-recommended-plugin' );
var activatingText = astra.recommendedPluiginActivatingText;
$card.each(function( index, element ) {
element = jQuery( element );
if ( element.data('slug') === slug ) {
element.addClass('updating-message');
element.html( activatingText );
}
});
},
/**
* Activate Success
*/
_activatePlugin: function( event, response ) {
event.preventDefault();
var $message = jQuery(event.target);
var $init = $message.data('init');
var activatedSlug = $init;
if (typeof $init === 'undefined') {
var $message = jQuery('.astra-install-recommended-plugin[data-slug=' + response.slug + ']');
activatedSlug = response.slug;
}
// Transform the 'Install' button into an 'Activate' button.
$init = $message.data('init');
var activatingText = astra.recommendedPluiginActivatingText;
var astraSitesLink = astra.astraSitesLink;
var astraPluginRecommendedNonce = astra.astraPluginManagerNonce;
$message.removeClass( 'install-now installed button-disabled updated-message' )
.addClass('updating-message')
.html( activatingText );
// WordPress adds "Activate" button after waiting for 1000ms. So we will run our activation after that.
setTimeout( function() {
$.ajax({
url: astra.ajaxUrl,
type: 'POST',
data: {
'action' : 'astra_recommended_plugin_activate',
'security' : astraPluginRecommendedNonce,
'init' : $init,
},
})
.done(function (result) {
console.error( result );
if( result.success ) {
$message.removeClass( 'astra-activate-recommended-plugin astra-install-recommended-plugin button button-primary install-now activate-now updating-message' );
$message.parent('.ast-addon-link-wrapper').parent('.astra-recommended-plugin').addClass('active');
jQuery(document).trigger( 'ast-after-plugin-active', [astraSitesLink, activatedSlug] );
} else {
$message.removeClass( 'updating-message' );
}
});
}, 1200 );
},
/**
* Install Now
*/
_installNow: function(event)
{
event.preventDefault();
var $button = jQuery( event.target ),
$document = jQuery(document);
if ( $button.hasClass( 'updating-message' ) || $button.hasClass( 'button-disabled' ) ) {
return;
}
if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.ajaxLocked ) {
wp.updates.requestFilesystemCredentials( event );
$document.on( 'credential-modal-cancel', function() {
var $message = $( '.astra-install-recommended-plugin.updating-message' );
$message
.addClass('astra-activate-recommended-plugin')
.removeClass( 'updating-message astra-install-recommended-plugin' )
.text( wp.updates.l10n.installNow );
wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' );
} );
}
wp.updates.installPlugin( {
slug: $button.data( 'slug' )
});
},
/**
* After plugin active redirect and deactivate activation notice
*/
_disableActivcationNotice: function( event, astraSitesLink, activatedSlug )
{
event.preventDefault();
if ( activatedSlug.indexOf( 'astra-sites' ) >= 0 || activatedSlug.indexOf( 'astra-pro-sites' ) >= 0 ) {
if ( 'undefined' != typeof AstraNotices ) {
AstraNotices._ajax( 'astra-sites-on-active', '' );
}
window.location.href = astraSitesLink + '&ast-disable-activation-notice';
}
},
};
/**
* Initialize AstraThemeAdmin
*/
$(function(){
AstraThemeAdmin.init();
});
})(jQuery);

View File

@@ -0,0 +1,958 @@
window.addEventListener( 'load', function(e) {
astra_onload_function();
});
// Function to add block editor dynamic styles.
function blockEditorDynamicStyles() {
setTimeout(() => {
const iframes = document.getElementsByTagName('iframe');
if (!iframes?.length) return;
const cloneLinkElement = (id) => {
const element = document.getElementById(id);
return element ? element.cloneNode(true) : null;
}
const googleFontsStyle = cloneLinkElement('astra-google-fonts-css');
const appendLinkIfNotExists = (iframeDoc, clonedLink, linkId) => {
if (clonedLink && !iframeDoc.getElementById(linkId)) {
iframeDoc.head.appendChild(clonedLink);
}
}
for (const iframe of iframes) {
try {
const iframeDoc = iframe?.contentWindow?.document || iframe?.contentDocument;
if (iframeDoc?.head) {
appendLinkIfNotExists(iframeDoc, googleFontsStyle, 'astra-google-fonts-css');
}
} catch {
// Access denied to iframe document.
}
}
}, 1000);
}
function addTitleVisibility() {
let titleVisibility = document.querySelector( '.title-visibility' ),
titleBlock = document.querySelector( '.edit-post-visual-editor__post-title-wrapper' ),
editorDocument = document,
postTitleOption = ( undefined !== wp.data.select( 'core/editor' ) && null !== wp.data.select( 'core/editor' ) && undefined !== wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' ) && wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-post-title'] ) ? wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-post-title'] : '';
if ( astraColors.ast_wp_version_higher_6_3 ) {
let desktopPreview = document.getElementsByClassName('is-desktop-preview'),
tabletPreview = document.getElementsByClassName('is-tablet-preview'),
mobilePreview = document.getElementsByClassName('is-mobile-preview'),
devicePreview = desktopPreview[0];
if ( tabletPreview.length > 0 ) {
devicePreview = tabletPreview[0];
} else if ( mobilePreview.length > 0 ) {
devicePreview = mobilePreview[0];
}
let iframe = undefined !== devicePreview ? devicePreview.getElementsByTagName('iframe')[0] : undefined;
if ( iframe && devicePreview.querySelector('iframe') !== null ) {
editorDocument = iframe.contentWindow.document || iframe.contentDocument;
}
// Addressed the WordPress 6.5 issue involving an extraneous iframe layer.
if ( ! iframe && astraColors.ast_wp_version_higher_6_4 ) {
let _iframe = document.querySelector('.editor-canvas__iframe') || document.querySelector('.block-editor-iframe__scale-container iframe[name="editor-canvas"]');
editorDocument = _iframe ? _iframe.contentWindow.document : editorDocument;
if (editorDocument) {
titleVisibility = editorDocument.querySelector('.title-visibility');
titleBlock = editorDocument.querySelector('.edit-post-visual-editor__post-title-wrapper');
}
}
}
if( null !== titleBlock && null === titleVisibility ) {
let titleVisibilityTrigger = '<span class="ast-title title-visibility" data-tooltip="Disable Title"> <svg xmlns="http://www.w3.org/2000/svg" width="0px" viewBox="0 0 576 512"><path d="M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"></path></svg> </span>';
if ( 'disabled' === postTitleOption ) {
titleVisibilityTrigger = '<span class="ast-title title-visibility" data-tooltip="Enable Title"> <svg xmlns="http://www.w3.org/2000/svg" width="0px" viewBox="0 0 640 512"><path d="M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"></path></svg> </span>';
}
if ( null === titleVisibility ) {
titleBlock.insertAdjacentHTML( 'beforeend', titleVisibilityTrigger );
}
let titleVisibilityTriggerElement = editorDocument.querySelector( '.title-visibility' ),
titleVisibilityWrapper = editorDocument.querySelector( '.edit-post-visual-editor__post-title-wrapper' );
if (titleVisibilityWrapper) {
if ('disabled' === postTitleOption && !titleVisibilityWrapper.classList.contains('invisible')) {
titleVisibilityWrapper.classList.add('invisible');
} else {
titleVisibilityWrapper.classList.remove('invisible');
}
titleVisibilityTriggerElement.addEventListener("click", function() {
let metaTitleOptions = postTitleOption || '';
if ( this.parentNode.classList.contains( 'invisible' ) && ( 'disabled' === metaTitleOptions || '' === metaTitleOptions ) ) {
this.parentNode.classList.remove( 'invisible' );
this.dataset.tooltip = 'Disable Title';
titleVisibilityTriggerElement.innerHTML = '';
titleVisibilityTriggerElement.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="0px" viewBox="0 0 576 512"><path d="M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"></path></svg>';
wp.data.dispatch( 'core/editor' ).editPost(
{
meta: {
'site-post-title': '',
}
}
);
} else {
this.parentNode.classList.add( 'invisible' );
this.dataset.tooltip = 'Enable Title';
titleVisibilityTriggerElement.innerHTML = '';
titleVisibilityTriggerElement.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="0px" viewBox="0 0 640 512"><path d="M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"></path></svg>';
wp.data.dispatch( 'core/editor' ).editPost(
{
meta: {
'site-post-title': 'disabled',
}
}
);
}
});
}
}
}
function siteLogoImageChange() {
let mobileLogoState = astraColors.mobile_logo_state;
if (!mobileLogoState) {
return;
}
let mobileLogo = astraColors.mobile_logo;
// Added OR condtion to check iframe content from WordPress 6.6 structure.
let iframe = document.querySelector('.editor-canvas__iframe') || document.querySelector('.block-editor-iframe__scale-container iframe[name="editor-canvas"]');
if (iframe) {
let is_desktop = iframe.contentWindow.document.querySelector(
".is-desktop-preview"
);
if (!is_desktop) {
let iframeDoc =
iframe.contentDocument || iframe.contentWindow.document;
let logoElement = iframeDoc.querySelector(".custom-logo");
if (logoElement) {
// Updating logo in the editor iframe preview with the mobile logo.
logoElement.setAttribute("src", mobileLogo);
}
}
}
}
function astra_onload_function() {
/* Do things after DOM has fully loaded */
var astraMetaBox = document.querySelector( '#astra_settings_meta_box' );
if( astraMetaBox != null ){
var titleCheckbox = document.getElementById('site-post-title');
if( null === titleCheckbox ) {
titleCheckbox = document.querySelector('.site-post-title input');
}
if( null !== titleCheckbox ) {
titleCheckbox.addEventListener('change',function() {
var titleBlock = document.querySelector('.editor-post-title__block');
if( null !== titleBlock ) {
if( titleCheckbox.checked ){
titleBlock.style.opacity = '0.2';
} else {
titleBlock.style.opacity = '1.0';
}
}
});
}
}
wp.data.subscribe(function () {
setTimeout( function () {
// Title visibility with new editor compatibility update.
var titleBlock = document.querySelector( '.edit-post-visual-editor__post-title-wrapper' ),
editorDocument = document;
// Excuting responsive site logo change function.
siteLogoImageChange();
// Adding title visibility icon on wp.data.subscribe.
addTitleVisibility();
// Block editor dynamic style function.
blockEditorDynamicStyles();
if ( astraColors.ast_wp_version_higher_6_3 ) {
let desktopPreview = document.getElementsByClassName('is-desktop-preview'),
tabletPreview = document.getElementsByClassName('is-tablet-preview'),
mobilePreview = document.getElementsByClassName('is-mobile-preview'),
devicePreview = desktopPreview[0];
if ( tabletPreview.length > 0 ) {
devicePreview = tabletPreview[0];
} else if ( mobilePreview.length > 0 ) {
devicePreview = mobilePreview[0];
}
let iframe = undefined !== devicePreview ? devicePreview.getElementsByTagName('iframe')[0] : undefined;
if ( iframe && devicePreview.querySelector('iframe') !== null ) {
editorDocument = iframe.contentWindow.document || iframe.contentDocument;
}
// Addressed the WordPress 6.5 issue involving an extraneous iframe layer.
if ( ! iframe && astraColors.ast_wp_version_higher_6_4 ) {
const _iframe = document.querySelector('.editor-canvas__iframe') || document.querySelector('.block-editor-iframe__scale-container iframe[name="editor-canvas"]');
if ( !! _iframe ){
editorDocument = _iframe.contentWindow.document ;
}
}
titleBlock = editorDocument.querySelector( '.edit-post-visual-editor__post-title-wrapper' );
}
// Compatibility for updating layout in editor with direct reflection.
const contentLayout = ( undefined !== wp.data.select( 'core/editor' ) && null !== wp.data.select( 'core/editor' ) && undefined !== wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' ) && wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['ast-site-content-layout'] ) ? wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['ast-site-content-layout'] : 'default',
bodyClass = document.querySelector('body');
editorBodyClass = astraColors.ast_wp_version_higher_6_3 ? editorDocument.querySelector('html') : false;
const contentStyle = ( undefined !== wp.data.select( 'core/editor' ) && null !== wp.data.select( 'core/editor' ) && undefined !== wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' ) && wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-content-style'] ) ? wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-content-style'] : 'default';
const sidebarStyle = ( undefined !== wp.data.select( 'core/editor' ) && null !== wp.data.select( 'core/editor' ) && undefined !== wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' ) && wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-sidebar-style'] ) ? wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-sidebar-style'] : 'default';
const sidebarLayout = ( undefined !== wp.data.select( 'core/editor' ) && null !== wp.data.select( 'core/editor' ) && undefined !== wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' ) && wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-sidebar-layout'] ) ? wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-sidebar-layout'] : 'default';
const applyContainerLayoutClasses = (layout) => {
switch (layout) {
case "plain-container":
bodyClass.classList.add("ast-plain-container");
bodyClass.classList.remove(
"ast-two-container",
"ast-page-builder-template",
"ast-separate-container",
"ast-narrow-container"
);
if ( editorBodyClass ) {
editorBodyClass.classList.add("ast-plain-container");
editorBodyClass.classList.remove(
"ast-two-container",
"ast-page-builder-template",
"ast-separate-container",
"ast-narrow-container"
);
}
break;
case "content-boxed-container":
bodyClass.classList.add("ast-separate-container");
bodyClass.classList.remove(
"ast-two-container",
"ast-page-builder-template",
"ast-plain-container",
"ast-narrow-container"
);
if ( editorBodyClass ) {
editorBodyClass.classList.add("ast-separate-container");
editorBodyClass.classList.remove(
"ast-two-container",
"ast-page-builder-template",
"ast-plain-container",
"ast-narrow-container"
);
}
break;
case "boxed-container":
bodyClass.classList.add(
"ast-separate-container",
"ast-two-container"
);
bodyClass.classList.remove(
"ast-page-builder-template",
"ast-plain-container",
"ast-narrow-container"
);
if ( editorBodyClass ) {
editorBodyClass.classList.add(
"ast-separate-container",
"ast-two-container"
);
editorBodyClass.classList.remove(
"ast-page-builder-template",
"ast-plain-container",
"ast-narrow-container"
);
}
break;
case "page-builder-template":
bodyClass.classList.add("ast-page-builder-template");
bodyClass.classList.remove(
"ast-two-container",
"ast-plain-container",
"ast-separate-container",
"ast-narrow-container"
);
if ( editorBodyClass ) {
editorBodyClass.classList.add("ast-page-builder-template");
editorBodyClass.classList.remove(
"ast-two-container",
"ast-plain-container",
"ast-separate-container",
"ast-narrow-container"
);
}
break;
case "narrow-container":
bodyClass.classList.add("ast-narrow-container");
bodyClass.classList.remove(
"ast-two-container",
"ast-plain-container",
"ast-separate-container",
"ast-page-builder-template"
);
if ( editorBodyClass ) {
editorBodyClass.classList.add("ast-narrow-container");
editorBodyClass.classList.remove(
"ast-two-container",
"ast-plain-container",
"ast-separate-container",
"ast-page-builder-template"
);
}
break;
default:
break;
}
};
switch( contentLayout ) {
case 'normal-width-container':
applyContainerLayoutClasses( 'plain-container' );
break;
case 'narrow-width-container':
applyContainerLayoutClasses( 'narrow-container' );
break;
case 'full-width-container':
applyContainerLayoutClasses( 'page-builder-template' );
break;
case 'default':
if( bodyClass && bodyClass.classList.contains( 'ast-default-layout-boxed-container' ) ) {
applyContainerLayoutClasses( 'boxed-container' );
} else if( bodyClass && bodyClass.classList.contains( 'ast-default-layout-content-boxed-container' ) ) {
applyContainerLayoutClasses( 'content-boxed-container' );
} else if( bodyClass && bodyClass.classList.contains( 'ast-default-layout-page-builder' ) ) {
applyContainerLayoutClasses( 'page-builder-template' );
} else if( bodyClass && bodyClass.classList.contains( 'ast-default-layout-plain-container' ) ) {
applyContainerLayoutClasses( 'plain-container' );
} else if( bodyClass && bodyClass.classList.contains( 'ast-default-layout-narrow-container' ) ) {
applyContainerLayoutClasses( 'narrow-container' );
}
break;
}
const is_default_boxed = bodyClass && bodyClass.classList.contains( 'ast-default-layout-boxed-container' ) ? true : false;
const is_default_content_boxed = bodyClass && bodyClass.classList.contains( 'ast-default-layout-content-boxed-container' ) ? true : false;
const is_default_normal = bodyClass && bodyClass.classList.contains( 'ast-default-layout-plain-container' ) ? true : false;
const is_default_normal_width = ( 'default' === contentLayout && ( is_default_boxed || is_default_content_boxed || is_default_normal ) );
const is_content_style_boxed = bodyClass && bodyClass.classList.contains( 'ast-default-content-style-boxed' ) ? true : false;
const is_sidebar_style_boxed = bodyClass && bodyClass.classList.contains( 'ast-default-sidebar-boxed' ) ? true : false;
if ( 'normal-width-container' === contentLayout || is_default_normal_width ) {
switch ( contentStyle ) {
case 'boxed':
applyContainerLayoutClasses( 'boxed-container' );
break;
case 'unboxed':
applyContainerLayoutClasses( 'plain-container' );
break;
default:
if ( is_content_style_boxed ) {
applyContainerLayoutClasses( 'boxed-container' );
}
break;
}
const is_sidebar_default_enabled = 'default' === sidebarLayout && ( ! bodyClass.classList.contains( 'ast-sidebar-default-no-sidebar' ) );
if( ( 'default' !== sidebarLayout && 'no-sidebar' !== sidebarLayout || is_sidebar_default_enabled ) ) {
switch ( sidebarStyle ) {
case 'boxed':
applyContainerLayoutClasses( 'boxed-container' );
break;
case 'unboxed':
applyContainerLayoutClasses( 'content-boxed-container' );
if ( 'unboxed' === contentStyle || 'default' === contentStyle && ! is_content_style_boxed ) {
applyContainerLayoutClasses( 'plain-container' );
}
break;
default:
if (
( 'unboxed' === contentStyle && ! is_sidebar_style_boxed ) ||
( 'default' === contentStyle && ! is_sidebar_style_boxed && ! is_content_style_boxed )
) {
applyContainerLayoutClasses( 'plain-container' );
}
else if ( is_sidebar_style_boxed ) {
applyContainerLayoutClasses( 'boxed-container' );
}
else if ( ! is_sidebar_style_boxed ) {
applyContainerLayoutClasses( 'content-boxed-container' );
}
break;
}
}
}
// Narrow + Boxed compatibility in editor.
if ( 'narrow-width-container' === contentLayout && ( 'boxed' === contentStyle || 'default' === contentStyle && is_content_style_boxed ) ) {
let editorArea = document.querySelector('.edit-post-visual-editor__content-area');
if ( ! editorArea ) {
editorArea = document.querySelector('.edit-post-visual-editor');
}
if ( editorArea ) {
editorArea.style.padding = '20px';
}
}
else {
let editorArea = document.querySelector('.edit-post-visual-editor__content-area');
if ( ! editorArea ) {
editorArea = document.querySelector('.edit-post-visual-editor');
}
if ( editorArea ) {
editorArea.style.padding = '0px';
}
}
// Container unboxed + sidebar boxed case.
let isUnboxedContainer = false;
const is_sidebar_default_enabled = 'default' === sidebarLayout && ( ! bodyClass.classList.contains( 'ast-sidebar-default-no-sidebar' ) );
if ( ( 'normal-width-container' === contentLayout || is_default_normal_width ) ) {
if ( is_sidebar_default_enabled || 'no-sidebar' !== sidebarLayout && 'default' !== sidebarLayout ) {
if ( 'default' === contentStyle && ! is_content_style_boxed || 'unboxed' === contentStyle ) {
if ( 'boxed' === sidebarStyle || 'default' === sidebarStyle && is_sidebar_style_boxed ) {
isUnboxedContainer = true;
}
}
}
}
const editorStylesWrapper = editorDocument.querySelector( '.editor-styles-wrapper' );
if( null !== editorStylesWrapper ) {
const editorStylesWrapperWidth = parseInt( editorStylesWrapper.offsetWidth )
if( editorStylesWrapperWidth < 1350 ) {
editorStylesWrapper.classList.remove( 'ast-stacked-title-visibility' );
editorStylesWrapper.classList.add( 'ast-stacked-title-visibility' );
} else {
editorStylesWrapper.classList.remove( 'ast-stacked-title-visibility' );
}
}
/**
* In WP-5.9 block editor comes up with color palette showing color-code canvas, but with theme var() CSS its appearing directly as it is. So updated them on wp.data event.
*/
const customColorPickerButtons = document.querySelectorAll( '.components-color-palette__custom-color-value' );
for ( let btnCount = 0; btnCount < customColorPickerButtons.length; btnCount++ ) {
let colorCode = customColorPickerButtons[btnCount].innerText,
transformedCode = colorCode.toLowerCase();
if ( colorCode.indexOf( 'VAR(--AST-GLOBAL-COLOR' ) > -1 ) {
customColorPickerButtons[btnCount].innerHTML = astraColors[ transformedCode ];
}
}
// Show post/page title wrapper outline & eye icon only when clicked.
const titleInput = editorDocument.querySelector('.editor-post-title__input');
const visibilityIcon = editorDocument.querySelector('.title-visibility');
if( null != titleInput && null != visibilityIcon ) {
if ( ! astraColors.ast_wp_version_higher_6_3 ) {
editorDocument.addEventListener('click', function (event){
if( ! titleBlock.contains( event.target ) ){
visibilityIcon.classList.remove('ast-show-visibility-icon');
titleInput.classList.remove('ast-show-editor-title-outline');
}
});
}
editorDocument.addEventListener('visibilitychange', function (){
visibilityIcon.classList.remove('ast-show-visibility-icon');
titleInput.classList.remove('ast-show-editor-title-outline');
});
titleBlock.addEventListener('focusout', function (){
visibilityIcon.classList.remove('ast-show-visibility-icon');
titleInput.classList.remove('ast-show-editor-title-outline');
});
titleBlock.addEventListener('click', function (){
visibilityIcon.classList.add('ast-show-visibility-icon');
titleInput.classList.add('ast-show-editor-title-outline');
});
titleInput.addEventListener('input', function (){
visibilityIcon.classList.add('ast-show-visibility-icon');
this.classList.add('ast-show-editor-title-outline');
});
}
var responsivePreview = document.querySelectorAll( '.is-tablet-preview, .is-mobile-preview' );
if( responsivePreview.length ) {
document.body.classList.add( 'responsive-enabled' );
} else {
document.body.classList.remove( 'responsive-enabled' );
}
// Adding 'inherit-container-width' width to Group block externally.
let postBlocks = ( undefined !== wp.data.select( 'core/editor' ) && null !== wp.data.select( 'core/editor' ) && undefined !== wp.data.select( 'core/editor' ).getCurrentPost() && undefined !== wp.data.select( 'core/block-editor' ).getBlocks() ) ? wp.data.select( 'core/block-editor' ).getBlocks() : false,
groupBlocks = document.querySelectorAll( '.block-editor-block-list__layout.is-root-container > .wp-block-group' );
if( postBlocks && groupBlocks ) {
for ( let blockNum = 0; blockNum < postBlocks.length; blockNum++ ) {
if( 'core/group' === postBlocks[blockNum].name && undefined !== postBlocks[blockNum].attributes && undefined !== postBlocks[blockNum].attributes.layout && undefined !== postBlocks[blockNum].attributes.layout.inherit ) {
if( undefined === groupBlocks[blockNum] ) {
return;
}
if( ! postBlocks[blockNum].attributes.layout.inherit ) {
groupBlocks[blockNum].classList.remove( 'inherit-container-width' );
}
if( postBlocks[blockNum].attributes.layout.inherit && ! groupBlocks[blockNum].classList.contains( 'inherit-container-width' ) ) {
groupBlocks[blockNum].classList.add( 'inherit-container-width' );
}
}
}
}
// Live reflections for page background setting.
if ( astraColors.is_astra_pro_colors_activated ) {
const backgroundToggle = (undefined !== wp.data.select('core/editor') &&
null !== wp.data.select('core/editor') &&
undefined !== wp.data.select('core/editor').getEditedPostAttribute('meta') &&
wp.data.select('core/editor').getEditedPostAttribute('meta')['ast-page-background-enabled'])
? wp.data.select('core/editor').getEditedPostAttribute('meta')['ast-page-background-enabled']
: 'default';
if ( 'enabled' === backgroundToggle ) {
if ( isUnboxedContainer ) {
updatePageBackground( false, isUnboxedContainer );
}
else {
updatePageBackground();
}
}
else if ( 'default' === backgroundToggle ) {
updatePageBackground( true );
}
}
}, 1 );
});
// Redirect to Site Builder on click of "View Posts" Icon if Site Builder layout.
if ( document && document.body ) {
const isSiteBuilderLayout = document.body.classList.contains( 'post-type-astra-advanced-hook' );
if ( isSiteBuilderLayout ) {
const viewPostsIcon = document.querySelector( '#editor .interface-navigable-region .edit-post-header > div a.components-button.edit-post-fullscreen-mode-close' );
if ( viewPostsIcon ) {
viewPostsIcon.addEventListener( 'click', function(e) {
e.preventDefault();
window.location.href = astraColors.site_builder_url;
});
}
}
}
}
/*
* Updates the page background css from the color picker.
*/
const updatePageBackground = ( apply_customizer_default = false, isUnboxedContainer = false ) => {
// Document as per wp version.
let editorDoc = document;
let _iframe = document.querySelector("#editor iframe.editor-canvas__iframe") || document.querySelector('.block-editor-iframe__scale-container iframe[name="editor-canvas"]');
if (_iframe && astraColors.ast_wp_version_higher_6_4) {
editorDoc = _iframe.contentWindow.document;
}
let desktopPreview = editorDoc.getElementsByClassName('is-desktop-preview'),
tabletPreview = editorDoc.getElementsByClassName('is-tablet-preview'),
mobilePreview = editorDoc.getElementsByClassName('is-mobile-preview'),
devicePreview = desktopPreview[0];
if ( astraColors.ast_wp_version_higher_6_3 ) {
if ( tabletPreview.length > 0 ) {
devicePreview = tabletPreview[0];
} else if ( mobilePreview.length > 0 ) {
devicePreview = mobilePreview[0];
}
let iframe = undefined !== devicePreview ? devicePreview.getElementsByTagName('iframe')[0] : undefined;
if ( iframe && devicePreview.querySelector('iframe') !== null ) {
editorDoc = iframe.contentWindow.document || iframe.contentDocument;
}
}
if ( apply_customizer_default ) {
if ( document ) {
const pageBgWrapper = document.querySelector('#editor .edit-post-visual-editor');
if ( pageBgWrapper ) {
pageBgWrapper.style['background-color'] = '';
pageBgWrapper.style['background-image'] = '';
pageBgWrapper.style['background-size'] = '';
pageBgWrapper.style['background-position'] = '';
pageBgWrapper.style['background-repeat'] = '';
pageBgWrapper.style['background-attachment'] = '';
}
}
if ( editorDoc ) {
const contentBgWrapper = editorDoc.querySelector('.editor-styles-wrapper');
if ( contentBgWrapper ) {
contentBgWrapper.style['background-color'] = '';
contentBgWrapper.style['background-image'] = '';
contentBgWrapper.style['background-size'] = '';
contentBgWrapper.style['background-position'] = '';
contentBgWrapper.style['background-repeat'] = '';
contentBgWrapper.style['background-attachment'] = '';
}
}
return;
}
let bgObj = (undefined !== wp.data.select('core/editor') &&
null !== wp.data.select('core/editor') &&
undefined !== wp.data.select('core/editor').getEditedPostAttribute('meta') &&
wp.data.select('core/editor').getEditedPostAttribute('meta')['ast-page-background-meta'])
? wp.data.select('core/editor').getEditedPostAttribute('meta')['ast-page-background-meta']
: 'default';
let contentObj = (undefined !== wp.data.select('core/editor') &&
null !== wp.data.select('core/editor') &&
undefined !== wp.data.select('core/editor').getEditedPostAttribute('meta') &&
wp.data.select('core/editor').getEditedPostAttribute('meta')['ast-content-background-meta'])
? wp.data.select('core/editor').getEditedPostAttribute('meta')['ast-content-background-meta']
: 'default';
if ( desktopPreview.length > 0 ) {
// Get the background object css values and update page background.
const desktopCSS = astraGetResponsiveBackgroundObj(bgObj, 'desktop');
applyStylesToElement('#editor .edit-post-visual-editor', desktopCSS, document );
// Check current layout.
is_boxed_based_layout = false;
if ( document && document.querySelector('body') ) {
is_boxed_based_layout = document.querySelector('body').classList.contains('ast-separate-container');
}
if ( astraColors.apply_content_bg_fullwidth && ( ! is_boxed_based_layout ) ) {
/** Fullwidth with Content Bg */
// Get the background object css values and update page content background.
const desktopContentCSS = astraGetResponsiveBackgroundObj(contentObj, 'desktop');
applyStylesToElement('.editor-styles-wrapper', desktopContentCSS, editorDoc );
}
else if ( ! astraColors.apply_content_bg_fullwidth && ( ! is_boxed_based_layout ) ) {
/** Fullwidth with Page Bg */
// Get the background object css values and update page background.
const desktopCSS = astraGetResponsiveBackgroundObj(bgObj, 'desktop');
applyStylesToElement('.editor-styles-wrapper', desktopCSS, document );
}
else if ( is_boxed_based_layout ) {
/** Boxed Layouts with Content Bg & Page Bg */
// Get the background object css values and update page background.
const desktopCSS = astraGetResponsiveBackgroundObj(bgObj, 'desktop');
applyStylesToElement('#editor .edit-post-visual-editor', desktopCSS, document );
// Get the background object css values and update page content background.
const desktopContentCSS = astraGetResponsiveBackgroundObj(contentObj, 'desktop');
applyStylesToElement('.editor-styles-wrapper', desktopContentCSS, editorDoc );
}
if ( isUnboxedContainer ) {
// Container unboxed + sidebar boxed -> update page content background to site background.
applyStylesToElement('.editor-styles-wrapper', desktopCSS, editorDoc );
}
}
else if ( tabletPreview.length > 0 ) {
// Check current layout.
is_boxed_based_layout = false;
if ( document && document.querySelector('body') ) {
is_boxed_based_layout = document.querySelector('body').classList.contains('ast-separate-container');
}
if ( astraColors.apply_content_bg_fullwidth && ( ! is_boxed_based_layout ) ) {
/** Fullwidth with Content Bg */
// Get the background object css values and update page content background.
const tabletContentCSS = astraGetResponsiveBackgroundObj(contentObj, 'tablet');
applyStylesToElement('.editor-styles-wrapper', tabletContentCSS, editorDoc );
// Set page background to black to indicate that page background not applicable.
applyStylesToElement('#editor .edit-post-visual-editor', {'background-color' : '#363636'}, document );
}
else if ( ! astraColors.apply_content_bg_fullwidth && ( ! is_boxed_based_layout ) ) {
/** Fullwidth with Page Bg */
// Get the background object css values and update page background.
const tabletCSS = astraGetResponsiveBackgroundObj(bgObj, 'tablet');
applyStylesToElement('.editor-styles-wrapper', tabletCSS, document );
}
else if ( is_boxed_based_layout ) {
/** Boxed Layouts with Content Bg & Page Bg */
// Get the background object css values and update page background.
const tabletCSS = astraGetResponsiveBackgroundObj(bgObj, 'tablet');
applyStylesToElement('#editor .edit-post-visual-editor', tabletCSS, document );
// Get the background object css values and update page content background.
const tabletContentCSS = astraGetResponsiveBackgroundObj(contentObj, 'tablet');
applyStylesToElement('.editor-styles-wrapper', tabletContentCSS, editorDoc );
}
}
else if ( mobilePreview.length > 0 ) {
// Check current layout.
is_boxed_based_layout = false;
if ( document && document.querySelector('body') ) {
is_boxed_based_layout = document.querySelector('body').classList.contains('ast-separate-container');
}
if ( astraColors.apply_content_bg_fullwidth && ( ! is_boxed_based_layout ) ) {
/** Fullwidth with Content Bg */
// Get the background object css values and update page content background.
const mobileContentCSS = astraGetResponsiveBackgroundObj(contentObj, 'mobile');
applyStylesToElement('.editor-styles-wrapper', mobileContentCSS, editorDoc );
// Set page background to black to indicate that page background not applicable.
applyStylesToElement('#editor .edit-post-visual-editor', {'background-color' : '#363636'}, document );
}
else if ( ! astraColors.apply_content_bg_fullwidth && ( ! is_boxed_based_layout ) ) {
/** Fullwidth with Page Bg */
// Get the background object css values and update page background.
const mobileCSS = astraGetResponsiveBackgroundObj(bgObj, 'mobile');
applyStylesToElement('.editor-styles-wrapper', mobileCSS, document );
}
else if ( is_boxed_based_layout ) {
/** Boxed Layouts with Content Bg & Page Bg */
// Get the background object css values and update page background.
const mobileCSS = astraGetResponsiveBackgroundObj(bgObj, 'mobile');
applyStylesToElement('#editor .edit-post-visual-editor', mobileCSS, document );
// Get the background object css values and update page content background.
const mobileContentCSS = astraGetResponsiveBackgroundObj(contentObj, 'mobile');
applyStylesToElement('.editor-styles-wrapper', mobileContentCSS, editorDoc );
}
}
}
/*
* Dynamically applies styles to DOM element.
*/
function applyStylesToElement( selector, styles, docObj ) {
if ( docObj ) {
const element = docObj.querySelector(selector);
if (element) {
// Remove any prior cache values if set already.
element.style.backgroundImage = 'none';
Object.keys(styles).forEach((property) => {
element.style[property] = styles[property];
});
} else {
console.error(`Element with selector "${selector}" not found.`);
}
}
}
/*
* Generate Responsive Background Color CSS.
*/
function astraGetResponsiveBackgroundObj(bgObjRes, device) {
const genBgCss = {};
const bgObj = bgObjRes[device];
const bgImg = bgObj['background-image'] || '';
const bgTabImg = bgObjRes['tablet']['background-image'] || '';
const bgDeskImg = bgObjRes['desktop']['background-image'] || '';
const bgColor = bgObj['background-color'] || '';
const tabletCss = bgObjRes['tablet']['background-image'] ? true : false;
const desktopCss = bgObjRes['desktop']['background-image'] ? true : false;
const bgType = bgObj['background-type'] || '';
if ('' !== bgType) {
switch (bgType) {
case 'color':
if ('' !== bgImg && '' !== bgColor) {
genBgCss['background-image'] = `linear-gradient(to right, ${bgColor}, ${bgColor}), url(${bgImg})`;
} else if ('mobile' === device) {
if (desktopCss) {
genBgCss['background-image'] = `linear-gradient(to right, ${bgColor}, ${bgColor}), url(${bgDeskImg})`;
} else if (tabletCss) {
genBgCss['background-image'] = `linear-gradient(to right, ${bgColor}, ${bgColor}), url(${bgTabImg})`;
} else {
if ('' !== bgColor) {
genBgCss['background-color'] = bgColor;
genBgCss['background-image'] = 'none';
}
}
} else if ('tablet' === device) {
if (desktopCss) {
genBgCss['background-image'] = `linear-gradient(to right, ${bgColor}, ${bgColor}), url(${bgDeskImg})`;
} else {
if ('' !== bgColor) {
genBgCss['background-color'] = bgColor;
genBgCss['background-image'] = 'none';
}
}
} else if ('' === bgImg) {
genBgCss['background-color'] = bgColor;
genBgCss['background-image'] = 'none';
}
break;
case 'image':
const overlayType = bgObj['overlay-type'] || 'none';
const overlayColor = bgObj['overlay-color'] || '';
const overlayGrad = bgObj['overlay-gradient'] || '';
if ('' !== bgImg) {
if ('none' !== overlayType) {
if ('classic' === overlayType && '' !== overlayColor) {
genBgCss['background-image'] = `linear-gradient(to right, ${overlayColor}, ${overlayColor}), url(${bgImg})`;
} else if ('gradient' === overlayType && '' !== overlayGrad) {
genBgCss['background-image'] = `${overlayGrad}, url(${bgImg})`;
} else {
genBgCss['background-image'] = `url(${bgImg})`;
}
} else {
genBgCss['background-image'] = `url(${bgImg})`;
}
}
break;
case 'gradient':
if (bgColor) {
genBgCss['background-image'] = bgColor;
}
break;
default:
break;
}
} else if ('' !== bgColor) {
genBgCss['background-color'] = bgColor;
}
if ('' !== bgImg) {
if (bgObj['background-repeat']) {
genBgCss['background-repeat'] = bgObj['background-repeat'];
}
if (bgObj['background-position']) {
genBgCss['background-position'] = bgObj['background-position'];
}
if (bgObj['background-size']) {
genBgCss['background-size'] = bgObj['background-size'];
}
if (bgObj['background-attachment']) {
genBgCss['background-attachment'] = bgObj['background-attachment'];
}
}
return genBgCss;
}
document.body.addEventListener('mousedown', function () {
var blockCssMode = document.querySelector('body').classList.contains('ast-block-legacy')
var fontCss = document.getElementById('astra-google-fonts-css');
if( true === blockCssMode ){
var blockCss = document.getElementById('astra-block-editor-styles-css');
var inlineCss = document.getElementById('astra-block-editor-styles-inline-css');
} else {
var blockCss = document.getElementById('astra-wp-editor-styles-css');
var inlineCss = document.getElementById('astra-wp-editor-styles-inline-css');
}
var blockFixCss = null !== blockCss ? blockCss.cloneNode(true) : null;
var blockInlineCss = null !== inlineCss ? inlineCss.cloneNode(true) : null;
var blockfontCss = null !== fontCss ? fontCss.cloneNode(true) : null;
setTimeout( function() {
let tabletPreview = document.getElementsByClassName('is-tablet-preview');
let mobilePreview = document.getElementsByClassName('is-mobile-preview');
if (0 !== tabletPreview.length || 0 !== mobilePreview.length) {
var googleFontId = 'astra-google-fonts-css';
if( true === blockCssMode ){
var styleTagId = 'astra-block-editor-styles-inline-css';
var styleTagBlockId = 'astra-block-editor-styles-css';
} else {
var styleTagId = 'astra-wp-editor-styles-inline-css';
var styleTagBlockId = 'astra-wp-editor-styles-css';
}
var styleTagId = 'astra-block-editor-styles-inline-css';
var styleTagBlockId = 'astra-block-editor-styles-css';
googleFontId = 'astra-google-fonts-css';
let preview = tabletPreview[0] || mobilePreview[0];
let iframe = preview.getElementsByTagName('iframe')[0];
let iframeDocument = iframe.contentWindow.document || iframe.contentDocument;
let element = iframeDocument.getElementById(
styleTagId
);
let elementBlock = iframeDocument.getElementById(
styleTagBlockId
);
let elementGoogleFont = iframeDocument.getElementById(
googleFontId
);
if ( (null === element || undefined === element)) {
iframeDocument.head.appendChild( blockInlineCss );
}
if ( (null === elementBlock || undefined === elementBlock )) {
iframeDocument.head.appendChild( blockFixCss );
}
if ( (null === elementGoogleFont || undefined === elementGoogleFont ) && null !== fontCss) {
iframeDocument.head.appendChild( blockfontCss );
}
}
}, 1000);
});

View File

@@ -0,0 +1,80 @@
const updatingBlock = ['core/group'];
wp.hooks.addFilter(
'blocks.registerBlockType',
'astra/meta/groupLayoutSettings',
(settings, name) => {
if (!updatingBlock.includes(name)) {
return settings;
}
const newSettings = {
...settings,
supports: {
...(settings.supports || {}),
layout: {
...(settings.supports.layout || {}),
allowEditing: true,
allowSwitching: false,
allowInheriting: true,
},
__experimentalLayout: {
...(settings.supports.__experimentalLayout || {}),
allowEditing: true,
allowSwitching: false,
allowInheriting: true,
},
},
};
return newSettings;
},
20
);
// Get the block editor's data module.
const { dispatch } = wp.data;
// Create a function to set the default align attribute
function setWooDefaultAlignments() {
const checkoutBlocks = wp.blocks.getBlockTypes().some(block => block.name === 'woocommerce/checkout');
const cartBlocks = wp.blocks.getBlockTypes().some(block => block.name === 'woocommerce/cart');
if ( checkoutBlocks ) {
const checkoutBlock = wp.data.select('core/block-editor').getBlocks().find(block => block.name === 'woocommerce/checkout');
if (checkoutBlock && checkoutBlock.attributes.align !== 'none') {
const checkoutClientId = checkoutBlock.clientId;
const checkoutLocalStorageKey = 'hasCheckoutBlockInserted';
const checkoutLocalStorageData = JSON.parse(localStorage.getItem(checkoutLocalStorageKey)) || {};
if ( ! checkoutLocalStorageData[checkoutClientId] ) {
const updatedCheckoutAttributes = { ...checkoutBlock.attributes, align: 'none' };
dispatch('core/block-editor').updateBlockAttributes(checkoutClientId, updatedCheckoutAttributes);
checkoutLocalStorageData[checkoutClientId] = true;
localStorage.setItem(checkoutLocalStorageKey, JSON.stringify(checkoutLocalStorageData));
}
}
}
if ( cartBlocks ) {
const cartBlock = wp.data.select('core/block-editor').getBlocks().find(block => block.name === 'woocommerce/cart');
if (cartBlock && cartBlock.attributes.align !== 'none') {
const cartClientId = cartBlock.clientId;
const cartLocalStorageKey = 'hasCartBlockInserted';
const cartLocalStorageData = JSON.parse(localStorage.getItem(cartLocalStorageKey)) || {};
if ( ! cartLocalStorageData[cartClientId] ) {
const updatedCartAttributes = { ...cartBlock.attributes, align: 'none' };
dispatch('core/block-editor').updateBlockAttributes(cartBlock.clientId, updatedCartAttributes);
cartLocalStorageData[cartClientId] = true;
localStorage.setItem(cartLocalStorageKey, JSON.stringify(cartLocalStorageData));
}
}
}
}
// Listen for the first insertion of a WooCommerce block
wp.data.subscribe(() => {
setWooDefaultAlignments();
});

View File

@@ -0,0 +1,30 @@
/**
* custom-fields-priority.js
*
* Provide more preferences to Astra meta setting so wordpress custom field not causing any kind of conflicts.
*
* @package Astra
*/
function removeMetaBoxSection() {
document.getElementById("the-list").remove();
}
function buttonClickEvent() {
[...document.querySelectorAll('.editor-post-publish-button')].forEach(element => element.addEventListener('click', function (event) {
removeMetaBoxSection();
}));
[...document.querySelectorAll('.editor-post-publish-panel__toggle')].forEach(element => element.addEventListener('click', function (event) {
removeMetaBoxSection();
}));
}
function DOMContentLoaded() {
const elementMetaBox = document.getElementById("the-list");
if (elementMetaBox != null) {
setTimeout(buttonClickEvent, 2000);
}
}
document.addEventListener('DOMContentLoaded', DOMContentLoaded, false);

View File

@@ -0,0 +1,323 @@
( function( $, api ) {
var $document = $( document );
wp.customize.bind( 'preview-ready', function() {
var defaultTarget = window.parent === window ? null : window.parent;
$document.on(
'click',
'.site-header-focus-item .item-customizer-focus, .builder-item-focus .edit-row-action',
function(e) {
e.preventDefault();
e.stopPropagation();
var p = $( this ).closest( '.site-header-focus-item' );
var section_id = p.attr( 'data-section' ) || '';
if ( section_id ) {
if ( defaultTarget.wp.customize.section( section_id ) ) {
defaultTarget.wp.customize.section( section_id ).focus();
}
}
}
);
$document.on(
'click',
'.site-footer-focus-item .item-customizer-focus',
function(e) {
e.preventDefault();
e.stopPropagation();
var p = $( this ).closest( '.site-footer-focus-item' );
var section_id = p.attr( 'data-section' ) || '';
if ( section_id ) {
if ( defaultTarget.wp.customize.section( section_id ) ) {
defaultTarget.wp.customize.section( section_id ).focus();
}
}
}
);
$document.on(
'click',
'.customizer-navigate-on-focus',
function(e) {
e.preventDefault();
e.stopPropagation();
const currentElement = $( this ).closest( '.customizer-navigate-on-focus' );
const section_id = currentElement.attr( 'data-section' ) || '';
const type = currentElement.attr( 'data-type' ) ? currentElement.attr( 'data-type' ) : 'section';
if ( section_id && type ) {
if( 'section' === type ) {
if ( defaultTarget.wp.customize.section( section_id ) ) {
defaultTarget.wp.customize.section( section_id ).focus();
}
}
if( 'control' === type ) {
if ( defaultTarget.wp.customize.control( section_id ) ) {
defaultTarget.wp.customize.control( section_id ).focus();
}
}
if( 'panel' === type ) {
if ( defaultTarget.wp.customize.panel( section_id ) ) {
defaultTarget.wp.customize.panel( section_id ).focus();
}
}
}
}
);
$document.on(
'click',
'.ast-quick-tour-item',
function(e) {
e.preventDefault();
e.stopPropagation();
const self = $( this );
const type = self.attr( 'data-type' ) ? self.attr( 'data-type' ) : 'section';
const itemId = self.attr( 'data-name' ) ? self.attr( 'data-name' ) : '';
const context = self.attr( 'data-context' ) ? self.attr( 'data-context' ) : 'general';
const reference = self.attr( 'data-reference' ) ? self.attr( 'data-reference' ) : '';
if ( itemId && type ) {
switch ( type ) {
case 'section':
if ( defaultTarget.wp.customize.section( itemId ) ) {
defaultTarget.wp.customize.section( itemId ).focus();
}
break;
case 'control':
if ( defaultTarget.wp.customize.control( itemId ) ) {
defaultTarget.wp.customize.control( itemId ).focus();
/**
* Specific compatibility to open color palette & typography settings on style guide trigger click.
*
* 1. Color palette
* 2. Typography
*/
if ( reference ) {
switch (itemId) {
case 'astra-color-palettes':
defaultTarget.wp.customize.control( itemId ).container.find( '.components-button.astra-color-icon-indicate.open').click(); // Close all other opened pickers first.
defaultTarget.wp.customize.control( itemId ).container.find( '.' + reference + ' .components-button.astra-color-icon-indicate').click();
break;
case 'astra-settings[ast-headings-font-settings]':
case 'astra-settings[ast-body-font-settings]':
case 'astra-settings[ast-heading-h1-typo]':
case 'astra-settings[ast-heading-h2-typo]':
case 'astra-settings[ast-heading-h3-typo]':
case 'astra-settings[ast-heading-h4-typo]':
case 'astra-settings[ast-heading-h5-typo]':
case 'astra-settings[ast-heading-h6-typo]':
defaultTarget.wp.customize.control( itemId ).container.find( '.ast-adv-toggle-icon.open').click(); // Close all other opened settings group first.
defaultTarget.wp.customize.control( itemId ).container.find( '.' + reference + ' .ast-adv-toggle-icon').click();
break;
default:
break;
}
}
}
break;
case 'panel':
if ( defaultTarget.wp.customize.panel( itemId ) ) {
defaultTarget.wp.customize.panel( itemId ).focus();
}
break;
default:
break;
}
defaultTarget.wp.customize.state('astra-customizer-tab').set( context );
}
}
);
/**
* Ajax quantity input show.
*/
wp.customize( 'astra-settings[woo-header-cart-click-action]', function( setting ) {
setting.bind( function( action ) {
$( document.body ).trigger( 'wc_fragment_refresh' );
} );
} );
/**
* Register partial refresh events at once asynchronously.
*/
wp.customize.preview.bind( 'active', function() {
var partials = $.extend({}, astraCustomizer.dynamic_partial_options), key;
var register_partial = async function () {
for ( const key in partials ) {
wp.customize.selectiveRefresh.partial.add(
new wp.customize.selectiveRefresh.Partial(
key,
_.extend({params: partials[key]}, partials[key])
)
);
await null;
}
}
register_partial();
});
} );
/**
* Inline logo and title css only.
*/
wp.customize( 'astra-settings[logo-title-inline]', function( value ) {
value.bind( function( is_checked ) {
jQuery('#masthead').toggleClass( 'ast-logo-title-inline', is_checked );
jQuery('.ast-sg-logo-section').toggleClass( 'ast-logo-title-inline', is_checked );
} );
} );
} )( jQuery, wp.customize );
// Single Post Content Width
wp.customize( 'astra-settings[blog-single-width]', function( value ) {
value.bind( function( value ) {
var single_post_max_width = wp.customize('astra-settings[blog-single-max-width]').get();
var dynamicStyle = '';
if ( 'custom' === value ) {
dynamicStyle += '.single-post .site-content > .ast-container {';
dynamicStyle += 'max-width: ' + single_post_max_width + 'px;';
dynamicStyle += '} ';
}
else{
wp.customize.preview.send( 'refresh' );
}
astra_add_dynamic_css( 'blog-single-width', dynamicStyle );
} );
} );
// Blog Post Content Width
wp.customize( 'astra-settings[blog-width]', function( value ) {
value.bind( function( value ) {
var blog_max_width = wp.customize('astra-settings[blog-max-width]').get();
var dynamicStyle = '';
if ( 'custom' === value ) {
dynamicStyle += '.blog .site-content > .ast-container, .archive .site-content > .ast-container, .search .site-content > .ast-container {';
dynamicStyle += 'max-width: ' + blog_max_width + 'px;';
dynamicStyle += '} ';
}
else{
wp.customize.preview.send( 'refresh' );
}
astra_add_dynamic_css( 'blog-width', dynamicStyle );
} );
} );
// Blog Post Content Width
wp.customize( 'astra-settings[edd-archive-grids]', function( value ) {
value.bind( function( value ) {
for ( var i = 1; i < 7; i++ ) {
jQuery('body').removeClass( 'columns-' + i );
jQuery('body').removeClass( 'tablet-columns-' + i );
jQuery('body').removeClass( 'mobile-columns-' + i );
}
if ( jQuery('body').hasClass( 'ast-edd-archive-page' ) ) {
jQuery('body').addClass( 'columns-' + value['desktop'] );
jQuery('body').addClass( 'tablet-columns-' + value['tablet'] );
jQuery('body').addClass( 'mobile-columns-' + value['mobile'] );
}
} );
} );
// Blog Post Content Width
wp.customize( 'astra-settings[edd-archive-width]', function( value ) {
value.bind( function( value ) {
var edd_archive_max_width = wp.customize('astra-settings[edd-archive-max-width]').get();
edd_archive_max_width = ( 'custom' === value ) ? edd_archive_max_width : edd_archive_max_width + 40;
var dynamicStyle = '';
dynamicStyle += '.ast-edd-archive-page .site-content > .ast-container {';
dynamicStyle += 'max-width: ' + edd_archive_max_width + 'px;';
dynamicStyle += '} ';
astra_add_dynamic_css( 'edd-archive-width', dynamicStyle );
} );
} );
// WooCommerce store notice color configs.
astra_css( 'astra-settings[store-notice-text-color]', 'color', 'body p.demo_store, body .woocommerce-store-notice, body p.demo_store a, body .woocommerce-store-notice a' );
astra_css( 'astra-settings[store-notice-background-color]', 'background-color', 'body p.demo_store, body .woocommerce-store-notice, body p.demo_store a, body .woocommerce-store-notice a' );
// WooCommerce store notice position preview.
wp.customize( 'astra-settings[store-notice-position]', function( setting ) {
setting.bind( function( position ) {
if( 'hang-over-top' === position ) {
wp.customize.preview.send( 'refresh' );
} else {
jQuery('body').css('margin-top', 0);
jQuery('body').removeClass( 'ast-woocommerce-store-notice-hanged' );
jQuery('.woocommerce-store-notice').attr( 'data-position', position );
}
} );
} );
wp.customize( 'astra-settings[blog-meta-date-type]', function( setting ) {
setting.bind( function( val ) {
wp.customize.preview.send( 'refresh' );
} );
} );
wp.customize( 'astra-settings[blog-meta-date-format]', function( setting ) {
setting.bind( function( val ) {
wp.customize.preview.send( 'refresh' );
} );
} );
astra_refresh_customizer(
'astra-settings[blog-hover-effect]'
);
astra_refresh_customizer(
'astra-settings[blog-image-ratio-type]'
);
astra_refresh_customizer(
'astra-settings[blog-image-size]'
);
astra_refresh_customizer(
'astra-settings[blog-image-ratio-pre-scale]'
);
astra_refresh_customizer(
'astra-settings[blog-image-custom-scale-width]'
);
astra_refresh_customizer(
'astra-settings[blog-image-custom-scale-height]'
);
astra_refresh_customizer(
'astra-settings[blog-post-per-page]'
);

View File

@@ -0,0 +1,752 @@
<?php
/**
* Blog Config File
* Common Functions for Blog and Single Blog
*
* @package Astra
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Prepare markup for taxonomies.
*
* @param string $control_tax Taxonomy subcontrol name.
* @param int $loop_count Meta loop counter to decide separator appearance.
* @param string $separator Separator.
* @param string $badge_style For taxonomies as badge styles.
* @param string $html_tag HTML tag.
*
* @return string $output Taxonomy output.
*/
function astra_get_dynamic_taxonomy( $control_tax, $loop_count, $separator, $badge_style = '', $html_tag = 'p' ) {
$tax_type = astra_get_option( $control_tax );
$post_id = get_the_ID();
if ( ! $post_id ) {
return '';
}
$terms = get_the_terms( $post_id, $tax_type );
/** @psalm-suppress RedundantCondition */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
if ( $terms && ! empty( $terms ) && ! is_wp_error( $terms ) ) {
/** @psalm-suppress RedundantCondition */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$term_links = array();
/** @psalm-suppress PossibleRawObjectIteration */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
foreach ( $terms as $term ) {
/** @psalm-suppress PossibleRawObjectIteration */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$term_link = get_term_link( $term->slug, $tax_type );
// If there was an error, continue to the next term.
if ( is_wp_error( $term_link ) ) {
continue;
}
$tax_badge_selector = '';
if ( '' !== $badge_style ) {
$tax_badge_selector = 'badge' === $badge_style ? 'ast-button ast-badge-tax' : 'ast-underline-text';
}
/** @psalm-suppress PossiblyInvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$term_links[] = '<a href="' . esc_url( $term_link ) . '" class="' . esc_attr( $tax_badge_selector ) . '">' . esc_html( $term->name ) . '</a>';
/** @psalm-suppress PossiblyInvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
}
$join_separator = 'badge' === $badge_style ? ' ' : ', ';
$all_terms = join( $join_separator, $term_links );
$output_str = '<' . esc_attr( $html_tag ) . ' class="ast-terms-link">' . $all_terms . '</' . esc_attr( $html_tag ) . '>';
return ( 1 != $loop_count ) ? ' ' . $separator . ' ' . $output_str : $output_str;
}
return '';
}
/**
* Function to get Author ID.
*
* @since 4.6.0
* @return mixed $author_id Author ID.
*/
function astra_get_author_id() {
global $post;
if ( isset( $post->post_author ) ) {
$author_id = $post->post_author;
} elseif ( is_callable( 'get_the_author_meta' ) ) {
$author_id = get_the_author_meta( 'ID' );
} else {
$author_id = 1;
}
return $author_id;
}
/**
* Function to get Author Avatar.
*
* @since 4.6.0
* @param string $get_for Get for.
* @return mixed $avatar Author Avatar.
*/
function astra_author_avatar( $get_for = 'single-post' ) {
$avatar = '';
if ( is_singular() ) {
if ( 'single-post' === $get_for && astra_get_option( 'ast-dynamic-single-' . strval( get_post_type() ) . '-author-avatar', false ) ) {
$avatar_image_size = astra_get_option( 'ast-dynamic-single-' . strval( get_post_type() ) . '-author-avatar-size', 30 );
$avatar = '<span class="ast-author-avatar">' . strval( get_avatar( astra_get_author_id(), $avatar_image_size ) ) . '</span>';
} elseif ( 'related-post' === $get_for && astra_get_option( 'related-posts-author-avatar', false ) ) {
$avatar_image_size = astra_get_option( 'related-posts-author-avatar-size', 30 );
$avatar = '<span class="ast-author-avatar">' . strval( get_avatar( astra_get_author_id(), $avatar_image_size ) ) . '</span>';
} else {
$avatar = '';
}
}
return $avatar;
}
/**
* Common Functions for Blog and Single Blog
*
* @return post meta
*/
if ( ! function_exists( 'astra_get_post_meta' ) ) {
/**
* Post meta
*
* @param array $post_meta Post meta.
* @param string $separator Separator.
* @param string $render_by Render by Single|Related Posts|Blog.
* @return string post meta markup.
*/
function astra_get_post_meta( $post_meta, $separator = '/', $render_by = '' ) {
$output_str = '';
$loop_count = 1;
if ( is_singular() ) {
if ( 'single-post' === $render_by ) {
$separator = 'none' === astra_get_option( 'ast-dynamic-single-' . strval( get_post_type() ) . '-metadata-separator', '/' ) ? '&nbsp' : astra_get_option( 'ast-dynamic-single-' . strval( get_post_type() ) . '-metadata-separator', '/' );
} elseif ( 'related-posts' === $render_by ) {
$separator = 'none' === $separator ? '&nbsp' : $separator;
}
} else {
$divider_type = astra_get_option( 'blog-post-meta-divider-type' );
if ( 'none' !== $divider_type ) {
$separator = $divider_type;
} else {
$separator = '&nbsp';
}
}
$separator = apply_filters( 'astra_post_meta_separator', $separator );
foreach ( $post_meta as $meta_value ) {
switch ( $meta_value ) {
case 'author':
$output_str .= ( 1 != $loop_count && '' != $output_str ) ? ' ' . $separator . ' ' : '';
/** @psalm-suppress InvalidOperand */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$astra_post_author_html = '' . astra_post_author();
/** @psalm-suppress InvalidOperand */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
if ( is_singular() ) {
if ( 'single-post' === $render_by ) {
$author_prefix_label = astra_get_option( 'ast-dynamic-single-' . strval( get_post_type() ) . '-author-prefix-label', astra_default_strings( 'string-blog-meta-author-by', false ) );
$output_str .= astra_author_avatar() . esc_html( $author_prefix_label ) . $astra_post_author_html;
} elseif ( 'related-posts' === $render_by ) {
$author_prefix_label = astra_get_option( 'related-posts-author-prefix-label', astra_default_strings( 'string-blog-meta-author-by', false ) );
$output_str .= astra_author_avatar( 'related-post' ) . esc_html( $author_prefix_label ) . $astra_post_author_html;
} else {
$output_str .= esc_html( astra_default_strings( 'string-blog-meta-author-by', false ) ) . $astra_post_author_html;
}
} else {
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
if ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'blog-pro' ) ) {
$author_avatar = astra_get_option( 'blog-meta-author-avatar' );
if ( $author_avatar ) {
$get_author_id = get_the_author_meta( 'ID' );
/** @psalm-suppress ArgumentTypeCoercion */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$get_author_gravatar = get_avatar_url( $get_author_id, array( 'size' => astra_get_option( 'blog-meta-author-avatar-size', 25 ) ) );
/** @psalm-suppress PossiblyFalseOperand */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$output_str .= '<img class=' . esc_attr( 'ast-author-image' ) . ' src="' . $get_author_gravatar . '" alt="' . get_the_title() . '" />';
/** @psalm-suppress PossiblyFalseOperand */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
}
}
$output_str .= esc_html( astra_get_option( 'blog-meta-author-avatar-prefix-label' ) ) . $astra_post_author_html;
}
break;
case 'date':
$output_str .= ( 1 != $loop_count && '' != $output_str ) ? ' ' . $separator . ' ' : '';
$get_for = 'related-posts' === $render_by ? 'related-post' : 'single-post';
$output_str .= astra_post_date( $get_for );
break;
case 'category':
$category = astra_post_categories( 'post_categories', 'blog-meta-category-style', false );
if ( '' != $category ) {
$output_str .= ( 1 != $loop_count && '' != $output_str ) ? ' ' . $separator . ' ' : '';
$output_str .= $category;
}
break;
case 'tag':
$tags = astra_post_tags( 'post_tags', 'blog-meta-tag-style', false );
if ( '' != $tags ) {
$output_str .= ( 1 != $loop_count && '' != $output_str ) ? ' ' . $separator . ' ' : '';
$output_str .= $tags;
}
break;
case 'comments':
$comment = astra_post_comments();
if ( '' != $comment ) {
$output_str .= ( 1 != $loop_count && '' != $output_str ) ? ' ' . $separator . ' ' : '';
$output_str .= $comment;
}
break;
default:
$output_str = apply_filters( 'astra_meta_case_' . $meta_value, $output_str, $loop_count, $separator );
}
if ( strpos( $meta_value, '-taxonomy' ) !== false ) {
$output_str .= astra_get_dynamic_taxonomy( $meta_value, $loop_count, $separator, astra_get_option( $meta_value . '-style', '' ), 'span' );
}
$loop_count ++;
}
return $output_str;
}
}
/**
* Get post format as per new configurations set in customizer.
*
* @param string $get_for Get for.
* @return string HTML markup for date span.
* @since 4.1.0
*/
function astra_get_dynamic_post_format( $get_for = 'single-post' ) {
$is_singular = is_singular() ? true : false;
if ( 'related-post' === $get_for ) {
$date_format_option = astra_get_option( 'related-posts-date-format', '' );
$date_type = astra_get_option( 'related-posts-meta-date-type', 'published' );
$date_format = apply_filters( 'astra_related_post_date_format', ( '' === $date_format_option ) ? get_option( 'date_format' ) : $date_format_option );
} else {
$post_type = strval( get_post_type() );
$date_format_option = $is_singular ? astra_get_option( 'ast-dynamic-single-' . esc_attr( $post_type ) . '-date-format', '' ) : astra_get_option( 'blog-meta-date-format', '' );
$date_type = $is_singular ? astra_get_option( 'ast-dynamic-single-' . esc_attr( $post_type ) . '-meta-date-type', 'published' ) : astra_get_option( 'blog-meta-date-type', 'published' );
$date_format = apply_filters( 'astra_post_date_format', ( '' === $date_format_option ) ? get_option( 'date_format' ) : $date_format_option );
}
$published_date = strval( get_the_date( $date_format ) );
$modified_date = strval( get_the_modified_date( $date_format ) );
if ( 'updated' === $date_type ) {
$class = 'updated';
$itemprop = 'dateModified';
$date = sprintf(
esc_html( '%s' ),
$modified_date
);
} else {
$class = 'published';
$itemprop = 'datePublished';
$date = sprintf(
esc_html( '%s' ),
$published_date
);
}
return sprintf( '<span class="%1$s" itemprop="%2$s"> %3$s </span>', $class, $itemprop, $date );
}
/**
* Get category List.
*
* @since 4.6.0
* @param string $filter_name Filter name.
* @param string $style_type_slug Style slug.
* @param bool $post_meta Post meta.
* @return mixed Markup.
*/
function astra_get_category_list( $filter_name, $style_type_slug, $post_meta ) {
$style_type_class = '';
$separator = ', ';
$categories_list = '';
$style_type = astra_get_option( $style_type_slug );
$separator = 'badge' === $style_type ? ' ' : $separator;
$style_type_class = ' ' . $style_type;
/* translators: used between list items, there is a space after the comma */
$get_category_html = get_the_category_list( apply_filters( 'astra_' . $filter_name, $separator ) );
if ( $get_category_html ) {
if ( 'badge' === $style_type ) {
/** @psalm-suppress PossiblyInvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$categories_list = str_replace( '<a', '<a class="ast-button"', $get_category_html );
} else {
$categories_list = $get_category_html;
}
}
$post_tax_class = $post_meta ? 'ast-blog-single-element ' : '';
if ( $categories_list ) {
return '<span class="' . $post_tax_class . 'ast-taxonomy-container cat-links' . $style_type_class . '">' . $categories_list . '</span>';
} else {
return '';
}
}
/**
* Get tag List.
*
* @since 4.6.0
* @param string $filter_name Filter name.
* @param string $style_type_slug style type slug.
* @param bool $post_meta Post meta.
* @return mixed Markup.
*/
function astra_get_tag_list( $filter_name, $style_type_slug, $post_meta ) {
$style_type_class = '';
$separator = ', ';
$tags_list = '';
$style_type = astra_get_option( $style_type_slug );
$separator = 'badge' === $style_type ? ' ' : $separator;
$style_type_class = ' ' . $style_type;
/* translators: used between list items, there is a space after the comma */
$tags_list_html = get_the_tag_list( '', apply_filters( 'astra_' . $filter_name, $separator ) );
if ( $tags_list_html ) {
if ( 'badge' === $style_type ) {
/** @psalm-suppress PossiblyInvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$tags_list = str_replace( '<a', '<a class="ast-button"', $tags_list_html );
} else {
$tags_list = $tags_list_html;
}
}
$post_tax_class = $post_meta ? 'ast-blog-single-element ' : '';
if ( $tags_list ) {
return '<span class="' . $post_tax_class . 'ast-taxonomy-container tags-links' . $style_type_class . '">' . $tags_list . '</span>';
} else {
return '';
}
}
/**
* Function to get Date of Post
*
* @since 1.0.0
* @return html
*/
if ( ! function_exists( 'astra_post_date' ) ) {
/**
* Function to get Date of Post
*
* @param string $get_for Get for single/related post/etc.
* @return string Markup.
*/
function astra_post_date( $get_for = 'single-post' ) {
$output = '';
$output .= '<span class="posted-on">';
$output .= astra_get_dynamic_post_format( $get_for );
$output .= '</span>';
return apply_filters( 'astra_post_date', $output );
}
}
/**
* Function to get Author name.
*
* @return mixed $author_name Author name.
* @since 4.0.0
*/
function astra_post_author_name() {
$author_name = '';
$get_the_author = get_the_author();
if ( empty( $get_the_author ) ) {
/** @psalm-suppress InvalidGlobal */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
global $post;
/** @psalm-suppress InvalidGlobal */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
if ( is_object( $post ) && isset( $post->post_author ) ) {
$user_id = $post->post_author;
/** @psalm-suppress InvalidGlobal */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
global $authordata;
/** @psalm-suppress InvalidGlobal */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$author_data = '';
if ( ! $authordata ) {
$author_data = get_userdata( $user_id );
}
$author_name = esc_attr( ! empty( $author_data ) ? $author_data->display_name : '' );
}
} else {
$author_name = esc_attr( get_the_author() );
}
return $author_name;
}
/**
* Function to get Author of Post
*
* @since 1.0.0
* @return html
*/
if ( ! function_exists( 'astra_post_author' ) ) {
/**
* Function to get Author of Post
*
* @param string $output_filter Filter string.
* @return html Markup.
*/
function astra_post_author( $output_filter = '' ) {
$author_id = astra_get_author_id();
ob_start();
echo '<span ';
echo wp_kses_post(
astra_attr(
'post-meta-author',
array(
'class' => 'posted-by author',
)
)
);
echo '>';
// Translators: Author Name. ?>
<a title="<?php printf( esc_attr__( 'View all posts by %1$s', 'astra' ), esc_attr( strval( get_the_author() ) ) ); ?>"
href="<?php echo esc_url( get_author_posts_url( $author_id ) ); ?>" rel="author"
<?php
echo wp_kses_post(
astra_attr(
'author-url',
array(
'class' => 'url fn n',
)
)
);
?>
>
<span
<?php
echo wp_kses_post(
astra_attr(
'author-name',
array(
'class' => 'author-name',
)
)
);
?>
>
<?php
/** @psalm-suppress PossiblyNullArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
echo wp_kses_post( astra_post_author_name() );
?>
</span>
</a>
</span>
<?php
$output = ob_get_clean();
return apply_filters( 'astra_post_author', $output, $output_filter );
}
}
/**
* Function to get Read More Link of Post
*
* @since 1.0.0
* @return html
*/
if ( ! function_exists( 'astra_post_link' ) ) {
/**
* Function to get Read More Link of Post
*
* @param string $output_filter Filter string.
* @return html Markup.
*/
function astra_post_link( $output_filter = '' ) {
$enabled = apply_filters( 'astra_post_link_enabled', '__return_true' );
if ( ( is_admin() && ! wp_doing_ajax() ) || ! $enabled ) {
return $output_filter;
}
$more_label = Astra_Dynamic_CSS::astra_4_6_0_compatibility() ? esc_html__( 'Read Post »', 'astra' ) : esc_html__( 'Read More »', 'astra' );
$read_more_text = apply_filters( 'astra_post_read_more', $more_label );
$read_more_classes = apply_filters( 'astra_post_read_more_class', array() );
$post_link = sprintf(
esc_html( '%s' ),
'<a class="' . esc_attr( implode( ' ', $read_more_classes ) ) . '" href="' . esc_url( get_permalink() ) . '"> ' . the_title( '<span class="screen-reader-text">', '</span>', false ) . ' ' . $read_more_text . '</a>'
);
$output = '<p class="ast-blog-single-element ast-read-more-container read-more"> ' . $post_link . '</p>';
echo wp_kses_post( apply_filters( 'astra_post_link', $output, $output_filter ) );
}
}
/**
* Function to get Number of Comments of Post
*
* @since 1.0.0
* @return html
*/
if ( ! function_exists( 'astra_post_comments' ) ) {
/**
* Function to get Number of Comments of Post
*
* @param string $output_filter Output filter.
* @return html Markup.
*/
function astra_post_comments( $output_filter = '' ) {
$output = '';
ob_start();
if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
?>
<span class="comments-link">
<?php
/**
* Get Comment Link
*
* @see astra_default_strings()
*/
comments_popup_link( astra_default_strings( 'string-blog-meta-leave-a-comment', false ), astra_default_strings( 'string-blog-meta-one-comment', false ), astra_default_strings( 'string-blog-meta-multiple-comment', false ) );
?>
</span>
<?php
}
$output = ob_get_clean();
return apply_filters( 'astra_post_comments', $output, $output_filter );
}
}
/**
* Function to get Tags applied of Post
*
* @since 1.0.0
* @return mixed
*/
if ( ! function_exists( 'astra_post_tags' ) ) {
/**
* Function to get Tags applied of Post
*
* @param string $filter_name Filter name.
* @param string $style_type Style type slug.
* @param bool $post_meta Post meta.
* @return mixed Markup.
*/
function astra_post_tags( $filter_name, $style_type, $post_meta ) {
return apply_filters( 'astra_' . $filter_name, astra_get_tag_list( $filter_name . '_separator', $style_type, $post_meta ) );
}
}
/**
* Function to get Categories of Post
*
* @since 1.0.0
* @return mixed
*/
if ( ! function_exists( 'astra_post_categories' ) ) {
/**
* Function to get Categories applied of Post
*
* @param string $filter_name Filter name.
* @param string $style_type Style type slug.
* @param bool $post_meta Post meta.
* @return mixed Markup.
*/
function astra_post_categories( $filter_name, $style_type, $post_meta ) {
return apply_filters( 'astra_' . $filter_name, astra_get_category_list( $filter_name . '_separator', $style_type, $post_meta ) );
}
}
/**
* Display classes for primary div
*
* @since 1.0.0
*/
if ( ! function_exists( 'astra_blog_layout_class' ) ) {
/**
* Layout class
*
* @param string $class Class.
*/
function astra_blog_layout_class( $class = '' ) {
// Separates classes with a single space, collates classes for body element.
echo 'class="' . esc_attr( join( ' ', astra_get_blog_layout_class( $class ) ) ) . '"';
}
}
/**
* Retrieve the classes for the body element as an array.
*
* @since 1.0.0
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
if ( ! function_exists( 'astra_get_blog_layout_class' ) ) {
/**
* Retrieve the classes for the body element as an array.
*
* @param string $class Class.
*/
function astra_get_blog_layout_class( $class = '' ) {
// array of class names.
$classes = array();
$post_format = get_post_format();
if ( $post_format ) {
$post_format = 'standard';
}
$classes[] = 'ast-post-format-' . $post_format;
if ( ! has_post_thumbnail() || ! wp_get_attachment_image_src( get_post_thumbnail_id() ) ) {
switch ( $post_format ) {
case 'aside':
$classes[] = 'ast-no-thumb';
break;
case 'image':
$has_image = astra_get_first_image_from_post();
if ( empty( $has_image ) || is_single() ) {
$classes[] = 'ast-no-thumb';
}
break;
case 'video':
$post_featured_data = astra_get_video_from_post( get_the_ID() );
if ( empty( $post_featured_data ) ) {
$classes[] = 'ast-no-thumb';
}
break;
case 'quote':
$classes[] = 'ast-no-thumb';
break;
case 'link':
$classes[] = 'ast-no-thumb';
break;
case 'gallery':
$post_featured_data = get_post_gallery();
if ( empty( $post_featured_data ) || is_single() ) {
$classes[] = 'ast-no-thumb';
}
break;
case 'audio':
$has_audio = astra_get_audios_from_post( get_the_ID() );
if ( empty( $has_audio ) || is_single() ) {
$classes[] = 'ast-no-thumb';
} else {
$classes[] = 'ast-embeded-audio';
}
break;
case 'standard':
default:
if ( ! has_post_thumbnail() || ! wp_get_attachment_image_src( get_post_thumbnail_id() ) ) {
$classes[] = 'ast-no-thumb';
}
break;
}
}
if ( ! in_array( 'ast-no-thumb', $classes ) && ! in_array( 'image', astra_get_option( 'blog-post-structure', array() ) ) ) {
$classes[] = 'ast-no-thumb';
}
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
} else {
// Ensure that we always coerce class to being an array.
$class = array();
}
/**
* Filter primary div class names
*/
$classes = apply_filters( 'astra_blog_layout_class', $classes, $class );
$classes = array_map( 'sanitize_html_class', $classes );
return array_unique( $classes );
}
}
/**
* Function to get Content Read More Link of Post
*
* @since 1.2.7
* @return mixed
*/
if ( ! function_exists( 'astra_the_content_more_link' ) ) {
/**
* Filters the Read More link text.
*
* @param string $more_link_element Read More link element.
* @param string $more_link_text Read More text.
* @return mixed Markup.
*/
function astra_the_content_more_link( $more_link_element = '', $more_link_text = '' ) {
$enabled = apply_filters( 'astra_the_content_more_link_enabled', '__return_true' );
if ( ( is_admin() && ! wp_doing_ajax() ) || ! $enabled ) {
return $more_link_element;
}
$more_link_text = apply_filters( 'astra_the_content_more_string', __( 'Read More &raquo;', 'astra' ) );
$read_more_classes = apply_filters( 'astra_the_content_more_link_class', array() );
$post_link = sprintf(
esc_html( '%s' ),
'<a class="' . esc_attr( implode( ' ', $read_more_classes ) ) . '" href="' . esc_url( get_permalink() ) . '"> ' . the_title( '<span class="screen-reader-text">', '</span>', false ) . $more_link_text . '</a>'
);
$more_link_element = ' &hellip;<p class="ast-the-content-more-link"> ' . $post_link . '</p>';
return apply_filters( 'astra_the_content_more_link', $more_link_element, $more_link_text );
}
}
add_filter( 'the_content_more_link', 'astra_the_content_more_link', 10, 2 );

View File

@@ -0,0 +1,793 @@
<?php
/**
* Blog Helper Functions
*
* @package Astra
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Adds custom classes to the array of body classes.
*/
if ( ! function_exists( 'astra_blog_body_classes' ) ) {
/**
* Adds custom classes to the array of body classes.
*
* @since 1.0
* @param array $classes Classes for the body element.
* @return array
*/
function astra_blog_body_classes( $classes ) {
// Adds a class of group-blog to blogs with more than 1 published author.
if ( is_multi_author() ) {
$classes[] = 'group-blog';
}
return $classes;
}
}
add_filter( 'body_class', 'astra_blog_body_classes' );
/**
* Adds custom classes to the array of post grid classes.
*/
if ( ! function_exists( 'astra_post_class_blog_grid' ) ) {
/**
* Adds custom classes to the array of post grid classes.
*
* @since 1.0
* @param array $classes Classes for the post element.
* @return array
*/
function astra_post_class_blog_grid( $classes ) {
$blog_layout = astra_get_blog_layout();
if ( is_archive() || is_home() || is_search() ) {
$classes[] = astra_attr( 'ast-blog-col' );
$classes[] = 'ast-article-post';
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
if ( ! ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'blog-pro' ) ) ) {
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
if ( 'blog-layout-4' === $blog_layout ) {
$classes[] = 'remove-featured-img-padding';
}
}
}
return $classes;
}
}
add_filter( 'post_class', 'astra_post_class_blog_grid' );
/**
* Add Body Classes
*
* @param array $classes Blog Layout Class Array.
* @since 4.6.0
* @return array
*/
function astra_add_blog_layout_class( $classes ) {
if ( ! is_singular() ) {
$classes[] = 'ast-article-inner';
}
return $classes;
}
add_filter( 'astra_blog_layout_class', 'astra_add_blog_layout_class' );
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
if ( ! function_exists( 'astra_blog_get_post_meta' ) ) {
/**
* Prints HTML with meta information for the current post-date/time and author.
*
* @since 1.0
* @return mixed Markup.
*/
function astra_blog_get_post_meta() {
$enable_meta = apply_filters( 'astra_blog_post_meta_enabled', '__return_true' );
$post_meta = astra_get_option( 'blog-meta' );
$current_post_type = get_post_type();
if ( is_array( $post_meta ) && $enable_meta ) {
$output_str = astra_get_post_meta( $post_meta, '/', 'blog' );
if ( ! empty( $output_str ) ) {
echo apply_filters( 'astra_blog_post_meta', '<div class="entry-meta">' . $output_str . '</div>', $output_str ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
}
}
/**
* Featured post meta.
*/
if ( ! function_exists( 'astra_blog_post_get_featured_item' ) ) {
/**
* To featured image / gallery / audio / video etc. As per the post format.
*
* @since 1.0
* @return mixed
*/
function astra_blog_post_get_featured_item() {
$post_featured_data = '';
$post_format = get_post_format();
if ( has_post_thumbnail() ) {
$post_featured_data = '<a href="' . esc_url( get_permalink() ) . '" >';
$post_featured_data .= get_the_post_thumbnail();
$post_featured_data .= '</a>';
} else {
switch ( $post_format ) {
case 'image':
break;
case 'video':
$post_featured_data = astra_get_video_from_post( get_the_ID() );
break;
case 'gallery':
$post_featured_data = get_post_gallery( get_the_ID(), false );
if ( isset( $post_featured_data['ids'] ) ) {
$img_ids = explode( ',', $post_featured_data['ids'] );
$image_alt = get_post_meta( $img_ids[0], '_wp_attachment_image_alt', true );
$image_url = wp_get_attachment_url( $img_ids[0] );
if ( isset( $img_ids[0] ) ) {
$post_featured_data = '<a href="' . esc_url( get_permalink() ) . '" >';
$post_featured_data .= '<img src="' . esc_url( $image_url ) . '" alt="' . esc_attr( $image_alt ) . '" >';
$post_featured_data .= '</a>';
}
}
break;
case 'audio':
$post_featured_data = do_shortcode( astra_get_audios_from_post( get_the_ID() ) );
break;
}
}
echo $post_featured_data; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
add_action( 'astra_blog_post_featured_format', 'astra_blog_post_get_featured_item' );
/**
* Blog Post Thumbnail / Title & Meta Order
*/
if ( ! function_exists( 'astra_blog_post_thumbnail_and_title_order' ) ) {
/**
* Blog post Thubmnail, Title & Blog Meta order
*
* @since 1.0.8
* @param array $remove_elements Remove unwanted sections.
*/
function astra_blog_post_thumbnail_and_title_order( $remove_elements = array() ) {
$blog_post_thumb_title_order = astra_get_option( 'blog-post-structure' );
$remove_post_element = apply_filters( 'astra_remove_post_elements', $remove_elements );
if ( isset( $blog_post_thumb_title_order ) && isset( $remove_post_element ) ) {
foreach ( $remove_post_element as $single ) {
$key = array_search( $single, $blog_post_thumb_title_order );
if ( ( $key ) !== false ) {
unset( $blog_post_thumb_title_order[ $key ] );
}
}
}
if ( is_singular() ) {
return astra_banner_elements_order();
}
if ( is_array( $blog_post_thumb_title_order ) ) {
// Append the custom class for second element for single post.
foreach ( $blog_post_thumb_title_order as $post_thumb_title_order ) {
switch ( $post_thumb_title_order ) {
// Blog Post Featured Image.
case 'image':
do_action( 'astra_blog_archive_featured_image_before' );
astra_get_blog_post_thumbnail( 'archive' );
do_action( 'astra_blog_archive_featured_image_after' );
break;
// Blog Categories.
case 'category':
do_action( 'astra_blog_archive_category_before' );
// @codingStandardsIgnoreStart
/**
* @psalm-suppress InvalidArgument
* @psalm-suppress TooManyArguments
*/
echo astra_post_categories( 'astra_blog_archive_category', 'blog-category-style', true ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
// @codingStandardsIgnoreEnd
do_action( 'astra_blog_archive_category_after' );
break;
// Blog Tags.
case 'tag':
do_action( 'astra_blog_archive_tag_before' );
// @codingStandardsIgnoreStart
/**
* @psalm-suppress InvalidArgument
* @psalm-suppress TooManyArguments
*/
echo astra_post_tags( 'astra_blog_archive_tag', 'blog-tag-style', true ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
// @codingStandardsIgnoreEnd
do_action( 'astra_blog_archive_tag_after' );
break;
// Blog Post Title.
case 'title':
do_action( 'astra_blog_archive_title_before' );
astra_get_blog_post_title();
do_action( 'astra_blog_archive_title_after' );
break;
// Blog Post Title and Blog Post Meta.
case 'title-meta':
do_action( 'astra_blog_archive_title_meta_before' );
astra_get_blog_post_title_meta();
do_action( 'astra_blog_archive_title_meta_after' );
break;
// Blog Post excerpt.
case 'excerpt':
do_action( 'astra_blog_archive_excerpt_before' );
astra_the_excerpt();
do_action( 'astra_blog_archive_excerpt_after' );
break;
// Blog Post read more.
case 'read-more':
do_action( 'astra_blog_archive_read_more_before' );
astra_post_link();
do_action( 'astra_blog_archive_read_more_after' );
break;
}
}
}
}
}
/**
* Blog / Single Post Thumbnail
*/
if ( ! function_exists( 'astra_get_blog_post_thumbnail' ) ) {
/**
* Blog post Thumbnail
*
* @param string $type Type of post.
* @since 1.0.8
*/
function astra_get_blog_post_thumbnail( $type = 'archive' ) {
if ( 'archive' === $type ) {
// Blog Post Featured Image.
astra_get_post_thumbnail( '<div class="ast-blog-featured-section post-thumb ast-blog-single-element">', '</div>' );
} elseif ( 'single' === $type ) {
// Single Post Featured Image.
astra_get_post_thumbnail();
}
}
}
/**
* Blog Post Title & Meta Order
*/
if ( ! function_exists( 'astra_get_blog_post_title_meta' ) ) {
/**
* Blog post Thumbnail
*
* @since 1.0.8
*/
function astra_get_blog_post_title_meta() {
// Blog Post Title and Blog Post Meta.
do_action( 'astra_archive_entry_header_before' );
?>
<header class="entry-header ast-blog-single-element ast-blog-meta-container">
<?php
do_action( 'astra_archive_post_meta_before' );
astra_blog_get_post_meta();
do_action( 'astra_archive_post_meta_after' );
?>
</header><!-- .entry-header -->
<?php
do_action( 'astra_archive_entry_header_after' );
}
}
/**
* Blog post title
*
* @since 4.6.0
*/
function astra_get_blog_post_title() {
do_action( 'astra_archive_post_title_before' );
/* translators: 1: Current post link, 2: Current post id */
astra_the_post_title(
sprintf(
'<h2 class="entry-title ast-blog-single-element" %2$s><a href="%1$s" rel="bookmark">',
esc_url( get_permalink() ),
astra_attr(
'article-title-blog',
array(
'class' => '',
)
)
),
'</a></h2>',
get_the_id()
);
do_action( 'astra_archive_post_title_after' );
}
/**
* Get audio files from post content
*/
if ( ! function_exists( 'astra_get_audios_from_post' ) ) {
/**
* Get audio files from post content
*
* @param number $post_id Post id.
* @return mixed Iframe.
*/
function astra_get_audios_from_post( $post_id ) {
// for audio post type - grab.
$post = get_post( $post_id );
$content = do_shortcode( apply_filters( 'the_content', $post->post_content ) ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
$embeds = apply_filters( 'astra_get_post_audio', get_media_embedded_in_content( $content ) );
if ( empty( $embeds ) ) {
return '';
}
// check what is the first embed containg video tag, youtube or vimeo.
foreach ( $embeds as $embed ) {
if ( strpos( $embed, 'audio' ) ) {
return '<span class="ast-post-audio-wrapper">' . $embed . '</span>';
}
}
}
}
/**
* Get first image from post content
*/
if ( ! function_exists( 'astra_get_video_from_post' ) ) {
/**
* Get first image from post content
*
* @since 1.0
* @param number $post_id Post id.
* @return mixed
*/
function astra_get_video_from_post( $post_id ) {
$post = get_post( $post_id );
$content = do_shortcode( apply_filters( 'the_content', $post->post_content ) ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
$embeds = apply_filters( 'astra_get_post_audio', get_media_embedded_in_content( $content ) );
if ( empty( $embeds ) ) {
return '';
}
// check what is the first embed containg video tag, youtube or vimeo.
foreach ( $embeds as $embed ) {
if ( strpos( $embed, 'video' ) || strpos( $embed, 'youtube' ) || strpos( $embed, 'vimeo' ) ) {
return $embed;
}
}
}
}
/**
* Get last word of string to get meta-key of custom post structure.
*
* @since 4.0.0
* @param string $string from this get last word.
* @return string $last_word result.
*/
function astra_get_last_meta_word( $string ) {
$string = explode( '-', $string );
$last_word = array_pop( $string );
return $last_word;
}
/**
* Get the current archive description.
*
* @since 4.0.0
* @param string $post_type post type.
* @return string $description Description for archive.
*/
function astra_get_archive_description( $post_type ) {
$description = '';
if ( defined( 'SURECART_PLUGIN_FILE' ) && is_page() && get_the_ID() === absint( get_option( 'surecart_shop_page_id' ) ) ) {
$description = astra_get_option( 'ast-dynamic-archive-sc_product-custom-description', '' );
return $description;
}
if ( is_search() ) {
return have_posts()
? astra_get_i18n_option( 'section-search-page-title-found-custom-description', _x( '%astra%', 'Search Page Title: Subheading - When Results Found', 'astra' ) )
: astra_get_i18n_option( 'section-search-page-title-not-found-custom-description', _x( '%astra%', 'Search Page Title: Subheading - When Results Not Found', 'astra' ) );
} else {
$get_archive_description = get_the_archive_description();
$get_author_meta = trim( get_the_author_meta( 'description' ) );
if ( ! empty( $get_archive_description ) ) {
$description = get_the_archive_description();
}
if ( is_author() ) {
if ( ! empty( $get_author_meta ) ) {
$description = get_the_author_meta( 'description' );
}
}
if ( empty( $description ) && ! have_posts() && ! ( is_category() || is_tag() || is_tax() ) ) {
$description = esc_html( astra_default_strings( 'string-content-nothing-found-message', false ) );
}
}
if ( is_post_type_archive( $post_type ) ) {
$description = astra_get_option( 'ast-dynamic-archive-' . $post_type . '-custom-description', '' );
}
if ( 'post' === $post_type && ( ( is_front_page() && is_home() ) || is_home() ) ) {
$description = astra_get_option( 'ast-dynamic-archive-post-custom-description', '' );
}
return $description;
}
/**
* Custom single post Title & Meta order display.
*
* @since 4.0.0
* @param array $structure archive or single post structure.
* @return mixed
*/
function astra_banner_elements_order( $structure = array() ) {
if ( true === apply_filters( 'astra_remove_entry_header_content', false ) ) {
return;
}
$post_type = is_search() ? 'post' : astra_get_post_type();
// If 404 page.
if ( is_404() ) {
$post_type = '';
}
// If Blog / Latest Post page is active then looping required structural order.
if ( ( ! is_front_page() && is_home() ) && false === astra_get_option( 'ast-dynamic-archive-post-banner-on-blog', false ) ) {
return astra_blog_post_thumbnail_and_title_order();
}
$prefix = 'archive';
$structure = empty( $structure ) ? astra_get_option( 'ast-dynamic-' . $prefix . '-' . $post_type . '-structure', array( 'ast-dynamic-' . $prefix . '-' . $post_type . '-title', 'ast-dynamic-' . $prefix . '-' . $post_type . '-description' ) ) : $structure;
$layout_type = astra_get_option( 'ast-dynamic-' . $prefix . '-' . $post_type . '-layout', 'layout-1' );
if ( is_singular() ) {
$prefix = 'single';
$structure = astra_get_option( 'ast-dynamic-' . $prefix . '-' . $post_type . '-structure', array( 'ast-dynamic-' . $prefix . '-' . $post_type . '-title', 'ast-dynamic-' . $prefix . '-' . $post_type . '-meta' ) );
if ( 'page' === $post_type ) {
$structure = astra_get_option( 'ast-dynamic-single-page-structure', array( 'ast-dynamic-single-page-image', 'ast-dynamic-single-page-title' ) );
}
$layout_type = astra_get_option( 'ast-dynamic-' . $prefix . '-' . $post_type . '-layout', 'layout-1' );
}
do_action( 'astra_single_post_banner_before' );
$post_type = apply_filters( 'astra_banner_elements_post_type', $post_type );
$prefix = apply_filters( 'astra_banner_elements_prefix', $prefix );
foreach ( apply_filters( 'astra_banner_elements_structure', $structure ) as $metaval ) {
$meta_key = $prefix . '-' . astra_get_last_meta_word( $metaval );
switch ( $meta_key ) {
case 'single-breadcrumb':
do_action( 'astra_single_post_banner_breadcrumb_before' );
echo astra_get_breadcrumb(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
do_action( 'astra_single_post_banner_breadcrumb_after' );
break;
case 'single-title':
do_action( 'astra_single_post_banner_title_before' );
if ( 'page' === $post_type ) {
astra_the_title(
'<h1 class="entry-title" ' . astra_attr(
'article-title-content-page',
array(
'class' => '',
)
) . '>',
'</h1>'
);
} else {
astra_the_title(
'<h1 class="entry-title" ' . astra_attr(
'article-title-blog-single',
array(
'class' => '',
)
) . '>',
'</h1>'
);
}
do_action( 'astra_single_post_banner_title_after' );
break;
case 'single-excerpt':
/** @psalm-suppress InvalidGlobal */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
global $post;
do_action( 'astra_single_post_banner_excerpt_before' );
/** @psalm-suppress PossiblyUndefinedVariable */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
echo ! empty( $post ) && ! empty( $post->ID ) ? '<p>' . get_the_excerpt( $post->ID ) . '</p>' : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
/** @psalm-suppress PossiblyUndefinedVariable */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
do_action( 'astra_single_post_banner_excerpt_after' );
break;
case 'single-meta':
do_action( 'astra_single_post_banner_meta_before' );
$post_meta = astra_get_option( 'ast-dynamic-single-' . $post_type . '-metadata', array( 'comments', 'author', 'date' ) );
$output = '';
if ( ! empty( $post_meta ) ) {
$output_str = astra_get_post_meta( $post_meta, '/', 'single-post' );
if ( ! empty( $output_str ) ) {
$output = apply_filters( 'astra_single_post_meta', '<div class="entry-meta">' . $output_str . '</div>' ); // WPCS: XSS OK.
}
}
echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
do_action( 'astra_single_post_banner_meta_after' );
break;
case 'single-image':
if ( 'disabled' === astra_get_option_meta( 'ast-featured-img' ) ) {
break;
}
$featured_background = astra_get_option( 'ast-dynamic-single-' . $post_type . '-featured-as-background', false );
if ( 'layout-1' === $layout_type ) {
$article_featured_image_position = astra_get_option( 'ast-dynamic-single-' . $post_type . '-article-featured-image-position-layout-1', 'behind' );
} else {
$article_featured_image_position = astra_get_option( 'ast-dynamic-single-' . $post_type . '-article-featured-image-position-layout-2', 'none' );
}
if ( 'none' !== $article_featured_image_position ) {
break;
}
if ( ( 'layout-2' === $layout_type && false === $featured_background ) || 'layout-1' === $layout_type ) {
do_action( 'astra_blog_single_featured_image_before' );
astra_get_blog_post_thumbnail( 'single' );
do_action( 'astra_blog_single_featured_image_after' );
}
break;
case 'single-taxonomy':
case 'single-str-taxonomy':
do_action( 'astra_single_post_banner_taxonomies_before' );
echo astra_get_dynamic_taxonomy( 'ast-dynamic-single-' . $post_type . '-structural-taxonomy', 1, astra_get_option( 'ast-dynamic-single-' . $post_type . '-metadata-separator' ), astra_get_option( 'ast-dynamic-single-' . $post_type . '-structural-taxonomy-style', '' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
do_action( 'astra_single_post_banner_taxonomies_after' );
break;
case 'archive-title':
do_action( 'astra_blog_archive_title_before' );
add_filter( 'get_the_archive_title_prefix', '__return_empty_string' );
if ( 'layout-1' === $layout_type ) {
astra_the_post_title( '<h1 class="page-title ast-archive-title">', '</h1>', 0, true );
} else {
astra_the_post_title( '<h1>', '</h1>', 0, true );
do_action( 'astra_after_archive_title' );
}
remove_filter( 'get_the_archive_title_prefix', '__return_empty_string' );
do_action( 'astra_blog_archive_title_after' );
break;
case 'archive-breadcrumb':
if ( ! is_author() ) {
do_action( 'astra_blog_archive_breadcrumb_before' );
echo astra_get_breadcrumb(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
do_action( 'astra_blog_archive_breadcrumb_after' );
}
break;
case 'archive-description':
do_action( 'astra_blog_archive_description_before' );
echo wp_kses_post( wpautop( astra_get_archive_description( $post_type ) ) );
do_action( 'astra_blog_archive_description_after' );
break;
}
}
do_action( 'astra_single_post_banner_after' );
}
/**
* Blog Post Per Page
*
* @since 4.6.0
* @param WP_Query $query Query.
*/
function astra_blog_post_per_page( $query ) {
if ( is_admin() || ! $query->is_main_query() ) {
return;
}
if ( ! ( is_home() || is_archive() || is_search() ) ) {
return;
}
if ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) {
return;
}
$exclusions = apply_filters(
'astra_blog_post_per_page_exclusions',
array(
'bbpress_single',
'courses_archive',
'product',
)
);
if ( in_array( $query->get( 'post_type' ), $exclusions, true ) ) {
return;
}
$limit = apply_filters( 'astra_blog_post_per_page', astra_get_blog_posts_per_page() );
$query->set( 'posts_per_page', $limit );
}
add_action( 'parse_tax_query', 'astra_blog_post_per_page' );
/**
* Add Blog Layout Class
*
* @param array $classes Body Class Array.
* @since 4.6.0
* @return array
*/
function astra_primary_class_blog_layout( $classes ) {
if ( is_archive() && function_exists( 'is_bbpress' ) &&
( get_post_type() === 'forum' || get_post_type() === 'topic' || get_post_type() === 'reply' || get_query_var( 'post_type' ) === 'forum' || bbp_is_topic_tag() || bbp_is_topic_tag_edit() || is_bbpress() )
) {
return $classes;
}
// Apply grid class to archive page.
if ( ( is_home() ) || is_archive() || is_search() ) {
$blog_layout = astra_get_blog_layout();
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
if ( ! ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'blog-pro' ) ) ) {
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
// If a old pro user has used blog-layout-1 to 3 and disabled astra addon then moved layout to 'blog-layout-4'.
if ( 'blog-layout-1' == $blog_layout || 'blog-layout-2' === $blog_layout || 'blog-layout-3' === $blog_layout ) {
$blog_layout = 'blog-layout-4';
}
if ( 'blog-layout-4' == $blog_layout || 'blog-layout-5' === $blog_layout || 'blog-layout-6' === $blog_layout ) {
$classes[] = 'ast-grid-3';
}
}
if ( 'blog-layout-4' == $blog_layout || 'blog-layout-5' === $blog_layout || 'blog-layout-6' === $blog_layout ) {
$classes[] = 'ast-' . esc_attr( $blog_layout ) . '-grid';
}
$classes = apply_filters( 'astra_primary_class_blog_grid', $classes );
}
return $classes;
}
add_filter( 'astra_primary_class', 'astra_primary_class_blog_layout' );
/**
* Blog Layout Customization
*
* @since 4.6.0
* @return void
*/
function astra_blog_layout_customization() {
$blog_layout = astra_get_blog_layout();
$blog_layout_slugs = array( 'blog-layout-4', 'blog-layout-5', 'blog-layout-6' );
if ( in_array( $blog_layout, $blog_layout_slugs ) ) {
remove_action( 'astra_entry_content_blog', 'astra_entry_content_blog_template' );
add_action( 'astra_entry_content_blog', 'astra_blog_layout_template' );
}
}
add_action( 'wp_head', 'astra_blog_layout_customization' );
/**
* Blog Layout Template Markup
*
* @since 4.6.0
* @return void
*/
function astra_blog_layout_template() {
get_template_part( 'template-parts/blog/' . esc_attr( astra_get_blog_layout() ) );
}
/**
* Blog Custom excerpt length.
*
* @since 4.6.0
* @param int $length Length.
* @return int
*/
function astra_custom_excerpt_length( $length ) {
$blog_layout = astra_get_blog_layout();
return 'blog-layout-4' === $blog_layout ? 20 : $length;
}
add_filter( 'excerpt_length', 'astra_custom_excerpt_length', 1 );
/**
* Remove link from featured image for layout 6
*
* @since 4.6.0
* @param string $content Content.
* @return mixed
*/
function astra_remove_link_from_featured_image( $content = '' ) {
$blog_layout = astra_get_blog_layout();
if ( is_archive() || is_home() || is_search() ) {
if ( 'blog-layout-6' === $blog_layout ) {
add_filter( 'astra_blog_post_featured_image_link_after', '__return_false' );
add_filter( 'astra_blog_post_featured_image_link_before', '__return_false' );
}
}
return $content;
}
add_filter( 'wp', 'astra_remove_link_from_featured_image' );

View File

@@ -0,0 +1,9 @@
<?php
/**
* Index file
*
* @package Astra
* @since Astra 1.0.0
*/
/* Silence is golden, and we agree. */

View File

@@ -0,0 +1,297 @@
<?php
/**
* Single Blog Helper Functions
*
* @package Astra
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Adds custom classes to the array of body classes.
*/
if ( ! function_exists( 'astra_single_body_class' ) ) {
/**
* Adds custom classes to the array of body classes.
*
* @since 1.0.0
* @param array $classes Classes for the body element.
* @return array
*/
function astra_single_body_class( $classes ) {
// Blog layout.
if ( is_single() ) {
$classes[] = 'ast-blog-single-style-1';
if ( 'post' != get_post_type() ) {
$classes[] = 'ast-custom-post-type';
}
}
if ( is_singular() ) {
$classes[] = 'ast-single-post';
}
return $classes;
}
}
add_filter( 'body_class', 'astra_single_body_class' );
/**
* Adds custom classes to the array of body classes.
*/
if ( ! function_exists( 'astra_single_post_class' ) ) {
/**
* Adds custom classes to the array of body classes.
*
* @since 1.0.0
* @param array $classes Classes for the body element.
* @return array
*/
function astra_single_post_class( $classes ) {
// Blog layout.
if ( is_singular() ) {
if ( ! in_array( 'ast-related-post', $classes ) ) {
$classes[] = 'ast-article-single';
}
// Remove hentry from page.
if ( 'page' == get_post_type() ) {
$classes = array_diff( $classes, array( 'hentry' ) );
}
}
return $classes;
}
}
add_filter( 'post_class', 'astra_single_post_class' );
/**
* Template for comments and pingbacks.
*/
if ( ! function_exists( 'astra_theme_comment' ) ) {
/**
* Template for comments and pingbacks.
*
* To override this walker in a child theme without modifying the comments template
* simply create your own astra_theme_comment(), and that function will be used instead.
*
* Used as a callback by wp_list_comments() for displaying the comments.
*
* @param string $comment Comment.
* @param array $args Comment arguments.
* @param number $depth Depth.
* @return mixed Comment markup.
*/
function astra_theme_comment( $comment, $args, $depth ) {
switch ( $comment->comment_type ) {
case 'pingback':
case 'trackback':
// Display trackbacks differently than normal comments.
?>
<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
<p><?php esc_html_e( 'Pingback:', 'astra' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'astra' ), '<span class="edit-link">', '</span>' ); ?></p>
</li>
<?php
break;
default:
// Proceed with normal comments.
global $post;
$entry_content_class = Astra_Dynamic_CSS::astra_4_6_0_compatibility() ? ' entry-content' : '';
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
<article id="comment-<?php comment_ID(); ?>" class="ast-comment">
<div class= 'ast-comment-info'>
<div class='ast-comment-avatar-wrap'><?php echo get_avatar( $comment, 50 ); ?></div><!-- Remove 1px Space
-->
<?php
astra_markup_open( 'ast-comment-data-wrap' );
astra_markup_open( 'ast-comment-meta-wrap' );
echo '<header ';
echo wp_kses_post(
astra_attr(
'commen-meta-author',
array(
'class' => 'ast-comment-meta ast-row ast-comment-author capitalize',
)
)
);
echo '>';
printf(
esc_attr(
astra_markup_open(
'ast-comment-cite-wrap',
array(
'open' => '<div %s>',
'class' => 'ast-comment-cite-wrap',
)
)
) . '<cite><b class="fn">%1$s</b> %2$s</cite></div>',
get_comment_author_link(),
// If current post author is also comment author, make it known visually.
( $comment->user_id === $post->post_author ) ? '<span class="ast-highlight-text ast-cmt-post-author"></span>' : ''
);
if ( apply_filters( 'astra_single_post_comment_time_enabled', true ) ) {
printf(
esc_attr(
astra_markup_open(
'ast-comment-time',
array(
'open' => '<div %s>',
'class' => 'ast-comment-time',
)
)
) . '<span class="timendate"><a href="%1$s"><time datetime="%2$s">%3$s</time></a></span></div>',
esc_url( get_comment_link( $comment->comment_ID ) ),
esc_attr( get_comment_time( 'c' ) ),
/* translators: 1: date, 2: time */
esc_html( sprintf( __( '%1$s at %2$s', 'astra' ), get_comment_date(), get_comment_time() ) )
);
}
?>
<?php astra_markup_close( 'ast-comment-meta-wrap' ); ?>
</header> <!-- .ast-comment-meta -->
</div>
<section class="ast-comment-content comment <?php echo esc_attr( $entry_content_class ); ?>">
<?php comment_text(); ?>
<div class="ast-comment-edit-reply-wrap">
<?php
if ( Astra_Dynamic_CSS::astra_4_6_0_compatibility() ) {
comment_reply_link(
array_merge(
$args,
array(
'reply_text' => astra_default_strings( 'string-comment-reply-link', false ),
'add_below' => 'comment',
'depth' => $depth,
'max_depth' => $args['max_depth'],
'before' => '<span class="ast-reply-link">',
'after' => '</span>',
)
)
);
edit_comment_link( astra_default_strings( 'string-comment-edit-link', false ), '<span class="ast-edit-link">', '</span>' );
} else {
edit_comment_link( astra_default_strings( 'string-comment-edit-link', false ), '<span class="ast-edit-link">', '</span>' );
comment_reply_link(
array_merge(
$args,
array(
'reply_text' => astra_default_strings( 'string-comment-reply-link', false ),
'add_below' => 'comment',
'depth' => $depth,
'max_depth' => $args['max_depth'],
'before' => '<span class="ast-reply-link">',
'after' => '</span>',
)
)
);
}
?>
</div>
<?php if ( '0' == $comment->comment_approved ) : ?>
<p class="ast-highlight-text comment-awaiting-moderation"><?php echo esc_html( astra_default_strings( 'string-comment-awaiting-moderation', false ) ); ?></p>
<?php endif; ?>
</section> <!-- .ast-comment-content -->
<?php astra_markup_close( 'ast-comment-data-wrap' ); ?>
</article><!-- #comment-## -->
<?php
break;
}
}
}
/**
* Adjacent navigation post link attributes.
*
* @param string $output The adjacent post link.
* @param string $format Link anchor format.
* @param string $link Link permalink format.
* @param WP_Post|string $post The adjacent post. Empty string if no corresponding post exists.
* @param string $adjacent Whether the post is previous or next.
*
* @return string Link of post URL.
* @since 4.6.0
*/
function astra_adjacent_post_links_title( $output, $format, $link, $post, $adjacent ) {
/** @psalm-suppress PossiblyInvalidPropertyFetch */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
if ( ! empty( $post->post_title ) ) {
/** @psalm-suppress PossiblyInvalidPropertyFetch */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$output = str_replace( 'href="', 'title="' . esc_attr( $post->post_title ) . '" ' . 'href="', $output );
}
return $output;
}
/**
* Get Post Navigation
*/
if ( ! function_exists( 'astra_single_post_navigation_markup' ) ) {
/**
* Get Post Navigation
*
* Checks post navigation, if exists return as button.
*
* @return mixed Post Navigation Buttons
*/
function astra_single_post_navigation_markup() {
$single_post_navigation_enabled = apply_filters( 'astra_single_post_navigation_enabled', true );
if ( is_single() && $single_post_navigation_enabled ) {
$post_obj = get_post_type_object( get_post_type() );
/** @psalm-suppress PossiblyNullPropertyFetch */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$post_singular_name = ! empty( $post_obj->labels->singular_name ) ? $post_obj->labels->singular_name : '';
/** @psalm-suppress PossiblyNullPropertyFetch */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$prev_text = Astra_Dynamic_CSS::astra_4_6_0_compatibility() ? '<span class="ast-post-nav">' . Astra_Builder_UI_Controller::fetch_svg_icon( 'long-arrow-alt-left' ) . ' ' . astra_default_strings( 'string-previous-text', false ) . '</span> <p> %title </p>' : sprintf(
astra_default_strings( 'string-single-navigation-previous', false ),
$post_singular_name
);
$next_text = Astra_Dynamic_CSS::astra_4_6_0_compatibility() ? '<span class="ast-post-nav">' . astra_default_strings( 'string-next-text', false ) . ' ' . Astra_Builder_UI_Controller::fetch_svg_icon( 'long-arrow-alt-right' ) . '</span> <p> %title </p>' : sprintf(
astra_default_strings( 'string-single-navigation-next', false ),
$post_singular_name
);
add_filter( 'previous_post_link', 'astra_adjacent_post_links_title', 10, 5 );
add_filter( 'next_post_link', 'astra_adjacent_post_links_title', 10, 5 );
/**
* Filter the post pagination markup
*/
the_post_navigation(
apply_filters(
'astra_single_post_navigation',
array(
'next_text' => $next_text,
'prev_text' => $prev_text,
'screen_reader_text' => __( 'Post navigation', 'astra' ),
)
)
);
remove_filter( 'previous_post_link', 'astra_adjacent_post_links_title', 10 );
remove_filter( 'next_post_link', 'astra_adjacent_post_links_title', 10 );
}
}
}
add_action( 'astra_entry_after', 'astra_single_post_navigation_markup' );

View File

@@ -0,0 +1,222 @@
<?php
/**
* Astra Builder Loader.
*
* @package astra-builder
*/
// No direct access, please.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Astra_Builder_Loader' ) ) {
/**
* Class Astra_Builder_Loader.
*/
final class Astra_Builder_Loader {
/**
* Member Variable
*
* @var mixed instance
*/
private static $instance = null;
/**
* Variable to hold menu locations rendered on the site.
*
* @var array Menu locations array
*/
private static $menu_locations = array();
/**
* Initiator
*/
public static function get_instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
do_action( 'astra_builder_loaded' );
}
return self::$instance;
}
/**
* Constructor
*/
public function __construct() {
// @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
/**
* Builder Core Files.
*/
require_once ASTRA_THEME_DIR . 'inc/core/builder/class-astra-builder-helper.php';
require_once ASTRA_THEME_DIR . 'inc/core/builder/class-astra-builder-options.php';
/**
* Builder - Header & Footer Markup.
*/
require_once ASTRA_THEME_DIR . 'inc/builder/markup/class-astra-builder-header.php';
require_once ASTRA_THEME_DIR . 'inc/builder/markup/class-astra-builder-footer.php';
/**
* Builder Controllers.
*/
require_once ASTRA_THEME_DIR . 'inc/builder/controllers/class-astra-builder-widget-controller.php';
require_once ASTRA_THEME_DIR . 'inc/builder/controllers/class-astra-builder-ui-controller.php';
/**
* Customizer - Configs.
*/
require_once ASTRA_THEME_DIR . 'inc/customizer/class-astra-builder-customizer.php';
/**DONE */
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
add_filter( 'astra_existing_header_footer_configs', '__return_false' );
add_filter( 'astra_addon_existing_header_footer_configs', '__return_false' );
}
// @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
add_action( 'wp', array( $this, 'load_markup' ), 100 );
add_filter( 'astra_quick_settings', array( $this, 'quick_settings' ) );
}
/**
* Update Quick Settings links.
*
* @param array $quick_settings Links to the Quick Settings in Astra.
* @since 3.0.0
*/
public function quick_settings( $quick_settings ) {
if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) {
return $quick_settings;
}
$quick_settings['header']['title'] = __( 'Header Builder', 'astra' );
$quick_settings['header']['quick_url'] = admin_url( 'customize.php?autofocus[panel]=panel-header-builder-group' );
$quick_settings['footer']['title'] = __( 'Footer Builder', 'astra' );
$quick_settings['footer']['quick_url'] = admin_url( 'customize.php?autofocus[panel]=panel-footer-builder-group' );
return $quick_settings;
}
/**
* Advanced Hooks markup loader
*
* Loads appropriate template file based on the style option selected in options panel.
*
* @since 3.0.0
*/
public function load_markup() {
if ( ! defined( 'ASTRA_ADVANCED_HOOKS_POST_TYPE' ) || false === Astra_Builder_Helper::$is_header_footer_builder_active ) {
return;
}
$option = array(
'location' => 'ast-advanced-hook-location',
'exclusion' => 'ast-advanced-hook-exclusion',
'users' => 'ast-advanced-hook-users',
);
$result = Astra_Target_Rules_Fields::get_instance()->get_posts_by_conditions( ASTRA_ADVANCED_HOOKS_POST_TYPE, $option );
$header_counter = 0;
$footer_counter = 0;
$layout_404_counter = 0;
foreach ( $result as $post_id => $post_data ) {
$post_type = get_post_type();
// Get the display devices condition for the post.
$display_devices = get_post_meta( $post_id, 'ast-advanced-display-device', true );
if ( ! is_array( $display_devices ) ) {
$display_devices = array( 'desktop', 'tablet', 'mobile' );
}
if ( ASTRA_ADVANCED_HOOKS_POST_TYPE !== $post_type ) {
$layout = get_post_meta( $post_id, 'ast-advanced-hook-layout', false );
if ( isset( $layout[0] ) && '404-page' == $layout[0] && 0 == $layout_404_counter ) {
$layout_404_settings = get_post_meta( $post_id, 'ast-404-page', true );
if ( isset( $layout_404_settings['disable_header'] ) && 'enabled' == $layout_404_settings['disable_header'] ) {
remove_action( 'astra_header', array( Astra_Builder_Header::get_instance(), 'header_builder_markup' ) );
}
if ( isset( $layout_404_settings['disable_footer'] ) && 'enabled' == $layout_404_settings['disable_footer'] ) {
remove_action( 'astra_footer', array( Astra_Builder_Footer::get_instance(), 'footer_markup' ) );
}
$layout_404_counter ++;
} elseif ( isset( $layout[0] ) && 'header' == $layout[0] && 0 == $header_counter ) {
// Remove default site's header.
remove_action( 'astra_header', array( Astra_Builder_Header::get_instance(), 'header_builder_markup' ) );
// Check if the post has 'ast-advanced-hook-enabled' meta key is not set to 'no'.
$is_enabled = 'no' !== get_post_meta( $post_id, 'ast-advanced-hook-enabled', true );
// Check if the custom header is enabled for all devices.
$is_all_devices = 3 === count( $display_devices );
if ( $is_enabled && $is_all_devices ) {
// Prevent Off-Canvas markup on custom header rendering.
add_filter( 'astra_disable_mobile_popup_markup', '__return_true' );
}
$header_counter++;
} elseif ( isset( $layout[0] ) && 'footer' == $layout[0] && 0 == $footer_counter ) {
// Remove default site's footer.
remove_action( 'astra_footer', array( Astra_Builder_Footer::get_instance(), 'footer_markup' ) );
$footer_counter++;
}
}
}
}
/**
* Method to add rel="nofollow" for markup
*
* @param string $theme_location Theme location for key.
* @param string $markup Markup.
* @return string Menu markup with rel="nofollow".
* @since 4.6.14
*/
public function nofollow_markup( $theme_location, $markup ) {
$nofollow_disabled = apply_filters( 'astra_disable_nofollow_markup', true );
if ( $nofollow_disabled ) {
return $markup;
}
if ( isset( self::$menu_locations[ $theme_location ] ) ) {
$markup = str_replace( 'href="', 'rel="nofollow" href="', $markup );
} else {
self::$menu_locations[ $theme_location ] = true;
}
return $markup;
}
}
/**
* Prepare if class 'Astra_Builder_Loader' exist.
* Kicking this off by calling 'get_instance()' method
*/
Astra_Builder_Loader::get_instance();
}
if ( ! function_exists( 'astra_builder' ) ) {
/**
* Get global class.
*
* @return object
*/
function astra_builder() {
return Astra_Builder_Loader::get_instance();
}
}

View File

@@ -0,0 +1,529 @@
<?php
/**
* Astra Builder UI Controller.
*
* @package astra-builder
*/
// No direct access, please.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Astra_Builder_UI_Controller' ) ) {
/**
* Class Astra_Builder_UI_Controller.
*/
final class Astra_Builder_UI_Controller {
/**
* Astra SVGs.
*
* @var mixed ast_svgs
*/
private static $ast_svgs = null;
/**
* Get an SVG Icon
*
* @param string $icon the icon name.
* @param bool $base if the baseline class should be added.
*/
public static function fetch_svg_icon( $icon = '', $base = true ) {
$output = '<span aria-hidden="true" class="ahfb-svg-iconset ast-inline-flex' . ( $base ? ' svg-baseline' : '' ) . '">';
/** @psalm-suppress DocblockTypeContradiction */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
if ( ! self::$ast_svgs ) {
ob_start();
include_once ASTRA_THEME_DIR . 'assets/svg/svgs.json'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
self::$ast_svgs = json_decode( ob_get_clean(), true );
self::$ast_svgs = apply_filters( 'astra_svg_icons', self::$ast_svgs );
}
$output .= isset( self::$ast_svgs[ $icon ] ) ? self::$ast_svgs[ $icon ] : '';
$output .= '</span>';
return $output;
}
/**
* Prepare Social Icon HTML.
*
* @param string $index The Index of the social icon.
* @param string $builder_type the type of the builder.
*/
public static function render_social_icon( $index, $builder_type = 'header' ) {
$items = astra_get_option( $builder_type . '-social-icons-' . $index );
$items = isset( $items['items'] ) ? $items['items'] : array();
$show_label = astra_get_option( $builder_type . '-social-' . $index . '-label-toggle' );
$color_type = astra_get_option( $builder_type . '-social-' . $index . '-color-type' );
$social_stack = astra_get_option( $builder_type . '-social-' . $index . '-stack', 'none' );
echo '<div class="ast-' . esc_attr( $builder_type ) . '-social-' . esc_attr( $index ) . '-wrap ast-' . esc_attr( $builder_type ) . '-social-wrap">';
if ( is_customize_preview() ) {
self::render_customizer_edit_button();
}
echo '<div class="' . esc_attr( $builder_type ) . '-social-inner-wrap element-social-inner-wrap social-show-label-' . ( $show_label ? 'true' : 'false' ) . ' ast-social-color-type-' . esc_attr( $color_type ) . ' ast-social-stack-' . esc_attr( $social_stack ) . ' ast-social-element-style-filled">';
if ( is_array( $items ) && ! empty( $items ) ) {
foreach ( $items as $item ) {
if ( $item['enabled'] ) {
$link = $item['url'];
switch ( $item['id'] ) {
case 'phone':
$link = 'tel:' . $item['url'];
break;
case 'email':
$link = 'mailto:' . $item['url'];
break;
case 'whatsapp':
$link = 'https://api.whatsapp.com/send?phone=' . $item['url'];
break;
}
echo '<a href="' . esc_url( $link ) . '" ' .
( $item['label'] ? 'aria-label="' . esc_attr( $item['label'] ) . '"' : 'aria-label="' . esc_attr( $item['id'] ) . '"' ) .
( 'phone' === $item['id'] || 'email' === $item['id'] ? '' : ' target="_blank" rel="noopener noreferrer"' ) .
' style="--color: ' . esc_attr( ! empty( $item['color'] ) ? $item['color'] : '#3a3a3a' ) . '; --background-color: ' . esc_attr( ! empty( $item['background'] ) ? $item['background'] : 'transparent' ) . ';" ' .
'class="ast-builder-social-element ast-inline-flex ast-' . esc_attr( $item['id'] ) . ' ' . esc_attr( $builder_type ) . '-social-item">';
echo self::fetch_svg_icon( $item['icon'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
if ( $show_label ) {
echo '<span class="social-item-label">' . esc_html( $item['label'] ) . '</span>';
}
echo '</a>';
}
}
}
echo apply_filters( 'astra_social_icons_after', '' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo '</div>';
echo '</div>';
}
/**
* Prepare HTML Markup.
*
* @param string $index Key of the HTML Control.
*/
public static function render_html_markup( $index = 'header-html-1' ) {
$theme_author = astra_get_theme_author_details();
$content = astra_get_i18n_option( $index, Astra_Builder_Helper::get_translatable_string( $index ) );
if ( $content || is_customize_preview() ) {
$link_style = '';
echo '<div class="ast-header-html inner-link-style-' . esc_attr( $link_style ) . '">';
if ( is_customize_preview() ) {
self::render_customizer_edit_button();
}
echo '<div class="ast-builder-html-element">';
$content = str_replace( '[copyright]', '&copy;', $content );
$content = str_replace( '[current_year]', gmdate( 'Y' ), $content );
$content = str_replace( '[site_title]', get_bloginfo( 'name' ), $content );
$content = str_replace( '[theme_author]', '<a href=" ' . esc_url( $theme_author['theme_author_url'] ) . '" rel="nofollow noopener" target="_blank">' . $theme_author['theme_name'] . '</a>', $content );
// First applying wpautop to handle paragraphs, then removing extra <p> around shortcodes.
$content = shortcode_unautop( wpautop( $content ) );
echo do_shortcode( wp_kses_post( $content ) );
echo '</div>';
echo '</div>';
}
}
/**
* Prepare Edit icon inside customizer.
*
* @param string $class custom class.
* @since 3.9.4
*/
public static function render_customizer_edit_button( $class = '' ) { ?>
<div class="customize-partial-edit-shortcut <?php echo esc_attr( $class ); ?>" data-id="ahfb">
<button aria-label="<?php esc_attr_e( 'Click to edit this element.', 'astra' ); ?>"
title="<?php esc_attr_e( 'Click to edit this element.', 'astra' ); ?>"
class="customize-partial-edit-shortcut-button item-customizer-focus">
<?php echo self::fetch_svg_icon( 'edit' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</button>
</div>
<?php
}
/**
* Prepare Special Edit navigatory trigger for Builder Grid Rows in customizer.
*
* @param string $type Header / Footer row type.
* @param string $row_position Above / Primary / Below.
*
* @since 3.0.0
*/
public static function render_grid_row_customizer_edit_button( $type, $row_position ) {
switch ( $row_position ) {
case 'primary':
/* translators: %s: icon term */
$row_label = sprintf( __( 'Primary %s', 'astra' ), $type );
break;
case 'above':
/* translators: %s: icon term */
$row_label = sprintf( __( 'Above %s', 'astra' ), $type );
break;
case 'below':
/* translators: %s: icon term */
$row_label = sprintf( __( 'Below %s', 'astra' ), $type );
break;
default:
$row_label = $type;
break;
}
?>
<div class="customize-partial-edit-shortcut row-editor-shortcut" data-id="ahfb">
<button aria-label="<?php esc_attr_e( 'Click to edit this element.', 'astra' ); ?>" title="<?php esc_attr_e( 'Click to edit this Row.', 'astra' ); ?>" class="item-customizer-focus">
<?php echo self::fetch_svg_icon( 'edit' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</button>
</div>
<?php
}
/**
* Prepare Edit navigatory trigger for Banner Section in customizer.
*
* @since 3.9.0
*/
public static function render_banner_customizer_edit_button() {
?>
<div class="customize-partial-edit-shortcut banner-editor-shortcut" data-id="ahfb">
<button aria-label="<?php esc_attr_e( 'Click to edit this element.', 'astra' ); ?>" title="<?php esc_attr_e( 'Click to edit this Row.', 'astra' ); ?>" class="item-customizer-focus">
<?php echo self::fetch_svg_icon( 'edit' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</button>
</div>
<?php
}
/**
* Render Trigger Markup.
*
* @since 3.0.0
*/
public static function render_mobile_trigger() {
$icon = astra_get_option( 'header-trigger-icon' );
$mobile_label = astra_get_i18n_option( 'mobile-header-menu-label', _x( '%astra%', 'Primary Menu: Menu Label (Mobile Menu)', 'astra' ) );
$toggle_btn_style = astra_get_option( 'mobile-header-toggle-btn-style' );
$aria_controls = '';
if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) {
$aria_controls = 'aria-controls="primary-menu"';
}
?>
<div class="ast-button-wrap">
<button type="button" class="menu-toggle main-header-menu-toggle ast-mobile-menu-trigger-<?php echo esc_attr( $toggle_btn_style ); ?>" <?php echo apply_filters( 'astra_nav_toggle_data_attrs', '' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> <?php echo esc_attr( $aria_controls ); ?> aria-expanded="false">
<span class="screen-reader-text">Main Menu</span>
<span class="mobile-menu-toggle-icon">
<?php
echo self::fetch_svg_icon( $icon ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo self::fetch_svg_icon( 'close' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</span>
<?php
if ( ! empty( $mobile_label ) ) {
?>
<span class="mobile-menu-wrap">
<span class="mobile-menu"><?php echo esc_html( $mobile_label ); ?></span>
</span>
<?php
}
?>
</button>
</div>
<?php
}
/**
* Prepare Button HTML.
*
* @param string $index The Index of the button.
* @param string $builder_type the type of the builder.
*/
public static function render_button( $index, $builder_type = 'header' ) {
if ( is_customize_preview() ) {
self::render_customizer_edit_button();
}
$button_size = astra_get_option( $builder_type . '-button' . $index . '-size' );
echo '<div class="ast-builder-button-wrap ast-builder-button-size-' . $button_size . '">'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo astra_get_custom_button( $builder_type . '-button' . $index . '-text', $builder_type . '-button' . $index . '-link-option', 'header-button' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Site Identity.
*
* @param string $device Device name.
*/
public static function render_site_identity( $device ) {
?>
<div
<?php
echo wp_kses_post(
astra_attr(
'site-identity',
array(
'class' => 'site-branding ast-site-identity',
)
)
);
?>
>
<?php
// placed inside site-identity div to prevent multiple edit buttons.
if ( is_customize_preview() ) {
self::render_customizer_edit_button();
}
astra_logo( $device );
?>
</div>
<!-- .site-branding -->
<?php
}
/**
* Render Mobile Cart Flyout Markup.
*
* @since 3.1.0
*/
public static function render_mobile_cart_flyout_markup() {
$flyout_cart_width = astra_get_option( 'woo-slide-in-cart-width' );
$flyout_cart_width_desktop = ( isset( $flyout_cart_width['desktop'] ) ) ? $flyout_cart_width['desktop'] : '';
$flyout_cart_width_desktop_unit = ( isset( $flyout_cart_width['desktop-unit'] ) ) ? $flyout_cart_width['desktop-unit'] : '';
$flyout_cart_unit_breakpoint = 'px' === $flyout_cart_width_desktop_unit ? 500 : 50;
$is_width_long = $flyout_cart_width_desktop && $flyout_cart_width_desktop > $flyout_cart_unit_breakpoint ? 'ast-large-view' : '';
?>
<div class="astra-mobile-cart-overlay"></div>
<div id="astra-mobile-cart-drawer" class="astra-cart-drawer">
<div class="astra-cart-drawer-header">
<button type="button" class="astra-cart-drawer-close" aria-label="<?php echo esc_attr__( 'Close Cart Drawer', 'astra' ); ?>">
<?php echo self::fetch_svg_icon( 'close' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</button>
<div class="astra-cart-drawer-title">
<?php
echo apply_filters( 'astra_header_cart_flyout_shopping_cart_text', __( 'Shopping Cart', 'astra' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</div>
</div>
<div class="astra-cart-drawer-content <?php echo esc_attr( $is_width_long ); ?>">
<?php
if ( class_exists( 'Astra_Woocommerce' ) ) {
the_widget( 'WC_Widget_Cart', 'title=' );
}
if ( class_exists( 'Easy_Digital_Downloads' ) ) {
the_widget( 'edd_cart_widget', 'title=' );
}
?>
</div>
</div>
<?php
}
/**
* Account HTML.
*/
public static function render_account() {
$is_logged_in = is_user_logged_in();
$link_href = '';
$new_tab = '';
$link_rel = '';
$account_link = '';
$link_url = '';
$logout_preview = astra_get_option( 'header-account-logout-preview' );
$is_customizer = is_customize_preview();
$logged_out_style = astra_get_option( 'header-account-logout-style' );
if ( ! $is_logged_in && 'none' === $logged_out_style ) {
return;
}
$icon_skin = ( '' !== astra_get_option( 'header-account-icon-type' ) ) ? astra_get_option( 'header-account-icon-type' ) : 'account-1';
?>
<div class="ast-header-account-wrap" tabindex="0">
<?php
if ( $is_customizer ) {
self::render_customizer_edit_button();
}
/** @psalm-suppress RedundantConditionGivenDocblockType */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
if ( $is_logged_in && ( ( ( ( ! $logout_preview ) || ( 'none' === $logged_out_style && $logout_preview ) ) && $is_customizer ) || ( ! $is_customizer ) ) ) {
$account_type = astra_get_option( 'header-account-type' );
$login_profile_type = astra_get_option( 'header-account-login-style' );
$extend_text_profile_type = astra_get_option( 'header-account-login-style-extend-text-profile-type' );
$action_type = astra_get_option( 'header-account-action-type' );
$link_type = astra_get_option( 'header-account-link-type' );
$account_link = astra_get_option( 'header-account-login-link' );
$logged_in_text = astra_get_i18n_option( 'header-account-logged-in-text', _x( '%astra%', 'Header Builder: Account Widget - Logged In View Text', 'astra' ) );
if ( 'default' !== $account_type && 'default' === $link_type && defined( 'ASTRA_EXT_VER' ) ) {
$new_tab = 'target=_self';
if ( 'woocommerce' === $account_type && class_exists( 'WooCommerce' ) ) {
$woocommerce_link = get_permalink( get_option( 'woocommerce_myaccount_page_id' ) );
$link_url = ( $woocommerce_link ) ? $woocommerce_link : '';
} elseif ( 'lifterlms' === $account_type && class_exists( 'LifterLMS' ) ) {
$lifterlms_link = get_permalink( llms_get_page_id( 'myaccount' ) );
$link_url = ( $lifterlms_link ) ? $lifterlms_link : '';
}
} elseif ( '' !== $account_link && '' !== $account_link['url'] ) {
$link_url = $account_link['url'];
$new_tab = ( $account_link['new_tab'] ? 'target=_blank' : 'target=_self' );
$link_rel = ( ! empty( $account_link['link_rel'] ) ? 'rel=' . esc_attr( $account_link['link_rel'] ) : '' );
}
$link_href = ( '' !== $link_url ) ? 'href=' . esc_url( $link_url ) : '';
$link_classes = array(
'ast-header-account-link',
'ast-account-action-' . $action_type,
);
if ( 'text' !== $login_profile_type ) {
$link_classes[] = 'ast-header-account-type-' . $login_profile_type;
} else {
if ( 'default' === $extend_text_profile_type ) {
$link_classes[] = 'ast-header-account-type-' . $login_profile_type;
} else {
// Make sure, we set the common class as before so that we can adapt to existing CSS styles.
$link_classes[] = 'ast-header-account-type-' . $extend_text_profile_type;
$link_classes[] = 'ast-header-account-type-extend-text-profile-type';
}
}
?>
<div class="ast-header-account-inner-wrap">
<a class="<?php echo esc_attr( implode( ' ', $link_classes ) ); ?>" role="link" aria-label="<?php esc_attr_e( 'Account icon link', 'astra' ); ?>" <?php echo esc_attr( $link_href . ' ' . $new_tab . ' ' . $link_rel ); ?> >
<?php
if ( 'avatar' === $login_profile_type ) {
echo get_avatar( get_current_user_id() );
} elseif ( 'icon' === $login_profile_type ) {
echo self::fetch_svg_icon( $icon_skin ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} elseif ( 'text' === $login_profile_type ) {
if ( 'avatar' === $extend_text_profile_type ) {
echo get_avatar( get_current_user_id() );
} elseif ( 'icon' === $extend_text_profile_type ) {
echo self::fetch_svg_icon( $icon_skin ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
<span class="ast-header-account-text"><?php echo esc_html( $logged_in_text ); ?></span>
<?php } ?>
</a>
<?php
if ( defined( 'ASTRA_EXT_VER' ) && 'menu' === $action_type ) {
Astra_Header_Account_Component::account_menu_markup();
}
?>
</div>
<?php } elseif ( ( 'none' !== $logged_out_style ) && ( ( ! $is_logged_in ) || ( $is_logged_in && $logout_preview && $is_customizer ) ) ) { ?>
<?php
$action_type = astra_get_option( 'header-account-logout-action' );
$logged_out_text = astra_get_i18n_option( 'header-account-logged-out-text', _x( '%astra%', 'Header Builder: Account Widget - Logged Out View Text', 'astra' ) );
$login_link = astra_get_option( 'header-account-logout-link' );
$extend_text_profile_type = astra_get_option( 'header-account-logout-style-extend-text-profile-type' );
$logged_out_style_class = array(
'ast-header-account-link',
'ast-account-action-' . $action_type,
);
if ( 'text' !== $logged_out_style ) {
$logged_out_style_class[] = 'ast-header-account-type-' . $logged_out_style;
} else {
if ( 'default' === $extend_text_profile_type ) {
$logged_out_style_class[] = 'ast-header-account-type-' . $logged_out_style;
} else {
// Make sure, we set the common class as before so that we can adapt to existing CSS styles.
$logged_out_style_class[] = 'ast-header-account-type-' . $extend_text_profile_type;
$logged_out_style_class[] = 'ast-header-account-type-extend-text-profile-type';
}
}
if ( '' !== $login_link && '' !== $login_link['url'] ) {
$current_url = home_url( add_query_arg( array(), $GLOBALS['wp']->request ) );
$default_login = wp_login_url();
if ( $default_login === $login_link['url'] ) {
$login_link['url'] = wp_login_url( $current_url );
}
$link_url = $login_link['url'];
$new_tab = ( $login_link['new_tab'] ? 'target=_blank' : 'target=_self' );
$link_rel = ( ! empty( $login_link['link_rel'] ) ? 'rel=' . esc_attr( $login_link['link_rel'] ) : '' );
}
$link_href = 'href=' . esc_url( $link_url ) . '';
?>
<a class="<?php echo esc_attr( implode( ' ', $logged_out_style_class ) ); ?>" aria-label="<?php esc_attr_e( 'Account icon link', 'astra' ); ?>" <?php echo esc_attr( $link_href . ' ' . $new_tab . ' ' . $link_rel ); ?> >
<?php if ( 'icon' === $logged_out_style ) { ?>
<?php echo self::fetch_svg_icon( $icon_skin ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php
} elseif ( 'text' === $logged_out_style ) {
if ( 'icon' === $extend_text_profile_type ) {
echo self::fetch_svg_icon( $icon_skin ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
<span class="ast-header-account-text"><?php echo esc_html( $logged_out_text ); ?></span>
<?php } ?>
</a>
<?php
/**
* The login popup form is moved to footer from here @since 4.6.12
*
* @see Astra Addon -> Astra_Addon_Header_Account_Markup::login_popup_form_markup
*/
?>
<?php } ?>
</div>
<?php
}
}
}
?>

View File

@@ -0,0 +1,132 @@
<?php
/**
* Astra Builder Widget Controller.
*
* @package astra-builder
*/
// No direct access, please.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Astra_Builder_Widget_Controller' ) ) {
/**
* Class Astra_Builder_Widget_Controller.
*/
final class Astra_Builder_Widget_Controller {
/**
* Member Variable
*
* @var mixed instance
*/
private static $instance = null;
/**
* Initiator
*/
public static function get_instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor
*/
public function __construct() {
add_action( 'widgets_init', array( $this, 'widget_init' ) );
add_filter( 'customize_section_active', array( $this, 'display_sidebar' ), 99, 2 );
}
/**
* Display sidebar as section.
*
* @param bool $active ios active.
* @param object $section section.
* @return bool
*/
public function display_sidebar( $active, $section ) {
if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) {
return $active;
}
if ( strpos( $section->id, 'widgets-footer-widget-' ) || strpos( $section->id, 'widgets-header-widget-' ) ) {
$active = true;
}
return $active;
}
/**
* Initiate Astra Widgets.
*/
public function widget_init() {
if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) {
return;
}
// Register Footer Widgets.
$component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_footer_widgets;
for ( $index = 1; $index <= $component_limit; $index++ ) {
if ( ! is_customize_preview() && ! Astra_Builder_Helper::is_component_loaded( 'widget-' . $index, 'footer' ) ) {
continue;
}
$this->register_sidebar( $index, 'footer' );
}
$component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_widgets;
for ( $index = 1; $index <= $component_limit; $index++ ) {
if ( ! is_customize_preview() && ! Astra_Builder_Helper::is_component_loaded( 'widget-' . $index, 'header' ) ) {
continue;
}
$this->register_sidebar( $index, 'header' );
}
}
/**
* Register widget for the builder.
*
* @param integer $index index of widget.
* @param string $builder_type builder type.
*/
public function register_sidebar( $index, $builder_type = 'header' ) {
register_sidebar(
apply_filters(
'astra_' . $builder_type . '_widget_' . $index . 'args',
array(
'name' => ucfirst( $builder_type ) . ' Builder Widget ' . $index,
'id' => $builder_type . '-widget-' . $index,
'description' => esc_html__( 'Add widgets here:', 'astra' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
)
);
}
}
/**
* Prepare if class 'Astra_Builder_Widget_Controller' exist.
* Kicking this off by calling 'get_instance()' method
*/
Astra_Builder_Widget_Controller::get_instance();
}

View File

@@ -0,0 +1,284 @@
<?php
/**
* Astra Builder Loader.
*
* @package astra-builder
*/
// No direct access, please.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Astra_Builder_Footer' ) ) {
/**
* Class Astra_Builder_Footer.
*/
final class Astra_Builder_Footer {
/**
* Member Variable
*
* @var mixed instance
*/
private static $instance = null;
/**
* Dynamic Methods.
*
* @var array dynamic methods
*/
private static $methods = array();
/**
* Initiator
*/
public static function get_instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor
*/
public function __construct() {
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
$this->remove_existing_actions();
// Footer Builder.
add_action( 'astra_footer', array( $this, 'footer_markup' ), 10 );
add_action( 'astra_above_footer', array( $this, 'above_footer' ), 10 );
add_action( 'astra_primary_footer', array( $this, 'primary_footer' ), 10 );
add_action( 'astra_below_footer', array( $this, 'below_footer' ), 10 );
add_action( 'astra_render_footer_column', array( $this, 'render_column' ), 10, 2 );
// Core Components.
add_action( 'astra_footer_copyright', array( $this, 'footer_copyright' ), 10 );
for ( $index = 1; $index <= Astra_Builder_Helper::$component_limit; $index++ ) {
// Buttons.
add_action( 'astra_footer_button_' . $index, array( $this, 'button_' . $index ) );
self::$methods[] = 'button_' . $index;
// Htmls.
add_action( 'astra_footer_html_' . $index, array( $this, 'footer_html_' . $index ) );
self::$methods[] = 'footer_html_' . $index;
// Social Icons.
add_action( 'astra_footer_social_' . $index, array( $this, 'footer_social_' . $index ) );
self::$methods[] = 'footer_social_' . $index;
}
// Navigation menu.
add_action( 'astra_footer_menu', array( $this, 'footer_menu' ) );
}
}
/**
* Callback when method not exists.
*
* @param string $func function name.
* @param array $params function parameters.
*/
public function __call( $func, $params ) {
if ( in_array( $func, self::$methods, true ) ) {
if ( 0 === strpos( $func, 'footer_html_' ) ) {
Astra_Builder_UI_Controller::render_html_markup( str_replace( '_', '-', $func ) );
} elseif ( 0 === strpos( $func, 'button_' ) ) {
$index = (int) substr( $func, strrpos( $func, '_' ) + 1 );
if ( $index ) {
Astra_Builder_UI_Controller::render_button( $index, 'footer' );
}
} elseif ( 0 === strpos( $func, 'footer_social_' ) ) {
$index = (int) substr( $func, strrpos( $func, '_' ) + 1 );
if ( $index ) {
Astra_Builder_UI_Controller::render_social_icon( $index, 'footer' );
}
}
}
}
/**
* Remove existing Footer to load Footer Builder.
*
* @since 3.0.0
* @return void
*/
public function remove_existing_actions() {
remove_action( 'astra_footer_content_top', 'astra_footer_content_top' );
remove_action( 'astra_footer_content', 'astra_advanced_footer_markup', 1 );
remove_action( 'astra_footer_content', 'astra_footer_small_footer_template', 5 );
remove_action( 'astra_footer_content_bottom', 'astra_footer_content_bottom' );
remove_action( 'astra_footer', 'astra_footer_markup' );
}
/**
* Astra Footer Markup.
*/
public function footer_markup() {
$display_footer = get_post_meta( get_the_ID(), 'footer-sml-layout', true );
$display_footer = apply_filters( 'astra_footer_bar_display', $display_footer );
if ( 'disabled' !== $display_footer ) {
get_template_part( 'template-parts/footer/builder/desktop-builder-layout' );
}
}
/**
* Call above footer UI.
*/
public function above_footer() {
if ( astra_wp_version_compare( '5.4.99', '>=' ) ) {
get_template_part(
'template-parts/footer/builder/footer',
'row',
array(
'row' => 'above',
)
);
} else {
set_query_var( 'row', 'above' );
get_template_part( 'template-parts/footer/builder/footer', 'row' );
}
}
/**
* Call primary footer UI.
*/
public function primary_footer() {
if ( astra_wp_version_compare( '5.4.99', '>=' ) ) {
get_template_part(
'template-parts/footer/builder/footer',
'row',
array(
'row' => 'primary',
)
);
} else {
set_query_var( 'row', 'primary' );
get_template_part( 'template-parts/footer/builder/footer', 'row' );
}
}
/**
* Call below footer UI.
*/
public function below_footer() {
if ( astra_wp_version_compare( '5.4.99', '>=' ) ) {
get_template_part(
'template-parts/footer/builder/footer',
'row',
array(
'row' => 'below',
)
);
} else {
set_query_var( 'row', 'below' );
get_template_part( 'template-parts/footer/builder/footer', 'row' );
}
}
/**
* Call component footer UI.
*
* @param string $row row.
* @param string $column column.
*/
public function render_column( $row, $column ) {
Astra_Builder_Helper::render_builder_markup( $row, $column, 'desktop', 'footer' );
}
/**
* Render Footer Copyright Markup!
*/
public function footer_copyright() {
$theme_author = astra_get_theme_author_details();
$content = astra_get_i18n_option( 'footer-copyright-editor', _x( '%astra%', 'Footer Builder: Copyright Editor Text', 'astra' ) );
if ( $content || is_customize_preview() ) {
echo '<div class="ast-footer-copyright">';
$content = str_replace( '[copyright]', '&copy;', $content );
$content = str_replace( '[current_year]', gmdate( 'Y' ), $content );
$content = str_replace( '[site_title]', get_bloginfo( 'name' ), $content );
$content = str_replace( '[theme_author]', '<a href="' . esc_url( $theme_author['theme_author_url'] ) . '" rel="nofollow noopener" target="_blank">' . $theme_author['theme_name'] . '</a>', $content );
echo do_shortcode( wp_kses_post( wpautop( $content ) ) );
echo '</div>';
}
}
/**
* Render HTML 1.
*/
public function footer_html_1() {
Astra_Builder_UI_Controller::render_html_markup( 'footer-html-1' );
}
/**
* Render HTML 2.
*/
public function footer_html_2() {
Astra_Builder_UI_Controller::render_html_markup( 'footer-html-2' );
}
/**
* Render HTML 3.
*/
public function footer_html_3() {
Astra_Builder_UI_Controller::render_html_markup( 'footer-html-3' );
}
/**
* Render HTML 4.
*/
public function footer_html_4() {
Astra_Builder_UI_Controller::render_html_markup( 'footer-html-4' );
}
/**
* Render Menu.
*/
public function footer_menu() {
Astra_Footer_Menu_Component::menu_markup();
}
}
/**
* Prepare if class 'Astra_Builder_Footer' exist.
* Kicking this off by calling 'get_instance()' method
*/
Astra_Builder_Footer::get_instance();
}

View File

@@ -0,0 +1,478 @@
<?php
/**
* Astra Builder Loader.
*
* @package astra-builder
*/
// No direct access, please.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Astra_Builder_Header' ) ) {
/**
* Class Astra_Builder_Header.
*/
final class Astra_Builder_Header {
/**
* Member Variable
*
* @var mixed instance
*/
private static $instance = null;
/**
* Dynamic Methods.
*
* @var array dynamic methods
*/
private static $methods = array();
/**
* Initiator
*
* @return object initialized Astra_Builder_Header class
*/
public static function get_instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor
*/
public function __construct() {
add_action( 'astra_header', array( $this, 'global_astra_header' ), 0 );
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
$this->remove_existing_actions();
add_action( 'body_class', array( $this, 'add_body_class' ) );
// Header Desktop Builder.
add_action( 'astra_masthead', array( $this, 'desktop_header' ) );
add_action( 'astra_above_header', array( $this, 'above_header' ) );
add_action( 'astra_primary_header', array( $this, 'primary_header' ) );
add_action( 'astra_below_header', array( $this, 'below_header' ) );
add_action( 'astra_render_header_column', array( $this, 'render_column' ), 10, 2 );
// Mobile Builder.
add_action( 'astra_mobile_header', array( $this, 'mobile_header' ) );
add_action( 'astra_mobile_above_header', array( $this, 'mobile_above_header' ) );
add_action( 'astra_mobile_primary_header', array( $this, 'mobile_primary_header' ) );
add_action( 'astra_mobile_below_header', array( $this, 'mobile_below_header' ) );
add_action( 'astra_render_mobile_header_column', array( $this, 'render_mobile_column' ), 10, 2 );
// Load Off-Canvas Markup on Footer.
add_action( 'astra_footer', array( $this, 'mobile_popup' ) );
add_action( 'astra_mobile_header_content', array( $this, 'render_mobile_column' ), 10, 2 );
add_action( 'astra_render_mobile_popup', array( $this, 'render_mobile_column' ), 10, 2 );
for ( $index = 1; $index <= Astra_Builder_Helper::$component_limit; $index++ ) {
// Buttons.
add_action( 'astra_header_button_' . $index, array( $this, 'button_' . $index ) );
self::$methods[] = 'button_' . $index;
// Htmls.
add_action( 'astra_header_html_' . $index, array( $this, 'header_html_' . $index ) );
self::$methods[] = 'header_html_' . $index;
// Social Icons.
add_action( 'astra_header_social_' . $index, array( $this, 'header_social_' . $index ) );
self::$methods[] = 'header_social_' . $index;
// Menus.
add_action( 'astra_header_menu_' . $index, array( $this, 'menu_' . $index ) );
self::$methods[] = 'menu_' . $index;
}
add_action( 'astra_mobile_site_identity', __CLASS__ . '::site_identity' );
add_action( 'astra_header_search', array( $this, 'header_search' ), 10, 1 );
add_action( 'astra_header_woo_cart', array( $this, 'header_woo_cart' ), 10, 1 );
add_action( 'astra_header_edd_cart', array( $this, 'header_edd_cart' ) );
add_action( 'astra_header_account', array( $this, 'header_account' ) );
add_action( 'astra_header_mobile_trigger', array( $this, 'header_mobile_trigger' ) );
// Load Cart Flyout Markup on Footer.
add_action( 'astra_footer', array( $this, 'mobile_cart_flyout' ) );
add_action( 'astra_header_menu_mobile', array( $this, 'header_mobile_menu_markup' ) );
}
add_action( 'astra_site_identity', __CLASS__ . '::site_identity' );
}
/**
* Callback when method not exists.
*
* @param string $func function name.
* @param array $params function parameters.
*/
public function __call( $func, $params ) {
if ( in_array( $func, self::$methods, true ) ) {
if ( 0 === strpos( $func, 'header_html_' ) ) {
Astra_Builder_UI_Controller::render_html_markup( str_replace( '_', '-', $func ) );
} elseif ( 0 === strpos( $func, 'button_' ) ) {
$index = (int) substr( $func, strrpos( $func, '_' ) + 1 );
if ( $index ) {
Astra_Builder_UI_Controller::render_button( $index, 'header' );
}
} elseif ( 0 === strpos( $func, 'menu_' ) ) {
$index = (int) substr( $func, strrpos( $func, '_' ) + 1 );
if ( $index ) {
Astra_Header_Menu_Component::menu_markup( $index, $params['0'] );
}
} elseif ( 0 === strpos( $func, 'header_social_' ) ) {
$index = (int) substr( $func, strrpos( $func, '_' ) + 1 );
if ( $index ) {
Astra_Builder_UI_Controller::render_social_icon( $index, 'header' );
}
}
}
}
/**
* Remove complete header Support on basis of meta option.
*
* @since 3.8.0
* @return void
*/
public function global_astra_header() {
$display = get_post_meta( absint( astra_get_post_id() ), 'ast-global-header-display', true );
$display = apply_filters( 'astra_header_display', $display );
if ( 'disabled' === $display ) {
remove_action( 'astra_header', 'astra_header_markup' );
/** @psalm-suppress DocblockTypeContradiction */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { // phpcs:ignore PHPCompatibility.Keywords.NewKeywords.t_namespaceFound, PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound
remove_action( 'astra_header', array( $this, 'header_builder_markup' ) ); // phpcs:ignore PHPCompatibility.Keywords.NewKeywords.t_namespaceFound, PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound
}
}
}
/**
* Inherit Header base layout.
* Do all actions for header.
*/
public function header_builder_markup() {
do_action( 'astra_header' );
}
/**
* Remove existing Header to load Header Builder.
*
* @since 3.0.0
* @return void
*/
public function remove_existing_actions() {
remove_action( 'astra_masthead', 'astra_masthead_primary_template' );
remove_action( 'astra_masthead_content', 'astra_primary_navigation_markup', 10 );
remove_filter( 'wp_page_menu_args', 'astra_masthead_custom_page_menu_items', 10, 2 );
remove_filter( 'wp_nav_menu_items', 'astra_masthead_custom_nav_menu_items' );
}
/**
* Header Mobile trigger
*/
public function header_mobile_trigger() {
Astra_Builder_UI_Controller::render_mobile_trigger();
}
/**
* Render WooCommerce Cart.
*
* @param string $device Either 'mobile' or 'desktop' option.
*/
public function header_woo_cart( $device = 'desktop' ) {
if ( class_exists( 'Astra_Woocommerce' ) ) {
echo Astra_Woocommerce::get_instance()->woo_mini_cart_markup( $device ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
/**
* Render EDD Cart.
*/
public function header_edd_cart() {
if ( class_exists( 'Easy_Digital_Downloads' ) ) {
echo Astra_Edd::get_instance()->edd_mini_cart_markup(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
/**
* Render account icon.
*/
public function header_account() {
Astra_Builder_UI_Controller::render_account();
}
/**
* Render Search icon.
*
* @param string $device Device name.
*/
public function header_search( $device = 'desktop' ) {
echo astra_get_search( '', $device ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Render site logo.
*
* @param string $device Device name.
*/
public static function site_identity( $device = 'desktop' ) {
Astra_Builder_UI_Controller::render_site_identity( $device );
}
/**
* Call component header UI.
*
* @param string $row row.
* @param string $column column.
*/
public function render_column( $row, $column ) {
Astra_Builder_Helper::render_builder_markup( $row, $column, 'desktop', 'header' );
}
/**
* Render desktop header layout.
*/
public function desktop_header() {
get_template_part( 'template-parts/header/builder/desktop-builder-layout' );
}
/**
* Call above header UI.
*/
public function above_header() {
$display = is_singular() ? get_post_meta( get_the_ID(), 'ast-hfb-above-header-display', true ) : true;
$display = apply_filters( 'astra_above_header_display', $display );
if ( 'disabled' !== $display ) {
if ( astra_wp_version_compare( '5.4.99', '>=' ) ) {
get_template_part(
'template-parts/header/builder/header',
'row',
array(
'row' => 'above',
)
);
} else {
set_query_var( 'row', 'above' );
get_template_part( 'template-parts/header/builder/header', 'row' );
}
}
}
/**
* Call primary header UI.
*/
public function primary_header() {
$display = is_singular() ? get_post_meta( get_the_ID(), 'ast-main-header-display', true ) : true;
$display = apply_filters( 'astra_main_header_display', $display );
if ( 'disabled' !== $display ) {
if ( astra_wp_version_compare( '5.4.99', '>=' ) ) {
get_template_part(
'template-parts/header/builder/header',
'row',
array(
'row' => 'primary',
)
);
} else {
set_query_var( 'row', 'primary' );
get_template_part( 'template-parts/header/builder/header', 'row' );
}
}
}
/**
* Call below header UI.
*/
public function below_header() {
$display = is_singular() ? get_post_meta( get_the_ID(), 'ast-hfb-below-header-display', true ) : true;
$display = apply_filters( 'astra_below_header_display', $display );
if ( 'disabled' !== $display ) {
if ( astra_wp_version_compare( '5.4.99', '>=' ) ) {
get_template_part(
'template-parts/header/builder/header',
'row',
array(
'row' => 'below',
)
);
} else {
set_query_var( 'row', 'below' );
get_template_part( 'template-parts/header/builder/header', 'row' );
}
}
}
/**
* Call mobile component header UI.
*
* @param string $row row.
* @param string $column column.
*/
public function render_mobile_column( $row, $column ) {
Astra_Builder_Helper::render_builder_markup( $row, $column, 'mobile', 'header' );
}
/**
* Render Mobile header layout.
*/
public function mobile_header() {
get_template_part( 'template-parts/header/builder/mobile-builder-layout' );
}
/**
* Call Mobile above header UI.
*/
public function mobile_above_header() {
$display = is_singular() ? get_post_meta( get_the_ID(), 'ast-hfb-mobile-header-display', true ) : true;
$display = apply_filters( 'astra_above_mobile_header_display', $display );
if ( 'disabled' !== $display ) {
if ( astra_wp_version_compare( '5.4.99', '>=' ) ) {
get_template_part(
'template-parts/header/builder/mobile-header',
'row',
array(
'row' => 'above',
)
);
} else {
set_query_var( 'row', 'above' );
get_template_part( 'template-parts/header/builder/mobile-header', 'row' );
}
}
}
/**
* Call Mobile primary header UI.
*/
public function mobile_primary_header() {
$display = is_singular() ? get_post_meta( get_the_ID(), 'ast-hfb-mobile-header-display', true ) : true;
$display = apply_filters( 'astra_primary_mobile_header_display', $display );
if ( 'disabled' !== $display ) {
if ( astra_wp_version_compare( '5.4.99', '>=' ) ) {
get_template_part(
'template-parts/header/builder/mobile-header',
'row',
array(
'row' => 'primary',
)
);
} else {
set_query_var( 'row', 'primary' );
get_template_part( 'template-parts/header/builder/mobile-header', 'row' );
}
}
}
/**
* Call Mobile below header UI.
*/
public function mobile_below_header() {
$display = is_singular() ? get_post_meta( absint( astra_get_post_id() ), 'ast-hfb-mobile-header-display', true ) : true;
$display = apply_filters( 'astra_below_mobile_header_display', $display );
if ( 'disabled' !== $display ) {
if ( astra_wp_version_compare( '5.4.99', '>=' ) ) {
get_template_part(
'template-parts/header/builder/mobile-header',
'row',
array(
'row' => 'below',
)
);
} else {
set_query_var( 'row', 'below' );
get_template_part( 'template-parts/header/builder/mobile-header', 'row' );
}
}
}
/**
* Call Mobile Popup UI.
*/
public function mobile_popup() {
if ( apply_filters( 'astra_disable_mobile_popup_markup', false ) ) {
return;
}
$mobile_header_type = astra_get_option( 'mobile-header-type' );
if ( 'off-canvas' === $mobile_header_type || 'full-width' === $mobile_header_type || is_customize_preview() ) {
Astra_Builder_Helper::render_mobile_popup_markup();
}
}
/**
* Call Mobile Menu Markup.
*
* @param string $device Checking where mobile-menu is dropped.
*/
public function header_mobile_menu_markup( $device = '' ) {
Astra_Mobile_Menu_Component::menu_markup( $device );
}
/**
* Call Mobile Cart Flyout UI.
*/
public function mobile_cart_flyout() {
// Get the responsive cart click action setting.
$responsive_cart_action = astra_get_option( 'responsive-cart-click-action' );
$desktop_cart_action = astra_get_option( 'woo-header-cart-click-action' );
// Hide cart flyout only if current page is checkout/cart or if redirect option is selected.
if (
(
Astra_Builder_Helper::is_component_loaded( 'woo-cart', 'header' ) &&
class_exists( 'WooCommerce' ) &&
! is_cart() &&
! is_checkout() &&
( 'redirect' !== $responsive_cart_action || // Prevent flyout markup when 'redirect' option is selected.
'redirect' !== $desktop_cart_action )
) || Astra_Builder_Helper::is_component_loaded( 'edd-cart', 'header' )
) {
Astra_Builder_UI_Controller::render_mobile_cart_flyout_markup();
}
}
/**
* Add Body Classes
*
* @param array $classes Body Class Array.
* @return array
*/
public function add_body_class( $classes ) {
$classes[] = 'ast-hfb-header';
if ( defined( 'ASTRA_EXT_VER' ) && version_compare( ASTRA_EXT_VER, '3.2.0', '<' ) ) {
$classes[] = 'astra-hfb-header';
}
return $classes;
}
}
/**
* Prepare if class 'Astra_Builder_Header' exist.
* Kicking this off by calling 'get_instance()' method
*/
Astra_Builder_Header::get_instance();
}

Some files were not shown because too many files have changed in this diff Show More