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,84 @@
<?php
/**
* Astra Icons - Dynamic CSS.
*
* @package astra
* @since 3.5.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
add_filter( 'astra_dynamic_theme_css', 'astra_icons_static_css' );
/**
* Astra Icons - Dynamic CSS.
*
* @param string $dynamic_css Dynamic CSS.
* @since 3.5.0
*/
function astra_icons_static_css( $dynamic_css ) {
if ( false === Astra_Icons::is_svg_icons() ) {
$astra_icons = '
.astra-icon-down_arrow::after {
content: "\e900";
font-family: Astra;
}
.astra-icon-close::after {
content: "\e5cd";
font-family: Astra;
}
.astra-icon-drag_handle::after {
content: "\e25d";
font-family: Astra;
}
.astra-icon-format_align_justify::after {
content: "\e235";
font-family: Astra;
}
.astra-icon-menu::after {
content: "\e5d2";
font-family: Astra;
}
.astra-icon-reorder::after {
content: "\e8fe";
font-family: Astra;
}
.astra-icon-search::after {
content: "\e8b6";
font-family: Astra;
}
.astra-icon-zoom_in::after {
content: "\e56b";
font-family: Astra;
}
.astra-icon-check-circle::after {
content: "\e901";
font-family: Astra;
}
.astra-icon-shopping-cart::after {
content: "\f07a";
font-family: Astra;
}
.astra-icon-shopping-bag::after {
content: "\f290";
font-family: Astra;
}
.astra-icon-shopping-basket::after {
content: "\f291";
font-family: Astra;
}
.astra-icon-circle-o::after {
content: "\e903";
font-family: Astra;
}
.astra-icon-certificate::after {
content: "\e902";
font-family: Astra;
}';
return $dynamic_css .= Astra_Enqueue_Scripts::trim_css( $astra_icons );
}
return $dynamic_css;
}

View File

@@ -0,0 +1,514 @@
<?php
/**
* Astra WordPress-5.8 compatibility - Dynamic CSS.
*
* @package astra
* @since 3.6.5
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( astra_block_based_legacy_setup() ) {
add_filter( 'astra_dynamic_theme_css', 'astra_block_editor_compatibility_css' );
} else {
add_filter( 'astra_dynamic_theme_css', 'astra_load_modern_block_editor_ui' );
}
/**
* This is new compatibillity CSS added at time 'improve-gb-editor-ui'. So requiring this for new setup as well that's why making it common.
*
* @since 3.6.5
*/
function astra_get_block_editor_required_css() {
return '
.wp-block-file {
display: flex;
align-items: center;
flex-wrap: wrap;
justify-content: space-between;
}
.wp-block-pullquote {
border: none;
}
.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;
}
.has-text-align-right > blockquote::before {
justify-content: flex-start;
}
.has-text-align-left > blockquote::before {
justify-content: flex-end;
}
figure.wp-block-pullquote.is-style-solid-color blockquote {
max-width: 100%;
text-align: inherit;
}';
}
/**
* Astra WordPress compatibility - Dynamic CSS.
*
* @param string $dynamic_css Dynamic CSS.
* @since 3.6.5
*/
function astra_block_editor_compatibility_css( $dynamic_css ) {
if ( Astra_Dynamic_CSS::is_block_editor_support_enabled() ) {
$compatibility_css = '
.wp-block-search {
margin-bottom: 20px;
}
.wp-block-site-tagline {
margin-top: 20px;
}
form.wp-block-search .wp-block-search__input, .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper {
border-color: #eaeaea;
background: #fafafa;
}
.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__input:focus, .wp-block-loginout input:focus {
outline: thin dotted;
}
.wp-block-loginout input:focus {
border-color: transparent;
}
form.wp-block-search .wp-block-search__inside-wrapper .wp-block-search__input {
padding: 12px;
}
form.wp-block-search .wp-block-search__button svg {
fill: currentColor;
width: 20px;
height: 20px;
}
.wp-block-loginout p label {
display: block;
}
.wp-block-loginout p:not(.login-remember):not(.login-submit) input {
width: 100%;
}
.wp-block-loginout .login-remember input {
width: 1.1rem;
height: 1.1rem;
margin: 0 5px 4px 0;
vertical-align: middle;
}';
$dynamic_css .= Astra_Enqueue_Scripts::trim_css( $compatibility_css );
}
/** @psalm-suppress InvalidScalarArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
if ( astra_get_option( 'improve-gb-editor-ui', true ) ) {
/** @psalm-suppress InvalidScalarArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$is_site_rtl = is_rtl();
$editor_improvement_css = astra_get_block_editor_required_css();
if ( $is_site_rtl ) {
$editor_improvement_css .= '
blockquote {
padding: 0 1.2em 1.2em;
}
.wp-block-button__link {
border: 2px solid currentColor;
}
body .wp-block-file .wp-block-file__button {
text-decoration: none;
}
ul.wp-block-categories-list.wp-block-categories, ul.wp-block-archives-list.wp-block-archives {
list-style-type: none;
}
ul, ol {
margin-right: 20px;
}
figure.alignright figcaption {
text-align: left;
}';
} else {
$editor_improvement_css .= '
blockquote {
padding: 0 1.2em 1.2em;
}
.wp-block-button__link {
border: 2px solid currentColor;
}
body .wp-block-file .wp-block-file__button {
text-decoration: none;
}
ul.wp-block-categories-list.wp-block-categories, ul.wp-block-archives-list.wp-block-archives {
list-style-type: none;
}
ul, ol {
margin-left: 20px;
}
figure.alignright figcaption {
text-align: right;
}';
}
} else {
$editor_improvement_css = '
blockquote {
padding: 1.2em;
}
';
}
$dynamic_css .= Astra_Enqueue_Scripts::trim_css( $editor_improvement_css );
return $dynamic_css;
}
/**
* Astra block editor 2.0 Spectra compatibility - Dynamic CSS.
*
* @param string $dynamic_css Dynamic CSS.
* @return string $dynamic_css Dynamic CSS.
*
* @since 3.8.0
*/
function astra_load_modern_block_editor_ui( $dynamic_css ) {
$dynamic_css .= astra_get_block_editor_required_css();
$ltr_left = is_rtl() ? 'right' : 'left';
$ltr_right = is_rtl() ? 'left' : 'right';
$astra_block_editor_v2_ui = astra_get_option( 'wp-blocks-v2-ui', true );
$ast_container_width = astra_get_option( 'site-content-width', 1200 ) . 'px';
$blocks_spacings = Astra_WP_Editor_CSS::astra_get_block_spacings();
$list_blocks_space = astra_get_option( 'list-blocks-spacing', true );
/** @psalm-suppress InvalidCast */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$tablet_breakpoint = (string) astra_get_tablet_breakpoint();
/** @psalm-suppress InvalidCast */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
/** @psalm-suppress InvalidCast */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$mobile_breakpoint = (string) astra_get_mobile_breakpoint();
/** @psalm-suppress InvalidCast */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$desktop_top_spacing = isset( $blocks_spacings['desktop']['top'] ) ? $blocks_spacings['desktop']['top'] : '';
$desktop_right_spacing = isset( $blocks_spacings['desktop']['right'] ) ? $blocks_spacings['desktop']['right'] : '';
$desktop_bottom_spacing = isset( $blocks_spacings['desktop']['bottom'] ) ? $blocks_spacings['desktop']['bottom'] : '';
$desktop_left_spacing = isset( $blocks_spacings['desktop']['left'] ) ? $blocks_spacings['desktop']['left'] : '';
$tablet_top_spacing = isset( $blocks_spacings['tablet']['top'] ) ? $blocks_spacings['tablet']['top'] : '';
$tablet_right_spacing = isset( $blocks_spacings['tablet']['right'] ) ? $blocks_spacings['tablet']['right'] : '';
$tablet_bottom_spacing = isset( $blocks_spacings['tablet']['bottom'] ) ? $blocks_spacings['tablet']['bottom'] : '';
$tablet_left_spacing = isset( $blocks_spacings['tablet']['left'] ) ? $blocks_spacings['tablet']['left'] : '';
$mobile_top_spacing = isset( $blocks_spacings['mobile']['top'] ) ? $blocks_spacings['mobile']['top'] : '';
$mobile_right_spacing = isset( $blocks_spacings['mobile']['right'] ) ? $blocks_spacings['mobile']['right'] : '';
$mobile_bottom_spacing = isset( $blocks_spacings['mobile']['bottom'] ) ? $blocks_spacings['mobile']['bottom'] : '';
$mobile_left_spacing = isset( $blocks_spacings['mobile']['left'] ) ? $blocks_spacings['mobile']['left'] : '';
$ast_content_width = apply_filters( 'astra_block_content_width', $astra_block_editor_v2_ui ? $ast_container_width : '910px' );
$ast_wide_width = apply_filters( 'astra_block_wide_width', $astra_block_editor_v2_ui ? 'calc(' . esc_attr( $ast_container_width ) . ' + var(--wp--custom--ast-default-block-left-padding) + var(--wp--custom--ast-default-block-right-padding))' : $ast_container_width );
$ast_narrow_width = astra_get_option( 'narrow-container-max-width', apply_filters( 'astra_narrow_container_width', 750 ) ) . 'px';
// Spectra Compatibility - page title alignment with page container layouts.
$spectra_gutenberg_compat_css = Astra_Dynamic_CSS::spectra_gutenberg_compat_css();
$v4_block_editor_compat = Astra_Dynamic_CSS::v4_block_editor_compat();
$dynamic_css .= '
:root {
--wp--custom--ast-default-block-top-padding: ' . $desktop_top_spacing . ';
--wp--custom--ast-default-block-right-padding: ' . $desktop_right_spacing . ';
--wp--custom--ast-default-block-bottom-padding: ' . $desktop_bottom_spacing . ';
--wp--custom--ast-default-block-left-padding: ' . $desktop_left_spacing . ';
--wp--custom--ast-container-width: ' . $ast_container_width . ';
--wp--custom--ast-content-width-size: ' . $ast_content_width . ';
--wp--custom--ast-wide-width-size: ' . $ast_wide_width . ';
}
.ast-narrow-container {
--wp--custom--ast-content-width-size: ' . $ast_narrow_width . ';
--wp--custom--ast-wide-width-size: ' . $ast_narrow_width . ';
}
@media(max-width: ' . $tablet_breakpoint . 'px) {
:root {
--wp--custom--ast-default-block-top-padding: ' . $tablet_top_spacing . ';
--wp--custom--ast-default-block-right-padding: ' . $tablet_right_spacing . ';
--wp--custom--ast-default-block-bottom-padding: ' . $tablet_bottom_spacing . ';
--wp--custom--ast-default-block-left-padding: ' . $tablet_left_spacing . ';
}
}
@media(max-width: ' . $mobile_breakpoint . 'px) {
:root {
--wp--custom--ast-default-block-top-padding: ' . $mobile_top_spacing . ';
--wp--custom--ast-default-block-right-padding: ' . $mobile_right_spacing . ';
--wp--custom--ast-default-block-bottom-padding: ' . $mobile_bottom_spacing . ';
--wp--custom--ast-default-block-left-padding: ' . $mobile_left_spacing . ';
}
}
';
$astra_wide_particular_selector = $astra_block_editor_v2_ui ? '.entry-content[data-ast-blocks-layout] > .alignwide' : '.entry-content[data-ast-blocks-layout] > .alignwide, .entry-content[data-ast-blocks-layout] .wp-block-cover__inner-container, .entry-content[data-ast-blocks-layout] > p';
$astra_full_stretched_selector = $astra_block_editor_v2_ui ? '.ast-plain-container.ast-no-sidebar .entry-content > .alignfull, .ast-page-builder-template .ast-no-sidebar .entry-content > .alignfull' : '.ast-plain-container.ast-no-sidebar .entry-content .alignfull, .ast-page-builder-template .ast-no-sidebar .entry-content .alignfull';
$dynamic_css .= '
.entry-content > .wp-block-group, .entry-content > .wp-block-cover, .entry-content > .wp-block-columns {
padding-top: var(--wp--custom--ast-default-block-top-padding);
padding-right: var(--wp--custom--ast-default-block-right-padding);
padding-bottom: var(--wp--custom--ast-default-block-bottom-padding);
padding-left: var(--wp--custom--ast-default-block-left-padding);
}
' . $astra_full_stretched_selector . ' {
margin-left: calc( -50vw + 50%);
margin-right: calc( -50vw + 50%);
max-width: 100vw;
width: 100vw;
}
.ast-plain-container.ast-no-sidebar .entry-content .alignfull .alignfull, .ast-page-builder-template.ast-no-sidebar .entry-content .alignfull .alignfull, .ast-plain-container.ast-no-sidebar .entry-content .alignfull .alignwide, .ast-page-builder-template.ast-no-sidebar .entry-content .alignfull .alignwide, .ast-plain-container.ast-no-sidebar .entry-content .alignwide .alignfull, .ast-page-builder-template.ast-no-sidebar .entry-content .alignwide .alignfull,
.ast-plain-container.ast-no-sidebar .entry-content .alignwide .alignwide, .ast-page-builder-template.ast-no-sidebar .entry-content .alignwide .alignwide, .ast-plain-container.ast-no-sidebar .entry-content .wp-block-column .alignfull, .ast-page-builder-template.ast-no-sidebar .entry-content .wp-block-column .alignfull,
.ast-plain-container.ast-no-sidebar .entry-content .wp-block-column .alignwide, .ast-page-builder-template.ast-no-sidebar .entry-content .wp-block-column .alignwide {
margin-left: auto;
margin-right: auto;
width: 100%;
}
[data-ast-blocks-layout] .wp-block-separator:not(.is-style-dots) {
height: 0;
}
[data-ast-blocks-layout] .wp-block-separator {
margin: 20px auto;
}
[data-ast-blocks-layout] .wp-block-separator:not(.is-style-wide):not(.is-style-dots) {
max-width: 100px;
}
[data-ast-blocks-layout] .wp-block-separator.has-background {
padding: 0;
}
.entry-content[data-ast-blocks-layout] > * {
max-width: var(--wp--custom--ast-content-width-size);
margin-left: auto;
margin-right: auto;
}
' . $astra_wide_particular_selector . ' {
max-width: var(--wp--custom--ast-wide-width-size);
}
.entry-content[data-ast-blocks-layout] .alignfull {
max-width: none;
}
.entry-content .wp-block-columns {
margin-bottom: 0;
}
blockquote {
margin: 1.5em;
border-color: rgba(0,0,0,0.05);
}
.wp-block-quote:not(.has-text-align-right):not(.has-text-align-center) {
border-' . esc_attr( $ltr_left ) . ': 5px solid rgba(0, 0, 0, 0.05);
}
.has-text-align-right > blockquote, blockquote.has-text-align-right {
border-' . esc_attr( $ltr_right ) . ': 5px solid rgba(0, 0, 0, 0.05);
}
.has-text-align-left > blockquote, blockquote.has-text-align-left {
border-' . esc_attr( $ltr_left ) . ': 5px solid rgba(0, 0, 0, 0.05);
}
.wp-block-site-tagline, .wp-block-latest-posts .read-more {
margin-top: 15px;
}
.wp-block-loginout p label {
display: block;
}
.wp-block-loginout p:not(.login-remember):not(.login-submit) input {
width: 100%;
}
.wp-block-loginout input:focus {
border-color: transparent;
}
.wp-block-loginout input:focus {
outline: thin dotted;
}
.entry-content .wp-block-media-text .wp-block-media-text__content {
padding: 0 0 0 8%;
}
.entry-content .wp-block-media-text.has-media-on-the-right .wp-block-media-text__content {
padding: 0 8% 0 0;
}
.entry-content .wp-block-media-text.has-background .wp-block-media-text__content {
padding: 8%;
}
.entry-content .wp-block-cover:not([class*="background-color"]) .wp-block-cover__inner-container, .entry-content .wp-block-cover:not([class*="background-color"]) .wp-block-cover-image-text, .entry-content .wp-block-cover:not([class*="background-color"]) .wp-block-cover-text, .entry-content .wp-block-cover-image:not([class*="background-color"]) .wp-block-cover__inner-container, .entry-content .wp-block-cover-image:not([class*="background-color"]) .wp-block-cover-image-text, .entry-content .wp-block-cover-image:not([class*="background-color"]) .wp-block-cover-text {
color: var(--ast-global-color-5);
}
.wp-block-loginout .login-remember input {
width: 1.1rem;
height: 1.1rem;
margin: 0 5px 4px 0;
vertical-align: middle;
}
.wp-block-latest-posts > li > *:first-child, .wp-block-latest-posts:not(.is-grid) > li:first-child {
margin-top: 0;
}
.entry-content > .wp-block-buttons,
.entry-content > .wp-block-uagb-buttons {
margin-bottom: 1.5em;
}
';
if ( $astra_block_editor_v2_ui ) {
$single_post_continer_spacing = astra_get_option( 'single-post-inside-spacing' );
$container_lg_spacing = ( true === astra_check_is_structural_setup() ) ? '3' : '6.67';
$astra_continer_left_spacing = defined( 'ASTRA_EXT_VER' ) && astra_responsive_spacing( $single_post_continer_spacing, 'left', 'desktop' ) ? astra_responsive_spacing( $single_post_continer_spacing, 'left', 'desktop', $container_lg_spacing ) : 'var(--ast-container-default-xlg-padding)';
$astra_continer_right_spacing = defined( 'ASTRA_EXT_VER' ) && astra_responsive_spacing( $single_post_continer_spacing, 'right', 'desktop' ) ? astra_responsive_spacing( $single_post_continer_spacing, 'right', 'desktop', $container_lg_spacing ) : 'var(--ast-container-default-xlg-padding)';
$astra_1200_continer_left_spacing = defined( 'ASTRA_EXT_VER' ) && astra_responsive_spacing( $single_post_continer_spacing, 'left', 'desktop' ) ? astra_responsive_spacing( $single_post_continer_spacing, 'left', 'desktop', '2.4' ) : 'var(--ast-container-default-xs-padding)';
$astra_1200_continer_right_spacing = defined( 'ASTRA_EXT_VER' ) && astra_responsive_spacing( $single_post_continer_spacing, 'right', 'desktop' ) ? astra_responsive_spacing( $single_post_continer_spacing, 'right', 'desktop', '2.4' ) : 'var(--ast-container-default-xs-padding)';
$alignwide_1200_left_negative_margin = $astra_continer_left_spacing ? 'calc(-1 * min(' . $astra_continer_left_spacing . ', 20px))' : '-20px';
$alignwide_1200_right_negative_margin = $astra_continer_right_spacing ? 'calc(-1 * min(' . $astra_continer_right_spacing . ', 20px))' : '-20px';
$heading_width_comp = Astra_Dynamic_CSS::astra_4_8_0_compatibility() ? 'none' : 'var(--wp--custom--ast-content-width-size)';
$container_margin_left_comp = Astra_Dynamic_CSS::astra_4_8_4_compatibility() ? 'auto' : 'calc(-1 * var(--wp--custom--ast-default-block-left-padding) )';
$container_margin_right_comp = Astra_Dynamic_CSS::astra_4_8_4_compatibility() ? 'auto' : 'calc(-1 * var(--wp--custom--ast-default-block-right-padding) )';
$dynamic_css .= '
.wp-block-search__inside-wrapper .wp-block-search__input {
padding: 0 10px;
color: var(--ast-global-color-3);
background: var(--ast-global-color-5);
border-color: var(--ast-border-color);
}
.wp-block-latest-posts .read-more {
margin-bottom: 1.5em;
}
.wp-block-search__no-button .wp-block-search__inside-wrapper .wp-block-search__input {
padding-top: 5px;
padding-bottom: 5px;
}
.wp-block-latest-posts .wp-block-latest-posts__post-date, .wp-block-latest-posts .wp-block-latest-posts__post-author {
font-size: 1rem;
}
.wp-block-latest-posts > li > *, .wp-block-latest-posts:not(.is-grid) > li {
margin-top: 12px;
margin-bottom: 12px;
}
.ast-page-builder-template .entry-content[data-ast-blocks-layout] > *, .ast-page-builder-template .entry-content[data-ast-blocks-layout] > .alignfull:not(.wp-block-group) > * {
max-width: none;
}
.ast-page-builder-template .entry-content[data-ast-blocks-layout] > .alignwide > * {
max-width: var(--wp--custom--ast-wide-width-size);
}
.ast-page-builder-template .entry-content[data-ast-blocks-layout] > .inherit-container-width > *, .ast-page-builder-template .entry-content[data-ast-blocks-layout] > *:not(.wp-block-group) > *, .entry-content[data-ast-blocks-layout] > .wp-block-cover .wp-block-cover__inner-container {
max-width: ' . $heading_width_comp . ' ;
margin-left: auto;
margin-right: auto;
}
.entry-content[data-ast-blocks-layout] .wp-block-cover:not(.alignleft):not(.alignright) {
width: auto;
}
@media(max-width: 1200px) {
.ast-separate-container .entry-content > .alignfull, .ast-separate-container .entry-content[data-ast-blocks-layout] > .alignwide, .ast-plain-container .entry-content[data-ast-blocks-layout] > .alignwide, .ast-plain-container .entry-content .alignfull {
margin-left: ' . $alignwide_1200_left_negative_margin . ' ;
margin-right: ' . $alignwide_1200_right_negative_margin . ';
}
}
@media(min-width: 1201px) {
.ast-separate-container .entry-content > .alignfull {
margin-left: calc(-1 * ' . $astra_continer_left_spacing . ' );
margin-right: calc(-1 * ' . $astra_continer_right_spacing . ' );
}
.ast-separate-container .entry-content[data-ast-blocks-layout] > .alignwide, .ast-plain-container .entry-content[data-ast-blocks-layout] > .alignwide {
margin-left: ' . $container_margin_left_comp . ';
margin-right: ' . $container_margin_right_comp . ';
}
}
@media(min-width: ' . $tablet_breakpoint . 'px) {
.ast-separate-container .entry-content .wp-block-group.alignwide:not(.inherit-container-width) > :where(:not(.alignleft):not(.alignright)), .ast-plain-container .entry-content .wp-block-group.alignwide:not(.inherit-container-width) > :where(:not(.alignleft):not(.alignright)) {
max-width: calc( var(--wp--custom--ast-content-width-size) + 80px );
}
.ast-plain-container.ast-right-sidebar .entry-content[data-ast-blocks-layout] .alignfull, .ast-plain-container.ast-left-sidebar .entry-content[data-ast-blocks-layout] .alignfull {
margin-left: -60px;
margin-right: -60px;
}
}
@media(min-width: ' . $mobile_breakpoint . 'px) {
.entry-content > .alignleft {
margin-' . esc_attr( $ltr_right ) . ': 20px;
}
.entry-content > .alignright {
margin-' . esc_attr( $ltr_left ) . ': 20px;
}
}
';
} else {
$dynamic_css .= '
.wp-block-latest-posts > li > a {
font-size: 28px;
}
.wp-block-latest-posts > li > *, .wp-block-latest-posts:not(.is-grid) > li {
margin-top: 15px;
margin-bottom: 15px;
}
.wp-block-latest-posts .wp-block-latest-posts__post-date, .wp-block-latest-posts .wp-block-latest-posts__post-author {
font-size: 15px;
}
';
}
$mobile_css = array(
'.wp-block-columns .wp-block-column:not(:last-child)' => array(
'margin-bottom' => '20px',
),
'.wp-block-latest-posts' => array(
'margin' => '0',
),
);
/* Parse CSS from array -> max-width(mobile-breakpoint) */
/** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$dynamic_css .= astra_parse_css( $mobile_css, '', $mobile_breakpoint );
/** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$dynamic_css .= '
@media( max-width: 600px ) {
.entry-content .wp-block-media-text .wp-block-media-text__content, .entry-content .wp-block-media-text.has-media-on-the-right .wp-block-media-text__content {
padding: 8% 0 0;
}
.entry-content .wp-block-media-text.has-background .wp-block-media-text__content {
padding: 8%;
}
}
';
// Spectra Compatibility - Container block alignment with page title for container layouts.
if ( $spectra_gutenberg_compat_css ) {
$dynamic_css .= '
.ast-page-builder-template .entry-header {
padding-' . esc_attr( $ltr_left ) . ': 0;
}
';
}
// Spectra compatibility for narrow width container.
$dynamic_css .= '
.ast-narrow-container .site-content .wp-block-uagb-image--align-full .wp-block-uagb-image__figure {
max-width: 100%;
margin-left: auto;
margin-right: auto;
}
';
$direction = is_rtl() ? 'right' : 'left';
$lists_padding = Astra_Dynamic_CSS::astra_4_6_0_compatibility() ? 'padding-' . $direction . ': 20px;' : '';
// Block editor experience improvements introduced with v4.0.0.
if ( $v4_block_editor_compat ) {
$dynamic_css .= '
.entry-content ul, .entry-content ol {
padding: revert;
margin: revert;
' . $lists_padding . '
}
';
}
return $dynamic_css;
}

View File

@@ -0,0 +1,617 @@
<?php
/**
* Comments - Dynamic CSS
*
* @package astra-builder
* @since 3.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
add_filter( 'astra_dynamic_theme_css', 'astra_comments_css', 11 );
/**
* Comments - Dynamic CSS
*
* @param string $dynamic_css Astra Dynamic CSS.
* @return String Generated dynamic CSS for Pagination.
*
* @since 3.2.0
*/
function astra_comments_css( $dynamic_css ) {
if ( astra_check_current_post_comment_enabled() || 0 < get_comments_number() ) {
$body_font_size = astra_get_option( 'font-size-body' );
$theme_color = astra_get_option( 'theme-color' );
$link_color = astra_get_option( 'link-color', $theme_color );
$is_site_rtl = is_rtl();
$reply_title_space_threshold = Astra_Dynamic_CSS::astra_4_4_0_compatibility() ? 1.3 : 1.66666;
if ( is_array( $body_font_size ) ) {
$body_font_size_desktop = ( isset( $body_font_size['desktop'] ) && '' != $body_font_size['desktop'] ) ? $body_font_size['desktop'] : 15;
} else {
$body_font_size_desktop = ( '' != $body_font_size ) ? $body_font_size : 15;
}
$desktop_comment_global = array(
'.comment-reply-title' => array(
'font-size' => astra_get_font_css_value( (int) $body_font_size_desktop * $reply_title_space_threshold ),
),
// Single Post Meta.
'.ast-comment-meta' => array(
'line-height' => '1.666666667',
'color' => esc_attr( $link_color ),
'font-size' => astra_get_font_css_value( (int) $body_font_size_desktop * 0.8571428571 ),
),
'.ast-comment-list #cancel-comment-reply-link' => array(
'font-size' => astra_responsive_font( $body_font_size, 'desktop' ),
),
);
$dynamic_css .= astra_parse_css( $desktop_comment_global );
$update_customizer_strctural_defaults = ( true === astra_check_is_structural_setup() );
$padding_comment_title = $update_customizer_strctural_defaults ? '1em 0 0' : '2em 0';
$padding_ast_comment = $update_customizer_strctural_defaults ? '0' : '1em 0';
$padding_ast_comment_list = $update_customizer_strctural_defaults ? '0' : '0.5em';
$border_color = astra_get_option( 'border-color' );
$blog_improvements = Astra_Dynamic_CSS::astra_4_6_0_compatibility();
$comments_title_css = $blog_improvements ? 'font-weight: 600; padding-bottom: 1em;' : 'font-weight: normal;';
$single_post_comment_css = '.comments-title {
padding: ' . esc_attr( $padding_comment_title ) . ';
}
.comments-title {
word-wrap: break-word;
' . $comments_title_css . '
}
.ast-comment-list {
margin: 0;
word-wrap: break-word;
padding-bottom: ' . esc_attr( $padding_ast_comment_list ) . ';
list-style: none;
}
.ast-comment-list li {
list-style: none;
}
.ast-comment-list .ast-comment-edit-reply-wrap {
-js-display: flex;
display: flex;
justify-content: flex-end;
}
.ast-comment-list .comment-awaiting-moderation {
margin-bottom: 0;
}
.ast-comment {
padding: ' . esc_attr( $padding_ast_comment ) . ' ;
}
.ast-comment-info img {
border-radius: 50%;
}
.ast-comment-cite-wrap cite {
font-style: normal;
}
.comment-reply-title {
font-weight: ' . esc_attr( Astra_Dynamic_CSS::astra_4_4_0_compatibility() ? '600' : 'normal' ) . ';
line-height: 1.65;
}
.ast-comment-meta {
margin-bottom: 0.5em;
}
.comments-area .comment-form-comment {
width: 100%;
border: none;
margin: 0;
padding: 0;
}
.comments-area .comment-notes,
.comments-area .comment-textarea,
.comments-area .form-allowed-tags {
margin-bottom: 1.5em;
}
.comments-area .form-submit {
margin-bottom: 0;
}
.comments-area textarea#comment,
.comments-area .ast-comment-formwrap input[type="text"] {
width: 100%;
border-radius: 0;
vertical-align: middle;
margin-bottom: 10px;
}
.comments-area .no-comments {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
.comments-area p.logged-in-as {
margin-bottom: 1em;
}
.ast-separate-container .ast-comment-list {
padding-bottom: 0;
}
.ast-separate-container .ast-comment-list li.depth-1 .children li, .ast-narrow-container .ast-comment-list li.depth-1 .children li {
padding-bottom: 0;
padding-top: 0;
margin-bottom: 0;
}
.ast-separate-container .ast-comment-list .comment-respond {
padding-top: 0;
padding-bottom: 1em;
background-color: transparent;
}
.ast-comment-list .comment .comment-respond {
padding-bottom: 2em;
border-bottom: none;
}
.ast-separate-container .ast-comment-list .bypostauthor, .ast-narrow-container .ast-comment-list .bypostauthor {
padding: 2em;
margin-bottom: 1em;
}
.ast-separate-container .ast-comment-list .bypostauthor li, .ast-narrow-container .ast-comment-list .bypostauthor li {
background: transparent;
margin-bottom: 0;
padding: 0 0 0 2em;
}
.comment-content a {
word-wrap: break-word;
}
.comment-form-legend {
margin-bottom: unset;
padding: 0 0.5em;
}';
if ( Astra_Dynamic_CSS::astra_4_6_0_compatibility() ) {
$single_post_comment_css .= '
.comment-reply-title {
padding-top: 0;
margin-bottom: 1em;
}
.ast-comment {
padding-top: 2.5em;
padding-bottom: 2.5em;
border-top: 1px solid var(--ast-single-post-border, var(--ast-border-color));
}
.ast-separate-container .ast-comment-list .comment + .comment,
.ast-narrow-container .ast-comment-list .comment + .comment {
padding-top: 0;
padding-bottom: 0;
}
';
$is_boxed = astra_is_content_style_boxed();
$content_layout = astra_get_content_layout();
$post_with_boxed_layout = ( 'plain-container' === $content_layout || 'narrow-container' === $content_layout ) && $is_boxed ? true : false;
if ( $post_with_boxed_layout && 'inside' !== astra_get_option( 'comments-box-placement', '' ) ) {
$single_post_comment_css .= '
.ast-separate-container .ast-comment-list li.depth-1, .ast-narrow-container .ast-comment-list li.depth-1 {
padding-left: 2.5em;
padding-right: 2.5em;
}
';
}
} else {
$single_post_comment_css .= '
.ast-separate-container .ast-comment-list .pingback p {
margin-bottom: 0;
}
.ast-separate-container .ast-comment-list li.depth-1, .ast-narrow-container .ast-comment-list li.depth-1 {
padding: 3em;
}
.ast-comment-list > .comment:last-child .ast-comment {
border: none;
}
.ast-separate-container .ast-comment-list .comment .comment-respond,
.ast-narrow-container .ast-comment-list .comment .comment-respond {
padding-bottom: 0;
}
.ast-separate-container .comment .comment-respond {
margin-top: 2em;
}
.ast-separate-container .ast-comment-list li.depth-1 .ast-comment,
.ast-separate-container .ast-comment-list li.depth-2 .ast-comment {
border-bottom: 0;
}
';
}
if ( false === $update_customizer_strctural_defaults ) {
$single_post_comment_css .= '.ast-separate-container .ast-comment-list li.depth-1 {
padding: 4em 6.67em;
margin-bottom: 2em;
}
@media (max-width: 1200px) {
.ast-separate-container .ast-comment-list li.depth-1 {
padding: 3em 3.34em;
}
}
.ast-separate-container .comment-respond {
background-color: #fff;
padding: 4em 6.67em;
border-bottom: 0;
}
@media (max-width: 1200px) {
.ast-separate-container .comment-respond {
padding: 3em 2.34em;
}
}
.ast-separate-container .comments-title {
background-color: #fff;
padding: 1.2em 3.99em 0;
}
';
} else {
$single_post_comment_css .= '
.ast-plain-container .ast-comment, .ast-page-builder-template .ast-comment {
padding: 2em 0;
}
.page.ast-page-builder-template .comments-area {
margin-top: 2em;
}
';
}
$content_layout = astra_get_content_layout();
$is_boxed = astra_is_content_style_boxed();
$is_sidebar_boxed = astra_is_sidebar_style_boxed();
$content_layout = astra_apply_boxed_layouts( $content_layout, $is_boxed, $is_sidebar_boxed );
if ( 'page-builder' == $content_layout || 'plain-container' == $content_layout ) {
$single_post_comment_css .= '
.ast-page-builder-template .comment-respond {
border-top: none;
padding-bottom: 2em;
}
';
if ( ! Astra_Dynamic_CSS::astra_4_6_0_compatibility() ) {
$single_post_comment_css .= '
.ast-plain-container .comment-reply-title {
padding-top: 1em;
}
';
}
}
if ( $is_site_rtl ) {
$single_post_comment_css .= '
.ast-comment-list .children {
margin-right: 2em;
}
@media (max-width: 992px) {
.ast-comment-list .children {
margin-right: 1em;
}
}
.ast-comment-list #cancel-comment-reply-link {
white-space: nowrap;
font-size: 13px;
font-weight: normal;
margin-right: 1em;
}
.ast-comment-meta {
justify-content: left;
padding: 0 3.4em 1.333em;
}
.ast-comment-time .timendate,
.ast-comment-time .reply {
margin-left: 0.5em;
}
.comments-area #wp-comment-cookies-consent {
margin-left: 10px;
}
.ast-page-builder-template .comments-area {
padding-right: 20px;
padding-left: 20px;
margin-top: 0;
margin-bottom: 2em;
}
.ast-separate-container .ast-comment-list .bypostauthor .bypostauthor {
background: transparent;
margin-bottom: 0;
padding-left: 0;
padding-bottom: 0;
padding-top: 0;
}';
} else {
$single_post_comment_css .= '
.ast-comment-list .children {
margin-left: 2em;
}
@media (max-width: 992px) {
.ast-comment-list .children {
margin-left: 1em;
}
}
.ast-comment-list #cancel-comment-reply-link {
white-space: nowrap;
font-size: 13px;
font-weight: normal;
margin-left: 1em;
}
.ast-comment-info {
display: flex;
position: relative;
}
.ast-comment-meta {
justify-content: right;
padding: 0 3.4em 1.60em;
}
.comments-area #wp-comment-cookies-consent {
margin-right: 10px;
}
.ast-page-builder-template .comments-area {
padding-left: 20px;
padding-right: 20px;
margin-top: 0;
margin-bottom: 2em;
}
.ast-separate-container .ast-comment-list .bypostauthor .bypostauthor {
background: transparent;
margin-bottom: 0;
padding-right: 0;
padding-bottom: 0;
padding-top: 0;
}';
}
$dynamic_css .= Astra_Enqueue_Scripts::trim_css( $single_post_comment_css );
$static_layout_css_min_comment = array(
'.ast-separate-container .ast-comment-list li .comment-respond' => array(
'padding-left' => '2.66666em',
'padding-right' => '2.66666em',
),
);
$dynamic_css .= astra_parse_css( $static_layout_css_min_comment, astra_get_tablet_breakpoint( '', '1' ) );
$global_button_comment_mobile = array(
'.ast-separate-container .ast-comment-list li.depth-1' => array(
'padding' => Astra_Dynamic_CSS::astra_4_6_0_compatibility() ? '' : '1.5em 1em',
'margin-bottom' => Astra_Dynamic_CSS::astra_4_4_0_compatibility() ? '0' : '1.5em',
),
'.ast-separate-container .ast-comment-list .bypostauthor' => array(
'padding' => '.5em',
),
'.ast-separate-container .comment-respond' => array(
'padding' => Astra_Dynamic_CSS::astra_4_6_0_compatibility() ? '' : '1.5em 1em',
),
// Single Post Meta.
'.ast-comment-meta' => array(
'font-size' => ! empty( $body_font_size['mobile'] ) ? astra_get_font_css_value( (int) $body_font_size['mobile'] * 0.8571428571, 'px', 'mobile' ) : '',
),
'.comment-reply-title' => array(
'font-size' => ! empty( $body_font_size['mobile'] ) ? astra_get_font_css_value( (int) $body_font_size['mobile'] * $reply_title_space_threshold, 'px', 'mobile' ) : '',
),
'.ast-comment-list #cancel-comment-reply-link' => array(
'font-size' => astra_responsive_font( $body_font_size, 'mobile' ),
),
'.ast-separate-container .ast-comment-list .bypostauthor li' => array(
'padding' => '0 0 0 .5em',
),
);
if ( $is_site_rtl ) {
$global_button_comment_mobile['.ast-comment-list .children'] = array(
'margin-right' => '0.66666em',
);
} else {
$global_button_comment_mobile['.ast-comment-list .children'] = array(
'margin-left' => '0.66666em',
);
}
$dynamic_css .= astra_parse_css( $global_button_comment_mobile, '', astra_get_mobile_breakpoint() );
$global_button_comment_tablet = array(
'.ast-comment-avatar-wrap img' => array(
'max-width' => '2.5em',
),
'.comments-area' => array(
'margin-top' => '1.5em',
),
'.ast-comment-meta' => array(
'padding' => '0 1.8888em 1.3333em',
'font-size' => ! empty( $body_font_size['tablet'] ) ? astra_get_font_css_value( (int) $body_font_size['tablet'] * 0.8571428571, 'px', 'tablet' ) : '',
),
'.ast-separate-container .ast-comment-list li.depth-1' => array(
'padding' => Astra_Dynamic_CSS::astra_4_6_0_compatibility() ? '' : '1.5em 2.14em',
),
'.ast-separate-container .comment-respond' => array(
'padding' => Astra_Dynamic_CSS::astra_4_6_0_compatibility() ? '' : '2em 2.14em',
),
'.comment-reply-title' => array(
'font-size' => ! empty( $body_font_size['tablet'] ) ? astra_get_font_css_value( (int) $body_font_size['tablet'] * $reply_title_space_threshold, 'px', 'tablet' ) : '',
),
'.ast-comment-list #cancel-comment-reply-link' => array(
'font-size' => astra_responsive_font( $body_font_size, 'tablet' ),
),
'.ast-comment-meta' => array(
'padding' => '0 1.8888em 1.3333em',
),
);
if ( false === $update_customizer_strctural_defaults ) {
$global_button_comment_tablet['.ast-separate-container .comments-title'] = array(
'padding' => '1.43em 1.48em',
);
}
if ( $is_site_rtl ) {
$global_button_comment_tablet['.ast-comment-avatar-wrap'] = array(
'margin-left' => '0.5em',
);
} else {
$global_button_comment_tablet['.ast-comment-avatar-wrap'] = array(
'margin-right' => '0.5em',
);
}
if ( Astra_Dynamic_CSS::astra_4_6_0_compatibility() ) {
$dynamic_css .= '
.ast-comment-cite-wrap cite {
font-weight: 600;
font-size: 1.2em;
}
.ast-comment-info img {
box-shadow: 0 0 5px 0 rgba(0,0,0,.15);
border: 1px solid var(--ast-single-post-border, var(--ast-border-color));
}
.ast-comment-info {
margin-bottom: 1em;
}
.logged-in span.ast-reply-link {
margin-right: 16px;
}
a.comment-edit-link, a.comment-reply-link {
font-size: 13px;
transition: all 0.2s;
}
header.ast-comment-meta {
text-transform: inherit;
}
.ast-page-builder-template .ast-comment-list .children {
margin-top: 0em;
}
.ast-page-builder-template .ast-comment-meta {
padding: 0 22px;
}
.ast-comment-content.comment p {
margin-bottom: 16px;
}
.ast-comment-list .ast-comment-edit-reply-wrap {
justify-content: flex-start;
align-items: center;
}
.comment-awaiting-moderation {
margin-top: 20px;
}
.entry-content ul li, .entry-content ol li {
margin-bottom: 10px;
}
.comment-respond {
padding-top: 2em;
padding-bottom: 2em;
}
.ast-comment-list + .comment-respond {
border-top: 1px solid var(--ast-single-post-border, var(--ast-border-color));
padding-bottom: 0;
}
.comment .comment-reply-title {
display: flex;
align-items: center;
justify-content: space-between;
}
@media(min-width: ' . strval( astra_get_mobile_breakpoint( '', 1 ) ) . 'px) {
header.ast-comment-meta {
display: flex;
width: 100%;
margin-bottom: 0;
padding-bottom: 0;
align-items: center;
}
a.comment-reply-link {
padding: 1px 10px;
display: block;
border-radius: 3px;
border: none;
}
.ast-separate-container .ast-comment-list li.depth-1, .ast-narrow-container .ast-comment-list li.depth-1 {
margin-bottom: 0;
}
.ast-comment-time {
display: flex;
margin-left: auto;
font-weight: 500;
}
section.ast-comment-content.comment {
padding-left: 50px;
}
.ast-comment .comment-reply-link:hover {
background: ' . astra_get_option( 'theme-color' ) . ';
color: #fff;
}
.ast-comment .comment-edit-link:hover {
text-decoration: underline;
}
svg.ast-reply-icon {
fill: currentColor;
margin-right: 5px;
padding-top: 2px;
transition: none;
}
.comment-reply-link:hover .ast-reply-icon {
fill: #fff;
}
}
@media(min-width: ' . strval( astra_get_tablet_breakpoint() ) . 'px) {
.ast-comment-cite-wrap {
margin-left: -7px;
}
section.ast-comment-content.comment {
padding-left: 70px;
}
}
';
if ( 'above' === astra_get_option( 'comment-form-position' ) ) {
$dynamic_css .= '
.comment-respond {
border-bottom: 1px solid var(--ast-single-post-border, var(--ast-border-color));
}
';
}
$comments_section_placement = astra_get_option( 'comments-box-placement', '' );
if ( 'inside' === $comments_section_placement ) {
$dynamic_css .= '
.site-content article .comment-respond {
padding-top: 1.5em;
}
';
}
} else {
$dynamic_css .= '
.ast-comment-time .timendate{
margin-right: 0.5em;
}
.ast-separate-container .comment-reply-title {
padding-top: 0;
}
.ast-comment-list .ast-edit-link {
flex: 1;
}
.comments-area {
border-top: 1px solid var(--ast-global-color-6);
margin-top: 2em;
}
.ast-separate-container .comments-area {
border-top: 0;
}
';
}
return $dynamic_css .= astra_parse_css( $global_button_comment_tablet, '', astra_get_tablet_breakpoint() );
}
return $dynamic_css;
}

View File

@@ -0,0 +1,475 @@
<?php
/**
* Comments - Dynamic CSS
*
* @package astra-builder
* @since 3.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
add_filter( 'astra_dynamic_theme_css', 'astra_comments_css', 11 );
/**
* Comments - Dynamic CSS
*
* @param string $dynamic_css Astra Dynamic CSS.
* @return String Generated dynamic CSS for Pagination.
*
* @since 3.2.0
*/
function astra_comments_css( $dynamic_css ) {
if ( astra_check_current_post_comment_enabled() || 0 < get_comments_number() ) {
$body_font_size = astra_get_option( 'font-size-body' );
$theme_color = astra_get_option( 'theme-color' );
$link_color = astra_get_option( 'link-color', $theme_color );
$is_site_rtl = is_rtl();
$border_color = astra_get_option( 'border-color' );
if ( is_array( $body_font_size ) ) {
$body_font_size_desktop = ( isset( $body_font_size['desktop'] ) && '' != $body_font_size['desktop'] ) ? $body_font_size['desktop'] : 15;
} else {
$body_font_size_desktop = ( '' != $body_font_size ) ? $body_font_size : 15;
}
$desktop_comment_global = array(
'.comment-reply-title' => array(
'font-size' => astra_get_font_css_value( (int) $body_font_size_desktop * 1.66666 ),
),
// Single Post Meta.
'.ast-comment-meta' => array(
'line-height' => '1.666666667',
'color' => esc_attr( $link_color ),
'font-size' => astra_get_font_css_value( (int) $body_font_size_desktop * 0.8571428571 ),
),
'.ast-comment-list #cancel-comment-reply-link' => array(
'font-size' => astra_responsive_font( $body_font_size, 'desktop' ),
),
);
$dynamic_css .= astra_parse_css( $desktop_comment_global );
$update_customizer_defaults = ( true === astra_check_is_structural_setup() );
$padding_comment_title = $update_customizer_defaults ? '1em 0 0' : '2em 0';
$padding_ast_comment = $update_customizer_defaults ? '2em 0' : '1em 0';
$padding_ast_comment_list = $update_customizer_defaults ? '0' : '0.5em';
$single_post_comment_css = '.comments-count-wrapper {
padding: ' . esc_attr( $padding_comment_title ) . ';
}
.comments-count-wrapper .comments-title {
font-weight: normal;
word-wrap: break-word;
}
.ast-comment-list {
margin: 0;
word-wrap: break-word;
padding-bottom: ' . esc_attr( $padding_ast_comment_list ) . ';
list-style: none;
}
.site-content article .comments-area {
border-top: 1px solid var(--ast-single-post-border,var(--ast-border-color));
}
.ast-comment-list li {
list-style: none;
}
.ast-comment-list li.depth-1 .ast-comment,
.ast-comment-list li.depth-2 .ast-comment {
border-bottom: 1px solid #eeeeee;
}
.ast-comment-list .comment-respond {
padding: 1em 0;
border-bottom: 1px solid ' . esc_attr( $border_color ) . ';
}
.ast-comment-list .comment-respond .comment-reply-title {
margin-top: 0;
padding-top: 0;
}
.ast-comment-list .comment-respond p {
margin-bottom: .5em;
}
.ast-comment-list .ast-comment-edit-reply-wrap {
-js-display: flex;
display: flex;
justify-content: flex-end;
}
.ast-comment-list .ast-edit-link {
flex: 1;
}
.ast-comment-list .comment-awaiting-moderation {
margin-bottom: 0;
}
.ast-comment {
padding: ' . esc_attr( $padding_ast_comment ) . ' ;
}
.ast-comment-avatar-wrap img {
border-radius: 50%;
}
.ast-comment-content {
clear: both;
}
.ast-comment-cite-wrap {
text-align: left;
}
.ast-comment-cite-wrap cite {
font-style: normal;
}
.comment-reply-title {
padding-top: 1em;
font-weight: normal;
line-height: 1.65;
}
.ast-comment-meta {
margin-bottom: 0.5em;
}
.comments-area {
border-top: 1px solid #eeeeee;
margin-top: 2em;
}
.comments-area .comment-form-comment {
width: 100%;
border: none;
margin: 0;
padding: 0;
}
.comments-area .comment-notes,
.comments-area .comment-textarea,
.comments-area .form-allowed-tags {
margin-bottom: 1.5em;
}
.comments-area .form-submit {
margin-bottom: 0;
}
.comments-area textarea#comment,
.comments-area .ast-comment-formwrap input[type="text"] {
width: 100%;
border-radius: 0;
vertical-align: middle;
margin-bottom: 10px;
}
.comments-area .no-comments {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
.comments-area p.logged-in-as {
margin-bottom: 1em;
}
.ast-separate-container .comments-count-wrapper {
background-color: #fff;
padding: 2em 6.67em 0;
}
@media (max-width: 1200px) {
.ast-separate-container .comments-count-wrapper {
padding: 2em 3.34em;
}
}
.ast-separate-container .comments-area {
border-top: 0;
}
.ast-separate-container .ast-comment-list {
padding-bottom: 0;
}
.ast-separate-container .ast-comment-list li {
background-color: #fff;
}
.ast-separate-container .ast-comment-list li.depth-1 .children li {
padding-bottom: 0;
padding-top: 0;
margin-bottom: 0;
}
.ast-separate-container .ast-comment-list li.depth-1 .ast-comment,
.ast-separate-container .ast-comment-list li.depth-2 .ast-comment {
border-bottom: 0;
}
.ast-separate-container .ast-comment-list .comment-respond {
padding-top: 0;
padding-bottom: 1em;
background-color: transparent;
}
.ast-separate-container .ast-comment-list .pingback p {
margin-bottom: 0;
}
.ast-separate-container .ast-comment-list .bypostauthor {
padding: 2em;
margin-bottom: 1em;
}
.ast-separate-container .ast-comment-list .bypostauthor li {
background: transparent;
margin-bottom: 0;
padding: 0 0 0 2em;
}
.ast-separate-container .comment-reply-title {
padding-top: 0;
}
.comment-content a {
word-wrap: break-word;
}
.comment-form-legend {
margin-bottom: unset;
padding: 0 0.5em;
}';
if ( false === $update_customizer_defaults ) {
$single_post_comment_css .= '.ast-separate-container .ast-comment-list li.depth-1 {
padding: 4em 6.67em;
margin-bottom: 2em;
}
@media (max-width: 1200px) {
.ast-separate-container .ast-comment-list li.depth-1 {
padding: 3em 3.34em;
}
}
.ast-separate-container .comment-respond {
background-color: #fff;
padding: 4em 6.67em;
border-bottom: 0;
}
@media (max-width: 1200px) {
.ast-separate-container .comment-respond {
padding: 3em 2.34em;
}
}
';
} else {
$single_post_comment_css .= '
.page.ast-page-builder-template .comments-area {
margin-top: 2em;
}
';
}
if ( $is_site_rtl ) {
$single_post_comment_css .= '
.ast-comment-list .children {
margin-right: 2em;
}
@media (max-width: 992px) {
.ast-comment-list .children {
margin-right: 1em;
}
}
.ast-comment-list #cancel-comment-reply-link {
white-space: nowrap;
font-size: 15px;
font-size: 1rem;
margin-right: 1em;
}
.ast-comment-avatar-wrap {
float: right;
clear: left;
margin-left: 1.33333em;
}
.ast-comment-meta-wrap {
float: right;
clear: left;
padding: 0 0 1.33333em;
}
.ast-comment-time .timendate,
.ast-comment-time .reply {
margin-left: 0.5em;
}
.comments-area #wp-comment-cookies-consent {
margin-left: 10px;
}
.ast-page-builder-template .comments-area {
padding-right: 20px;
padding-left: 20px;
margin-top: 0;
margin-bottom: 2em;
}
.ast-separate-container .ast-comment-list .bypostauthor .bypostauthor {
background: transparent;
margin-bottom: 0;
padding-left: 0;
padding-bottom: 0;
padding-top: 0;
}';
} else {
$single_post_comment_css .= '
.ast-comment-list .children {
margin-left: 2em;
}
@media (max-width: 992px) {
.ast-comment-list .children {
margin-left: 1em;
}
}
.ast-comment-list #cancel-comment-reply-link {
white-space: nowrap;
font-size: 15px;
font-size: 1rem;
margin-left: 1em;
}
.ast-comment-avatar-wrap {
float: left;
clear: right;
margin-right: 1.33333em;
}
.ast-comment-meta-wrap {
float: left;
clear: right;
padding: 0 0 1.33333em;
}
.ast-comment-time .timendate,
.ast-comment-time .reply {
margin-right: 0.5em;
}
.comments-area #wp-comment-cookies-consent {
margin-right: 10px;
}
.ast-page-builder-template .comments-area {
padding-left: 20px;
padding-right: 20px;
margin-top: 0;
margin-bottom: 2em;
}
.ast-separate-container .ast-comment-list .bypostauthor .bypostauthor {
background: transparent;
margin-bottom: 0;
padding-right: 0;
padding-bottom: 0;
padding-top: 0;
}';
}
$dynamic_css .= Astra_Enqueue_Scripts::trim_css( $single_post_comment_css );
$static_layout_css_min_comment = array(
'.ast-separate-container .ast-comment-list li .comment-respond' => array(
'padding-left' => '2.66666em',
'padding-right' => '2.66666em',
),
);
$dynamic_css .= astra_parse_css( $static_layout_css_min_comment, astra_get_tablet_breakpoint( '', '1' ) );
$global_button_comment_mobile = array(
'.ast-separate-container .comments-count-wrapper' => array(
'padding' => '1.5em 1em',
),
'.ast-separate-container .ast-comment-list li.depth-1' => array(
'padding' => '1.5em 1em',
'margin-bottom' => '1.5em',
),
'.ast-separate-container .ast-comment-list .bypostauthor' => array(
'padding' => '.5em',
),
'.ast-separate-container .comment-respond' => array(
'padding' => '1.5em 1em',
),
// Single Post Meta.
'.ast-comment-meta' => array(
'font-size' => ! empty( $body_font_size['mobile'] ) ? astra_get_font_css_value( (int) $body_font_size['mobile'] * 0.8571428571, 'px', 'mobile' ) : '',
),
'.comment-reply-title' => array(
'font-size' => ! empty( $body_font_size['mobile'] ) ? astra_get_font_css_value( (int) $body_font_size['mobile'] * 1.66666, 'px', 'mobile' ) : '',
),
'.ast-comment-list #cancel-comment-reply-link' => array(
'font-size' => astra_responsive_font( $body_font_size, 'mobile' ),
),
'.ast-separate-container .ast-comment-list .bypostauthor li' => array(
'padding' => '0 0 0 .5em',
),
);
if ( $is_site_rtl ) {
$global_button_comment_mobile['.ast-comment-list .children'] = array(
'margin-right' => '0.66666em',
);
} else {
$global_button_comment_mobile['.ast-comment-list .children'] = array(
'margin-left' => '0.66666em',
);
}
$dynamic_css .= astra_parse_css( $global_button_comment_mobile, '', astra_get_mobile_breakpoint() );
$global_button_comment_tablet = array(
'.ast-comment-avatar-wrap img' => array(
'max-width' => '2.5em',
),
'.comments-area' => array(
'margin-top' => '1.5em',
),
'.ast-separate-container .comments-count-wrapper' => array(
'padding' => '2em 2.14em',
),
'.ast-separate-container .ast-comment-list li.depth-1' => array(
'padding' => '1.5em 2.14em',
),
'.ast-separate-container .comment-respond' => array(
'padding' => '2em 2.14em',
),
// Single Post Meta.
'.ast-comment-meta' => array(
'font-size' => ! empty( $body_font_size['tablet'] ) ? astra_get_font_css_value( (int) $body_font_size['tablet'] * 0.8571428571, 'px', 'tablet' ) : '',
),
'.comment-reply-title' => array(
'font-size' => ! empty( $body_font_size['tablet'] ) ? astra_get_font_css_value( (int) $body_font_size['tablet'] * 1.66666, 'px', 'tablet' ) : '',
),
'.ast-comment-list #cancel-comment-reply-link' => array(
'font-size' => astra_responsive_font( $body_font_size, 'tablet' ),
),
);
$dynamic_css .= astra_parse_css( $global_button_comment_tablet, '', astra_get_tablet_breakpoint() );
if ( $is_site_rtl ) {
$global_button_tablet_lang_direction_css = array(
'.ast-comment-avatar-wrap' => array(
'margin-left' => '0.5em',
),
);
} else {
$global_button_tablet_lang_direction_css = array(
'.ast-comment-avatar-wrap' => array(
'margin-right' => '0.5em',
),
);
}
return $dynamic_css .= astra_parse_css( $global_button_tablet_lang_direction_css, '', astra_get_tablet_breakpoint() );
}
return $dynamic_css;
}

View File

@@ -0,0 +1,276 @@
<?php
/**
* Container Layout - Dynamic CSS
*
* @package astra
* @since 3.3.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Init fire to add required compatibility for divi page bulder.
*
* Case: In customizer-defaults update case Astra v3.8.3 we introduced some padding for stretched layout, that should not load for page builder layouts, that is why this compatibility added here.
*
* @param int $post_id Current post ID.
*
* @since 3.8.3
*/
function astra_check_any_page_builder_is_active( $post_id ) {
$post = get_post( $post_id );
if ( ! $post ) {
return false; // Prevent further execution if $post is null.
}
if ( class_exists( '\Elementor\Plugin' ) ) {
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$document = Elementor\Plugin::$instance->documents->get( $post_id ); // phpcs:ignore PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound
if ( $document ) {
$deprecated_handle = $document->is_built_with_elementor();
} else {
$deprecated_handle = false;
}
if ( ( defined( 'ELEMENTOR_VERSION' ) && version_compare( ELEMENTOR_VERSION, '1.5.0', '<' ) && 'builder' === Elementor\Plugin::$instance->db->get_edit_mode( $post_id ) ) || $deprecated_handle ) { // phpcs:ignore PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
return true;
}
}
if ( defined( 'TVE_VERSION' ) && get_post_meta( $post_id, 'tcb_editor_enabled', true ) ) {
return true;
}
if ( class_exists( 'FLBuilderModel' ) && apply_filters( 'fl_builder_do_render_content', true, FLBuilderModel::get_post_id() ) && get_post_meta( $post_id, '_fl_builder_enabled', true ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
return true;
}
$vc_active = get_post_meta( $post_id, '_wpb_vc_js_status', true );
if ( class_exists( 'Vc_Manager' ) && ( 'true' == $vc_active || has_shortcode( $post->post_content, 'vc_row' ) ) ) {
return true;
}
if ( function_exists( 'et_pb_is_pagebuilder_used' ) && et_pb_is_pagebuilder_used( $post_id ) ) {
return true;
}
if ( class_exists( 'Brizy_Editor_Post' ) && class_exists( 'Brizy_Editor' ) ) {
$brizy_post_types = Brizy_Editor::get()->supported_post_types();
$post_type = get_post_type( $post_id );
if ( in_array( $post_type, $brizy_post_types ) ) {
if ( Brizy_Editor_Post::get( $post_id )->uses_editor() ) {
return true;
}
}
}
return false;
}
/**
* Container Layout - Dynamic CSS.
*
* @since 3.3.0
*/
function astra_container_layout_css() {
$container_layout = astra_get_content_layout();
$page_container_css = '
.ast-single-post-featured-section + article {
margin-top: 2em;
}
.site-content .ast-single-post-featured-section img {
width: 100%;
overflow: hidden;
object-fit: cover;
}
';
$tab_one_max_breakpoint = astra_get_tablet_breakpoint( '', 1 );
/** @psalm-suppress InvalidOperand */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$tab_one_max_breakpoint = '@media (min-width: ' . $tab_one_max_breakpoint . 'px)';
/** @psalm-suppress InvalidOperand */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$current_post_type = strval( get_post_type() );
$layout_type = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-layout', 'layout-1' );
$image_position = astra_get_option( 'ast-dynamic-single-' . $current_post_type . '-article-featured-image-position-layout-1', 'behind' );
if ( 'layout-1' === $layout_type && 'behind' === $image_position ) {
$page_container_css .= '
.ast-separate-container .site-content .ast-single-post-featured-section + article {
margin-top: -80px;
z-index: 9;
position: relative;
border-radius: 4px;
}
' . $tab_one_max_breakpoint . ' {
.ast-no-sidebar .site-content .ast-article-image-container--wide {
margin-left: -120px;
margin-right: -120px;
max-width: unset;
width: unset;
}
.ast-left-sidebar .site-content .ast-article-image-container--wide, .ast-right-sidebar .site-content .ast-article-image-container--wide {
margin-left: -10px;
margin-right: -10px;
}
.site-content .ast-article-image-container--full {
margin-left: calc( -50vw + 50%);
margin-right: calc( -50vw + 50%);
max-width: 100vw;
width: 100vw;
}
.ast-left-sidebar .site-content .ast-article-image-container--full,
.ast-right-sidebar .site-content .ast-article-image-container--full {
margin-left: -10px;
margin-right: -10px;
max-width: inherit;
width: auto;
}
}
';
}
$customizer_default_update = astra_check_is_structural_setup();
$page_title_header_padding = ( true === $customizer_default_update ) ? '2em' : '4em';
// Transparent Header.
$display_title = get_post_meta( absint( astra_get_post_id() ), 'site-post-title', true );
/** @psalm-suppress InvalidCast */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$tablet_breakpoint = (string) astra_get_tablet_breakpoint();
/** @psalm-suppress InvalidCast */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$page_container_css .= '
.site > .ast-single-related-posts-container {
margin-top: 0;
}
@media (min-width: ' . strval( astra_get_tablet_breakpoint( '', 1 ) ) . 'px) {
.ast-desktop .ast-container--narrow {
max-width: var(--ast-narrow-container-width);
margin: 0 auto;
}
}
';
if ( 'page-builder' === $container_layout ) {
$page_container_css .= '
.ast-page-builder-template .hentry {
margin: 0;
}
.ast-page-builder-template .site-content > .ast-container {
max-width: 100%;
padding: 0;
}
.ast-page-builder-template .site .site-content #primary {
padding: 0;
margin: 0;
}
.ast-page-builder-template .no-results {
text-align: center;
margin: 4em auto;
}
.ast-page-builder-template .ast-pagination {
padding: 2em;
}
.ast-page-builder-template .entry-header.ast-no-title.ast-no-thumbnail {
margin-top: 0;
}
.ast-page-builder-template .entry-header.ast-header-without-markup {
margin-top: 0;
margin-bottom: 0;
}
.ast-page-builder-template .entry-header.ast-no-title.ast-no-meta {
margin-bottom: 0;
}
.ast-page-builder-template.single .post-navigation {
padding-bottom: 2em;
}
.ast-page-builder-template.single-post .site-content > .ast-container {
max-width: 100%;
}';
$astra_blog_improvements = Astra_Dynamic_CSS::astra_4_6_0_compatibility();
$post_navigation_selector = $astra_blog_improvements ? ', .ast-page-builder-template .post-navigation' : '';
if ( true === $customizer_default_update ) {
$page_container_css .= '
.ast-page-builder-template .entry-header {
margin-top: ' . esc_attr( $page_title_header_padding ) . ';
margin-left: auto;
margin-right: auto;
}
';
/** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
if ( 'disabled' !== $display_title && true === apply_filters( 'astra_stretched_layout_with_spacing', true ) && false === astra_check_any_page_builder_is_active( astra_get_post_id() ) ) {
/** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$page_container_css .= '
.ast-single-post.ast-page-builder-template .site-main > article, .woocommerce.ast-page-builder-template .site-main' . $post_navigation_selector . ' {
padding-top: 2em;
padding-left: 20px;
padding-right: 20px;
}
';
}
} else {
$page_container_css .= '
.ast-page-builder-template .entry-header {
margin-top: ' . esc_attr( $page_title_header_padding ) . ';
margin-left: auto;
margin-right: auto;
padding-left: 20px;
padding-right: 20px;
}
.single.ast-page-builder-template .entry-header {
padding-left: 20px;
padding-right: 20px;
}
';
}
$page_container_css .= '
.ast-page-builder-template .ast-archive-description {
margin: ' . esc_attr( $page_title_header_padding ) . ' auto 0;
padding-left: 20px;
padding-right: 20px;
}
';
if ( true === $customizer_default_update ) {
$page_container_css .= '
.ast-page-builder-template .ast-row {
margin-left: 0;
margin-right: 0;
}
.single.ast-page-builder-template .entry-header + .entry-content,
.single.ast-page-builder-template .ast-single-entry-banner + .site-content article .entry-content {
margin-bottom: 2em;
}
@media(min-width: ' . $tablet_breakpoint . 'px) {
.ast-page-builder-template.archive.ast-right-sidebar .ast-row article, .ast-page-builder-template.archive.ast-left-sidebar .ast-row article {
padding-left: 0;
padding-right: 0;
}
}
';
}
/** @psalm-suppress InvalidScalarArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
if ( false === astra_get_option( 'improve-gb-editor-ui', true ) ) {
/** @psalm-suppress InvalidScalarArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$page_container_css .= '.ast-page-builder-template.ast-no-sidebar .entry-content .alignwide {
margin-left: 0;
margin-right: 0;
}';
}
return Astra_Enqueue_Scripts::trim_css( $page_container_css );
}
return $page_container_css;
}

View File

@@ -0,0 +1,199 @@
<?php
/**
* Content Background - Dynamic CSS
*
* @package astra
* @since 3.7.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
add_filter( 'astra_dynamic_theme_css', 'astra_content_background_css', 11 );
/**
* Content Background - Dynamic CSS
*
* @param string $dynamic_css Astra Dynamic CSS.
* @return String Generated dynamic CSS for content background.
*
* @since 3.2.0
*/
function astra_content_background_css( $dynamic_css ) {
if ( ! astra_has_gcp_typo_preset_compatibility() ) {
return $dynamic_css;
}
$content_bg_obj = astra_get_option( 'content-bg-obj-responsive' );
// Override content background with meta value if set.
$meta_background_enabled = astra_get_option_meta( 'ast-page-background-enabled' );
// Check for third party pages meta.
if ( '' === $meta_background_enabled && astra_with_third_party() ) {
$meta_background_enabled = astra_third_party_archive_meta( 'ast-page-background-enabled' );
if ( isset( $meta_background_enabled ) && 'enabled' === $meta_background_enabled ) {
$content_bg_obj = astra_third_party_archive_meta( 'ast-content-background-meta' );
}
} elseif ( isset( $meta_background_enabled ) && 'enabled' === $meta_background_enabled ) {
$content_bg_obj = astra_get_option_meta( 'ast-content-background-meta' );
}
$blog_layout = astra_get_blog_layout();
$blog_grid = astra_get_option( 'blog-grid' );
$sidebar_default_css = $content_bg_obj;
$is_boxed = astra_is_content_style_boxed();
$is_sidebar_boxed = astra_is_sidebar_style_boxed();
$current_layout = astra_get_content_layout();
$narrow_dynamic_selector = 'narrow-width-container' === $current_layout && $is_boxed ? ', .ast-narrow-container .site-content' : '';
$comments_wrapper_bg_selector = Astra_Dynamic_CSS::astra_4_6_0_compatibility() ? ', .ast-separate-container .comments-area' : ', .ast-separate-container .comments-area .comment-respond, .ast-separate-container .comments-area .ast-comment-list li, .ast-separate-container .comments-area .comments-title';
$author_box_extra_selector = ( true === astra_check_is_structural_setup() ) ? '.site-main' : '';
// Apply unboxed container with sidebar boxed look by changing background color to site background color.
$content_bg_obj = astra_apply_unboxed_container( $content_bg_obj, $is_boxed, $is_sidebar_boxed, $current_layout );
// Container Layout Colors.
$container_css = array(
'.ast-separate-container .ast-article-single:not(.ast-related-post), .woocommerce.ast-separate-container .ast-woocommerce-container, .ast-separate-container .error-404, .ast-separate-container .no-results, .single.ast-separate-container ' . esc_attr( $author_box_extra_selector ) . ' .ast-author-meta, .ast-separate-container .related-posts-title-wrapper,.ast-separate-container .comments-count-wrapper, .ast-box-layout.ast-plain-container .site-content,.ast-padded-layout.ast-plain-container .site-content, .ast-separate-container .ast-archive-description' . $narrow_dynamic_selector . $comments_wrapper_bg_selector => astra_get_responsive_background_obj( $content_bg_obj, 'desktop' ),
);
// Container Layout Colors.
$container_css_tablet = array(
'.ast-separate-container .ast-article-single:not(.ast-related-post), .woocommerce.ast-separate-container .ast-woocommerce-container, .ast-separate-container .error-404, .ast-separate-container .no-results, .single.ast-separate-container ' . esc_attr( $author_box_extra_selector ) . ' .ast-author-meta, .ast-separate-container .related-posts-title-wrapper,.ast-separate-container .comments-count-wrapper, .ast-box-layout.ast-plain-container .site-content,.ast-padded-layout.ast-plain-container .site-content, .ast-separate-container .ast-archive-description' . $narrow_dynamic_selector => astra_get_responsive_background_obj( $content_bg_obj, 'tablet' ),
);
// Container Layout Colors.
$container_css_mobile = array(
'.ast-separate-container .ast-article-single:not(.ast-related-post), .woocommerce.ast-separate-container .ast-woocommerce-container, .ast-separate-container .error-404, .ast-separate-container .no-results, .single.ast-separate-container ' . esc_attr( $author_box_extra_selector ) . ' .ast-author-meta, .ast-separate-container .related-posts-title-wrapper,.ast-separate-container .comments-count-wrapper, .ast-box-layout.ast-plain-container .site-content,.ast-padded-layout.ast-plain-container .site-content, .ast-separate-container .ast-archive-description' . $narrow_dynamic_selector => astra_get_responsive_background_obj( $content_bg_obj, 'mobile' ),
);
// Sidebar specific css.
$sidebar_css = array(
'.ast-separate-container.ast-two-container #secondary .widget' => astra_get_responsive_background_obj( $sidebar_default_css, 'desktop' ),
);
// Sidebar specific css.
$sidebar_css_tablet = array(
'.ast-separate-container.ast-two-container #secondary .widget' => astra_get_responsive_background_obj( $sidebar_default_css, 'tablet' ),
);
// Sidebar specific css.
$sidebar_css_mobile = array(
'.ast-separate-container.ast-two-container #secondary .widget' => astra_get_responsive_background_obj( $sidebar_default_css, 'mobile' ),
);
// Apply Content BG Color for Narrow Unboxed Container.
if ( ! astra_is_content_style_boxed() && 'narrow-container' === $current_layout ) {
$container_css = array_merge(
$container_css,
array( '.ast-narrow-container .site-content' => astra_get_responsive_background_obj( $content_bg_obj, 'desktop' ) )
);
$container_css_tablet = array_merge(
$container_css_tablet,
array( '.ast-narrow-container .site-content' => astra_get_responsive_background_obj( $content_bg_obj, 'tablet' ) )
);
$container_css_mobile = array_merge(
$container_css_mobile,
array( '.ast-narrow-container .site-content' => astra_get_responsive_background_obj( $content_bg_obj, 'mobile' ) )
);
}
// Blog Pro Layout Colors.
if ( ( 'blog-layout-1' === $blog_layout || 'blog-layout-4' === $blog_layout || 'blog-layout-6' === $blog_layout ) || ( defined( 'ASTRA_EXT_VER' ) && ( 'blog-layout-1' === $blog_layout || 'blog-layout-4' === $blog_layout || 'blog-layout-6' === $blog_layout ) && 1 !== $blog_grid ) ) {
$blog_layouts = array(
'.ast-separate-container .ast-article-inner' => astra_get_responsive_background_obj( $content_bg_obj, 'desktop' ),
);
$blog_layouts_tablet = array(
'.ast-separate-container .ast-article-inner' => astra_get_responsive_background_obj( $content_bg_obj, 'tablet' ),
);
$blog_layouts_mobile = array(
'.ast-separate-container .ast-article-inner' => astra_get_responsive_background_obj( $content_bg_obj, 'mobile' ),
);
} else {
$blog_layouts = array(
'.ast-separate-container .ast-article-post' => astra_get_responsive_background_obj( $content_bg_obj, 'desktop' ),
);
$blog_layouts_tablet = array(
'.ast-separate-container .ast-article-post' => astra_get_responsive_background_obj( $content_bg_obj, 'tablet' ),
);
$blog_layouts_mobile = array(
'.ast-separate-container .ast-article-post' => astra_get_responsive_background_obj( $content_bg_obj, 'mobile' ),
);
$inner_layout = array(
'.ast-separate-container .ast-article-inner' => array(
'background-color' => 'transparent',
'background-image' => 'none',
),
);
$dynamic_css .= astra_parse_css( $inner_layout );
}
$dynamic_css .= astra_parse_css( $blog_layouts );
/** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$dynamic_css .= astra_parse_css( $blog_layouts_tablet, '', astra_get_tablet_breakpoint() );
/** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$dynamic_css .= astra_parse_css( $blog_layouts_mobile, '', astra_get_mobile_breakpoint() );
$dynamic_css .= astra_parse_css( $container_css );
/** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$dynamic_css .= astra_parse_css( $container_css_tablet, '', astra_get_tablet_breakpoint() );
/** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$dynamic_css .= astra_parse_css( $container_css_mobile, '', astra_get_mobile_breakpoint() );
$dynamic_css .= astra_parse_css( $sidebar_css );
/** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$dynamic_css .= astra_parse_css( $sidebar_css_tablet, '', astra_get_tablet_breakpoint() );
/** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$dynamic_css .= astra_parse_css( $sidebar_css_mobile, '', astra_get_mobile_breakpoint() );
if ( astra_apply_content_background_fullwidth_layouts() ) {
$fullwidth_layout = array(
'.ast-plain-container, .ast-page-builder-template' => astra_get_responsive_background_obj( $content_bg_obj, 'desktop' ),
);
$fullwidth_layout_tablet = array(
'.ast-plain-container, .ast-page-builder-template' => astra_get_responsive_background_obj( $content_bg_obj, 'tablet' ),
);
$fullwidth_layout_mobile = array(
'.ast-plain-container, .ast-page-builder-template' => astra_get_responsive_background_obj( $content_bg_obj, 'mobile' ),
);
$dynamic_css .= astra_parse_css( $fullwidth_layout );
/** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$dynamic_css .= astra_parse_css( $fullwidth_layout_tablet, '', astra_get_tablet_breakpoint() );
/** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$dynamic_css .= astra_parse_css( $fullwidth_layout_mobile, '', astra_get_mobile_breakpoint() );
}
return $dynamic_css;
}
/**
* Applies an unboxed container to the content.
*
* @since 4.2.0
* @param array $content_bg_obj The background object for the content.
* @param bool $is_boxed Container style is boxed or not.
* @param bool $is_sidebar_boxed Sidebar style is boxed or not.
* @param mixed $current_layout The current container layout applied.
* @return array $content_bg_obj The updated background object for the content.
*/
function astra_apply_unboxed_container( $content_bg_obj, $is_boxed, $is_sidebar_boxed, $current_layout ) {
$site_bg_obj = astra_get_option( 'site-layout-outside-bg-obj-responsive' );
$meta_background_enabled = astra_get_option_meta( 'ast-page-background-enabled' );
// Check for third party pages meta.
if ( '' === $meta_background_enabled && astra_with_third_party() ) {
$meta_background_enabled = astra_third_party_archive_meta( 'ast-page-background-enabled' );
if ( isset( $meta_background_enabled ) && 'enabled' === $meta_background_enabled ) {
$site_bg_obj = astra_third_party_archive_meta( 'ast-page-background-meta' );
}
} elseif ( isset( $meta_background_enabled ) && 'enabled' === $meta_background_enabled ) {
$site_bg_obj = astra_get_option_meta( 'ast-page-background-meta' );
}
if ( 'plain-container' === $current_layout && ! $is_boxed && $is_sidebar_boxed && 'no-sidebar' !== astra_page_layout() ) {
$content_bg_obj = $site_bg_obj;
}
return $content_bg_obj;
}

View File

@@ -0,0 +1,196 @@
<?php
/**
* Old Header Menu Last Item - Dynamic CSS
*
* @package astra
* @since 3.5.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
add_filter( 'astra_dynamic_theme_css', 'astra_old_header_custom_menu_css' );
/**
* Old Header Menu Last Item - Dynamic CSS.
*
* @param string $dynamic_css
* @since 3.5.0
*/
function astra_old_header_custom_menu_css( $dynamic_css ) {
$menu_item = astra_get_option( 'header-main-rt-section' );
if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) {
$static_css = '';
if ( 'widget' == $menu_item ) {
$static_css .= '
.ast-header-widget-area {
line-height: 1.65;
}
.ast-header-widget-area .widget-title,
.ast-header-widget-area .no-widget-text {
margin-bottom: 0;
}
.ast-header-widget-area .widget {
margin: .5em;
display: inline-block;
vertical-align: middle;
}
.ast-header-widget-area .widget p {
margin-bottom: 0;
}
.ast-header-widget-area .widget ul {
position: static;
border: 0;
width: auto;
}
.ast-header-widget-area .widget ul a {
border: 0;
}
.ast-header-widget-area .widget.widget_search .search-field,
.ast-header-widget-area .widget.widget_search .search-field:focus {
padding: 10px 45px 10px 15px;
}
.ast-header-widget-area .widget:last-child {
margin-bottom: 0.5em;
margin-right: 0;
}
.submenu-with-border .ast-header-widget-area .widget ul {
position: static;
border: 0;
width: auto;
}
.submenu-with-border .ast-header-widget-area .widget ul a {
border: 0;
}
.ast-header-break-point .ast-header-widget-area .widget {
margin: .5em 0;
display: block;
}';
}
if ( 'button' == $menu_item ) {
$static_css .= '
.ast-header-break-point .main-navigation ul .button-custom-menu-item .menu-link {
padding: 0 20px;
display: inline-block;
width: 100%;
border-bottom-width: 1px;
border-style: solid;
border-color: #eaeaea;
}
.button-custom-menu-item .ast-custom-button-link .ast-custom-button {
font-size: inherit;
font-family: inherit;
font-weight: inherit;
}
.button-custom-menu-item .ast-custom-button-link .ast-custom-button:hover {
transition: all 0.1s ease-in-out;
}';
}
$search_box_type = astra_get_option( 'header-main-rt-section-search-box-type' );
$show_icon = 'full-screen' === $search_box_type || 'header-cover' === $search_box_type ? 'block' : 'none';
$static_css .= "
.ast-header-break-point.ast-header-custom-item-inside .main-header-bar .main-header-bar-navigation .ast-search-icon {
display: $show_icon;
}
.ast-header-break-point.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon .search-form {
padding: 0;
display: block;
overflow: hidden;
}
.ast-header-break-point .ast-header-custom-item .widget:last-child {
margin-bottom: 1em;
}
.ast-header-custom-item .widget {
margin: 0.5em;
display: inline-block;
vertical-align: middle;
}
.ast-header-custom-item .widget p {
margin-bottom: 0;
}
.ast-header-custom-item .widget li {
width: auto;
}
.ast-header-custom-item-inside .button-custom-menu-item .menu-link {
display: none;
}
.ast-header-custom-item-inside.ast-header-break-point .button-custom-menu-item .ast-custom-button-link {
display: none;
}
.ast-header-custom-item-inside.ast-header-break-point .button-custom-menu-item .menu-link {
display: block;
}";
if ( is_rtl() ) {
$static_css .= '
.ast-header-break-point.ast-header-custom-item-outside .main-header-bar .ast-search-icon {
margin-left: 1em;
}
.ast-header-break-point.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon .search-field,
.ast-header-break-point.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon.ast-inline-search .search-field {
width: 100%;
padding-left: 5.5em;
}
.ast-header-break-point.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon .search-submit {
display: block;
position: absolute;
height: 100%;
top: 0;
left: 0;
padding: 0 1em;
border-radius: 0;
}
.ast-header-break-point .ast-header-custom-item .ast-masthead-custom-menu-items {
padding-right: 20px;
padding-left: 20px;
margin-bottom: 1em;
margin-top: 1em;
}
.ast-header-custom-item-inside.ast-header-break-point .button-custom-menu-item {
padding-right: 0;
padding-left: 0;
margin-top: 0;
margin-bottom: 0;
}';
} else {
$static_css .= '
.ast-header-break-point.ast-header-custom-item-outside .main-header-bar .ast-search-icon {
margin-right: 1em;
}
.ast-header-break-point.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon .search-field,
.ast-header-break-point.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon.ast-inline-search .search-field {
width: 100%;
padding-right: 5.5em;
}
.ast-header-break-point.ast-header-custom-item-inside .main-header-bar .ast-search-menu-icon .search-submit {
display: block;
position: absolute;
height: 100%;
top: 0;
right: 0;
padding: 0 1em;
border-radius: 0;
}
.ast-header-break-point .ast-header-custom-item .ast-masthead-custom-menu-items {
padding-left: 20px;
padding-right: 20px;
margin-bottom: 1em;
margin-top: 1em;
}
.ast-header-custom-item-inside.ast-header-break-point .button-custom-menu-item {
padding-left: 0;
padding-right: 0;
margin-top: 0;
margin-bottom: 0;
}';
}
$dynamic_css .= Astra_Enqueue_Scripts::trim_css( $static_css );
}
return $dynamic_css;
}

View File

@@ -0,0 +1,57 @@
<?php
/**
* Global color palette - Dynamic CSS
*
* @package astra-builder
* @since 3.7.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
add_filter( 'astra_dynamic_theme_css', 'astra_generate_global_palette_style' );
/**
* Generate palette CSS variable styles on the front end.
*
* @since 3.7.0
* @param string $dynamic_css dynamic css.
* @return string
*/
function astra_generate_global_palette_style( $dynamic_css ) {
$global_palette = astra_get_option( 'global-color-palette' );
$palette_style = array();
$variable_prefix = Astra_Global_Palette::get_css_variable_prefix();
$palette_css_vars = array();
if ( isset( $global_palette['palette'] ) ) {
foreach ( $global_palette['palette'] as $key => $color ) {
$palette_key = str_replace( '--', '-', $variable_prefix ) . $key;
$palette_style[ ':root .has' . $palette_key . '-color' ] = array(
'color' => 'var(' . $variable_prefix . $key . ')',
);
$palette_style[ ':root .has' . $palette_key . '-background-color' ] = array(
'background-color' => 'var(' . $variable_prefix . $key . ')',
);
$palette_style[ ':root .wp-block-button .has' . $palette_key . '-color' ] = array(
'color' => 'var(' . $variable_prefix . $key . ')',
);
$palette_style[ ':root .wp-block-button .has' . $palette_key . '-background-color' ] = array(
'background-color' => 'var(' . $variable_prefix . $key . ')',
);
$palette_css_vars[ $variable_prefix . $key ] = $color;
}
}
$palette_style[':root'] = $palette_css_vars;
$dynamic_css .= astra_parse_css( $palette_style );
return $dynamic_css;
}

View File

@@ -0,0 +1,164 @@
<?php
/**
* Inline On Mobile - Dynamic CSS.
*
* @package astra
* @since 3.5.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
add_filter( 'astra_dynamic_theme_css', 'astra_inline_on_mobile_css' );
/**
* Inline On Mobile - Dynamic CSS.
*
* @param string $dynamic_css Dynamic CSS.
* @since 3.5.0
* @return string
*/
function astra_inline_on_mobile_css( $dynamic_css ) {
$inline_on_mobile_enable = false;
for ( $index = 1; $index <= Astra_Builder_Helper::$component_limit; $index++ ) {
if ( false === astra_get_option( 'header-menu' . $index . '-menu-stack-on-mobile' ) ) {
$inline_on_mobile_enable = true;
break;
}
}
if ( false === $inline_on_mobile_enable ) {
return $dynamic_css;
}
$inline_on_mobile_css = '
.ast-header-break-point .ast-mobile-header-wrap .ast-above-header-wrap .main-header-bar-navigation .inline-on-mobile .menu-item .menu-link,
.ast-header-break-point .ast-mobile-header-wrap .ast-main-header-wrap .main-header-bar-navigation .inline-on-mobile .menu-item .menu-link,
.ast-header-break-point .ast-mobile-header-wrap .ast-below-header-wrap .main-header-bar-navigation .inline-on-mobile .menu-item .menu-link {
border: none;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-above-header-wrap .main-header-bar-navigation .inline-on-mobile .menu-item-has-children > .ast-menu-toggle::before,
.ast-header-break-point .ast-mobile-header-wrap .ast-main-header-wrap .main-header-bar-navigation .inline-on-mobile .menu-item-has-children > .ast-menu-toggle::before,
.ast-header-break-point .ast-mobile-header-wrap .ast-below-header-wrap .main-header-bar-navigation .inline-on-mobile .menu-item-has-children > .ast-menu-toggle::before {
font-size: .6rem;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile {
flex-wrap: unset;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.ast-submenu-expanded > .sub-menu .menu-link {
padding: .1em 1em;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.ast-submenu-expanded > .sub-menu > .menu-item .ast-menu-toggle::before {
transform: rotate(-90deg);
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.ast-submenu-expanded > .sub-menu > .menu-item.ast-submenu-expanded .ast-menu-toggle::before {
transform: rotate(-270deg);
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item > .sub-menu > .menu-item .menu-link:before {
content: none;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile {
flex-wrap: unset;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.ast-submenu-expanded > .sub-menu .menu-link {
padding: .1em 1em;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.ast-submenu-expanded > .sub-menu > .menu-item .ast-menu-toggle::before {
transform: rotate(-90deg);
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.ast-submenu-expanded > .sub-menu > .menu-item.ast-submenu-expanded .ast-menu-toggle::before {
transform: rotate(-270deg);
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item > .sub-menu > .menu-item .menu-link:before {
content: none;
}
.ast-header-break-point .inline-on-mobile .sub-menu {
width: 150px;
}';
if ( is_rtl() ) {
$inline_on_mobile_css .= '
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.menu-item-has-children {
margin-left: 10px;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.ast-submenu-expanded > .sub-menu {
display: block;
position: absolute;
left: auto;
right: 0;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.ast-submenu-expanded > .sub-menu .menu-item .ast-menu-toggle {
padding: 0;
left: 1em;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.ast-submenu-expanded > .sub-menu > .menu-item > .sub-menu {
right: 100%;
left: auto;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .ast-menu-toggle {
left: -15px;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.menu-item-has-children {
margin-left: 10px;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.ast-submenu-expanded > .sub-menu {
display: block;
position: absolute;
left: auto;
right: 0;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.ast-submenu-expanded > .sub-menu > .menu-item > .sub-menu {
right: 100%;
left: auto;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .ast-menu-toggle {
left: -15px;
}';
} else {
$inline_on_mobile_css .= '
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.menu-item-has-children {
margin-right: 10px;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.ast-submenu-expanded > .sub-menu {
display: block;
position: absolute;
right: auto;
left: 0;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.ast-submenu-expanded > .sub-menu .menu-item .ast-menu-toggle {
padding: 0;
right: 1em;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.ast-submenu-expanded > .sub-menu > .menu-item > .sub-menu {
left: 100%;
right: auto;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .ast-menu-toggle {
right: -15px;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.menu-item-has-children {
margin-right: 10px;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.ast-submenu-expanded > .sub-menu {
display: block;
position: absolute;
right: auto;
left: 0;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .menu-item.ast-submenu-expanded > .sub-menu > .menu-item > .sub-menu {
left: 100%;
right: auto;
}
.ast-header-break-point .ast-mobile-header-wrap .ast-flex.inline-on-mobile .ast-menu-toggle {
right: -15px;
}';
}
return $dynamic_css .= Astra_Enqueue_Scripts::trim_css( $inline_on_mobile_css );
}

View File

@@ -0,0 +1,111 @@
<?php
/**
* Live Search - Dynamic CSS
*
* @package astra
* @since 4.4.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
add_filter( 'astra_dynamic_theme_css', 'astra_live_search_css', 12 );
/**
* Live Search - Dynamic CSS.
*
* @param string $dynamic_css
* @since 4.4.0
*/
function astra_live_search_css( $dynamic_css ) {
$ltr_left = is_rtl() ? 'right' : 'left';
$ltr_right = is_rtl() ? 'left' : 'right';
$heading_base_color = astra_get_option( 'heading-base-color' );
$static_css = '
form.search-form {
position: relative;
}
.ast-live-search-results {
position: absolute;
width: 100%;
top: 60px;
padding: 0px 4px 4px;
max-height: 400px;
height: auto;
overflow-x: hidden;
overflow-y: auto;
background: #fff;
z-index: 999999;
border-radius: 4px;
border: 1px solid var(--ast-border-color);
box-shadow: 0px 4px 6px -2px rgba(16, 24, 40, 0.03), 0px 12px 16px -4px rgba(16, 24, 40, 0.08);
}
.ast-live-search-results > * {
-js-display: flex;
display: flex;
justify-content: ' . esc_attr( $ltr_left ) . ';
flex-wrap: wrap;
align-items: center;
}
label.ast-search--posttype-heading {
text-transform: capitalize;
padding: 16px 16px 10px;
color: ' . esc_attr( $heading_base_color ) . ';
font-weight: 500;
}
label.ast-search--no-results-heading {
padding: 14px 20px;
}
a.ast-search-item {
position: relative;
padding: 14px 20px;
font-size: 0.9em;
}
a.ast-search-item:hover {
background-color: #f9fafb;
}
a.ast-search-page-link {
justify-content: center;
justify-content: center;
border: 1px solid var(--ast-border-color);
margin-top: 10px;
}
.ast-search-item + .ast-search--posttype-heading {
border-top: 1px solid var(--ast-border-color);
margin-top: 10px;
}
';
$dynamic_css .= Astra_Enqueue_Scripts::trim_css( $static_css );
$search_style = astra_get_option( 'header-search-box-type' );
if ( ! defined( 'ASTRA_EXT_VER' ) || ( defined( 'ASTRA_EXT_VER' ) && ( 'slide-search' === $search_style || 'search-box' === $search_style ) ) ) {
$search_width = astra_get_option( 'header-search-width' );
$search_selector = '.ast-header-search .ast-search-menu-icon';
$container_css = array(
$search_selector . ' .search-field' => array(
'width' => ! empty( $search_width['desktop'] ) ? astra_get_css_value( $search_width['desktop'], 'px' ) : 'auto',
),
);
$container_css_tablet = array(
$search_selector . ' .search-field' => array(
'width' => ! empty( $search_width['tablet'] ) ? astra_get_css_value( $search_width['tablet'], 'px' ) : '100%',
),
);
$container_css_mobile = array(
$search_selector . ' .search-field' => array(
'width' => ! empty( $search_width['mobile'] ) ? astra_get_css_value( $search_width['mobile'], 'px' ) : '100%',
),
);
$dynamic_css .= astra_parse_css( $container_css );
$dynamic_css .= astra_parse_css( $container_css_tablet, '', astra_get_tablet_breakpoint() );
$dynamic_css .= astra_parse_css( $container_css_mobile, '', astra_get_mobile_breakpoint() );
}
return $dynamic_css;
}

View File

@@ -0,0 +1,121 @@
<?php
/**
* Logo SVG Icons - Dynamic CSS
*
* @package Astra
* @since 4.7.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
add_filter( 'astra_dynamic_theme_css', 'astra_logo_svg_icons_dynamic_css', 20 );
/**
* Main styles for the logo svg icons.
*
* @param string $dynamic_css
* @return string
* @since 4.7.0
*/
function astra_logo_svg_icons_dynamic_css( $dynamic_css ) {
if ( ! astra_logo_svg_icon() ) {
return $dynamic_css;
}
$header_logo_width = astra_get_option( 'ast-header-responsive-logo-width' );
$logo_svg_icon_color = astra_get_option( 'logo-svg-icon-color' );
$logo_svg_site_title_gap = astra_get_option( 'logo-svg-site-title-gap' );
$logo_svg_icon_hover_color = astra_get_option( 'logo-svg-icon-hover-color' );
$enabled_logo_title_inline = astra_get_option( 'logo-title-inline' );
/**
* Start: Desktop related styles
*/
$desktop_css_output = array(
'.site-branding .ast-logo-svg-icon' => array(
'display' => 'inline-flex', // Fix for the vertical alignment issue with the SVG logo.
),
'.site-branding .ast-logo-svg-icon svg' => array(
'width' => astra_get_css_value( $header_logo_width['desktop'], 'px', '30' ),
'fill' => esc_attr( $logo_svg_icon_color ),
),
'.site-branding .ast-logo-svg-icon:hover svg' => array(
'fill' => esc_attr( $logo_svg_icon_hover_color ),
),
);
if ( isset( $logo_svg_site_title_gap['desktop'] ) ) {
if ( $enabled_logo_title_inline ) {
$desktop_css_output['.ast-logo-title-inline .ast-site-identity'] = array(
'gap' => astra_get_css_value( $logo_svg_site_title_gap['desktop'], 'px' ),
);
} else {
$desktop_css_output['.ast-site-identity .ast-logo-svg-icon'] = array(
'margin-bottom' => astra_get_css_value( $logo_svg_site_title_gap['desktop'], 'px' ),
);
}
}
/**
* End: Desktop related styles
*/
/**
* Start: Tablet related styles
*/
$tablet_css_output = array(
'.site-branding .ast-logo-svg-icon svg' => array(
'width' => astra_get_css_value( $header_logo_width['tablet'], 'px', '30' ),
),
);
if ( isset( $logo_svg_site_title_gap['tablet'] ) ) {
if ( $enabled_logo_title_inline ) {
$tablet_css_output['.ast-logo-title-inline .ast-site-identity'] = array(
'gap' => astra_get_css_value( $logo_svg_site_title_gap['tablet'], 'px' ),
);
} else {
$tablet_css_output['.ast-site-identity .ast-logo-svg-icon'] = array(
'margin-bottom' => astra_get_css_value( $logo_svg_site_title_gap['tablet'], 'px' ),
);
}
}
/**
* End: Tablet related styles
*/
/**
* Start: Mobile related styles
*/
$mobile_css_output = array(
'.site-branding .ast-logo-svg-icon svg' => array(
'width' => astra_get_css_value( $header_logo_width['mobile'], 'px', '30' ),
),
);
if ( isset( $logo_svg_site_title_gap['mobile'] ) ) {
if ( $enabled_logo_title_inline ) {
$mobile_css_output['.ast-logo-title-inline .ast-site-identity'] = array(
'gap' => astra_get_css_value( $logo_svg_site_title_gap['mobile'], 'px' ),
);
} else {
$mobile_css_output['.ast-site-identity .ast-logo-svg-icon'] = array(
'margin-bottom' => astra_get_css_value( $logo_svg_site_title_gap['mobile'], 'px' ),
);
}
}
/**
* End: Mobile related styles
*/
$dynamic_css .= astra_parse_css( $desktop_css_output );
$dynamic_css .= astra_parse_css( $tablet_css_output, '', astra_get_tablet_breakpoint() );
$dynamic_css .= astra_parse_css( $mobile_css_output, '', astra_get_mobile_breakpoint() );
return $dynamic_css;
}

View File

@@ -0,0 +1,124 @@
<?php
/**
* Post Navigation - Dynamic CSS
*
* @package Astra
* @since 4.6.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
add_filter( 'astra_dynamic_theme_css', 'astra_navigation_css', 11 );
/**
* Post Navigation - Dynamic CSS
*
* @param string $dynamic_css Astra Dynamic CSS.
* @return String Generated dynamic CSS for Post Navigation.
*
* @since 4.6.0
*/
function astra_navigation_css( $dynamic_css ) {
$mobile_breakpoint = strval( astra_get_mobile_breakpoint() );
$link_hover_color = astra_get_option( 'link-h-color' );
/** Backward compatibility support for left-right paddings @since 4.6.13 */
$remove_mobile_device_paddings = apply_filters( 'astra_remove_single_posts_navigation_mobile_device_padding', ! empty( astra_get_option( 'remove_single_posts_navigation_mobile_device_padding' ) ) );
$mobile_device_paddings = ! $remove_mobile_device_paddings ? 'padding-left: 20px; padding-right: 20px;' : '';
$navigation_css = '
.single .post-navigation a p {
margin-top: 0.5em;
margin-bottom: 0;
text-transform: initial;
line-height: 1.65em;
font-weight: normal;
}
.single .post-navigation a .ast-post-nav {
font-weight: 600;
display: block;
text-transform: uppercase;
font-size: 0.85em;
letter-spacing: 0.05em;
}
.single .post-navigation a svg {
top: .125em;
width: 1em;
height: 1em;
position: relative;
fill: currentColor;
}
.page-links .page-link:hover, .single .post-navigation a:hover {
color: ' . esc_attr( $link_hover_color ) . ';
}
@media( min-width: 320px ) {
.single .post-navigation .nav-previous a {
text-align: left;
padding-right: 20px;
}
.single .post-navigation .nav-next a {
text-align: right;
padding-left: 20px;
}
.comment-navigation .nav-previous:after, .post-navigation .nav-previous:after {
position: absolute;
content: "";
top: 25%;
right: 0;
width: 1px;
height: 50%;
background: var(--ast-single-post-border, var(--ast-border-color));
}
}
@media( max-width: ' . $mobile_breakpoint . 'px ) {
.single .post-navigation .nav-links {
-js-display: inline-flex;
display: inline-flex;
width: 100%;
' . $mobile_device_paddings . '
}
.single .post-navigation a p {
display: none;
}
.single .post-navigation .nav-previous {
margin-bottom: 0;
}
}
@media( min-width: 421px ) {
.single .post-navigation a {
max-width: 80%;
width: 100%;
}
.post-navigation a {
font-weight: 500;
font-size: 16px;
}
}
';
// rtl css for post navigation.
if ( is_rtl() ) {
$navigation_css .= '
@media( min-width: 320px ) {
.single .post-navigation .nav-previous a {
text-align: start;
}
.single .post-navigation .nav-next a {
text-align: end;
}
}
@media( max-width: ' . $mobile_breakpoint . 'px ) {
.single .post-navigation .nav-links {
padding-left: 0px;
padding-right: 0px;
}
}
';
}
$dynamic_css .= Astra_Enqueue_Scripts::trim_css( $navigation_css );
return $dynamic_css;
}

View File

@@ -0,0 +1,252 @@
<?php
/**
* Pagination - Dynamic CSS
*
* @package astra-builder
* @since 3.3.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
add_filter( 'astra_dynamic_theme_css', 'astra_pagination_css', 11 );
/**
* Pagination - Dynamic CSS
*
* @param string $dynamic_css Astra Dynamic CSS.
* @return String Generated dynamic CSS for Pagination.
*
* @since 3.3.0
*/
function astra_pagination_css( $dynamic_css ) {
if ( astra_check_pagination_enabled() || false !== apply_filters( 'astra_enable_pagination_css', false ) ) {
$text_color = astra_get_option( 'text-color' );
$link_color = astra_get_option( 'link-color' );
$link_hover_color = astra_get_option( 'link-h-color' );
$pagination_color_output = array(
'.ast-pagination .next.page-numbers' => array(
'display' => 'inherit',
'float' => 'none',
),
'.ast-pagination a, .nav-links a' => array(
'color' => esc_attr( Astra_Dynamic_CSS::astra_4_6_0_compatibility() ? $text_color : $link_color ),
),
'.ast-pagination a:hover, .ast-pagination a:focus, .ast-pagination > span:hover:not(.dots), .ast-pagination > span.current' => array(
'color' => esc_attr( $link_hover_color ),
),
);
$dynamic_css .= astra_parse_css( $pagination_color_output );
$pagination_static_css = '
.ast-pagination .prev.page-numbers,
.ast-pagination .next.page-numbers {
padding: 0 1.5em;
height: 2.33333em;
line-height: calc(2.33333em - 3px);
}
.ast-pagination-default .ast-pagination .next.page-numbers {
padding-right: 0;
}
.ast-pagination-default .ast-pagination .prev.page-numbers {
padding-left: 0;
}
.ast-pagination-default .post-page-numbers.current .page-link, .ast-pagination-default .ast-pagination .page-numbers.current {
border-radius: 2px;
}
.ast-pagination {
display: inline-block;
width: 100%;
padding-top: 2em;
text-align: center;
}
.ast-pagination .page-numbers {
display: inline-block;
width: 2.33333em;
height: 2.33333em;
font-size: 16px;
font-size: 1.06666rem;
line-height: calc(2.33333em - 3px);
font-weight: 500;
}
.ast-pagination .nav-links {
display: inline-block;
width: 100%;
}
@media (max-width: 420px) {
.ast-pagination .prev.page-numbers,
.ast-pagination .next.page-numbers {
width: 100%;
text-align: center;
margin: 0;
}
.ast-pagination-circle .ast-pagination .next.page-numbers,
.ast-pagination-square .ast-pagination .next.page-numbers{
margin-top: 10px;
}
.ast-pagination-circle .ast-pagination .prev.page-numbers,
.ast-pagination-square .ast-pagination .prev.page-numbers{
margin-bottom: 10px;
}
}
.ast-pagination .prev,
.ast-pagination .prev:visited,
.ast-pagination .prev:focus,
.ast-pagination .next,
.ast-pagination .next:visited,
.ast-pagination .next:focus {
display: inline-block;
width: auto;
}
.ast-pagination .prev svg,
.ast-pagination .next svg{
height: 16px;
position: relative;
top: 0.2em;
}
.ast-pagination .prev svg {
margin-right: 0.3em;
}
.ast-pagination .next svg {
margin-left: 0.3em;
}
.ast-page-builder-template .ast-pagination {
padding: 2em;
}';
if ( ! Astra_Builder_Helper::apply_flex_based_css() ) {
$pagination_static_css .= '
.ast-pagination .prev.page-numbers.dots, .ast-pagination .prev.page-numbers.dots:hover, .ast-pagination .prev.page-numbers.dots:focus,
.ast-pagination .prev.page-numbers:visited.dots,
.ast-pagination .prev.page-numbers:visited.dots:hover,
.ast-pagination .prev.page-numbers:visited.dots:focus,
.ast-pagination .prev.page-numbers:focus.dots,
.ast-pagination .prev.page-numbers:focus.dots:hover,
.ast-pagination .prev.page-numbers:focus.dots:focus,
.ast-pagination .next.page-numbers.dots,
.ast-pagination .next.page-numbers.dots:hover,
.ast-pagination .next.page-numbers.dots:focus,
.ast-pagination .next.page-numbers:visited.dots,
.ast-pagination .next.page-numbers:visited.dots:hover,
.ast-pagination .next.page-numbers:visited.dots:focus,
.ast-pagination .next.page-numbers:focus.dots,
.ast-pagination .next.page-numbers:focus.dots:hover,
.ast-pagination .next.page-numbers:focus.dots:focus {
border: 2px solid #eaeaea;
background: transparent;
}
.ast-pagination .prev.page-numbers.dots,
.ast-pagination .prev.page-numbers:visited.dots,
.ast-pagination .prev.page-numbers:focus.dots,
.ast-pagination .next.page-numbers.dots,
.ast-pagination .next.page-numbers:visited.dots,
.ast-pagination .next.page-numbers:focus.dots {
cursor: default;
}';
}
if ( is_rtl() ) {
$pagination_static_css .= '
.ast-pagination-default .ast-pagination .next.page-numbers {
padding-left: 0;
}
.ast-pagination-default .ast-pagination .prev.page-numbers {
padding-right: 0;
}
.ast-pagination .prev svg {
margin-left: 0.3em;
}
.ast-pagination .next svg {
margin-right: 0.3em;
}
@media (min-width: 993px) {
.ast-pagination {
padding-right: 3.33333em;
padding-left: 3.33333em;
}
.ast-pagination .prev.page-numbers {
float: right;
}
.ast-pagination .next.page-numbers {
float: left;
text-align: left;
}
@media (max-width: 768px) {
.ast-pagination .next.page-numbers .page-navigation {
padding-left: 0;
}
}';
if ( ! Astra_Builder_Helper::apply_flex_based_css() ) {
$pagination_static_css .= '
@media (min-width: 769px) {
.ast-pagination .prev.page-numbers.next,
.ast-pagination .prev.page-numbers:visited.next,
.ast-pagination .prev.page-numbers:focus.next,
.ast-pagination .next.page-numbers.next,
.ast-pagination .next.page-numbers:visited.next,
.ast-pagination .next.page-numbers:focus.next {
margin-left: 0;
}
}';
}
} else {
$pagination_static_css .= '
.ast-pagination .prev.page-numbers {
float: left;
}
.ast-pagination .next.page-numbers {
float: right;
}
@media (max-width: 768px) {
.ast-pagination .next.page-numbers .page-navigation {
padding-right: 0;
}
}';
if ( ! Astra_Builder_Helper::apply_flex_based_css() ) {
$pagination_static_css .= '
@media (min-width: 769px) {
.ast-pagination .prev.page-numbers.next,
.ast-pagination .prev.page-numbers:visited.next,
.ast-pagination .prev.page-numbers:focus.next,
.ast-pagination .next.page-numbers.next,
.ast-pagination .next.page-numbers:visited.next,
.ast-pagination .next.page-numbers:focus.next {
margin-right: 0;
}
}';
}
}
$css_output_mobile = array(
'.ast-pagination .next:focus, .ast-pagination .prev:focus' => array(
'width' => '100% !important',
),
);
$dynamic_css .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() );
return $dynamic_css .= Astra_Enqueue_Scripts::trim_css( $pagination_static_css );
}
return $dynamic_css;
}

View File

@@ -0,0 +1,84 @@
<?php
/**
* Single Post UI Improvement - Dynamic CSS
*
* @package astra-builder
* @since 4.6.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( apply_filters( 'astra_improvise_single_post_design', Astra_Dynamic_CSS::astra_4_6_0_compatibility() && is_single() ) ) {
add_filter( 'astra_dynamic_theme_css', 'astra_single_post_css', 11 );
}
/**
* Single Post UI Improvement - Dynamic CSS
*
* @param string $dynamic_css Astra Dynamic CSS.
* @return String Generated dynamic CSS for Pagination.
*
* @since 4.6.0
*/
function astra_single_post_css( $dynamic_css ) {
$is_boxed = astra_is_content_style_boxed();
$content_layout = astra_get_content_layout();
$post_with_unboxed_layout = ( 'plain-container' === $content_layout || 'narrow-container' === $content_layout ) && ! $is_boxed ? true : false;
$static_css = '
:root {
--ast-single-post-border: #e1e8ed;
}
.entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4, .entry-content h5, .entry-content h6 {
margin-top: 1.5em;
margin-bottom: calc(0.3em + 10px);
}
code, kbd, samp {
background: var(--ast-code-block-background);
padding: 3px 6px;
}
.ast-row.comment-textarea fieldset.comment-form-comment {
border: none;
padding: unset;
margin-bottom: 1.5em;
}
.entry-content > * {
margin-bottom: 1.5em;
}
.entry-content .wp-block-image,
.entry-content .wp-block-embed {
margin-top: 2em;
margin-bottom: 3em;
}
';
if ( $post_with_unboxed_layout ) {
$static_css .= '
:root {
--ast-single-post-nav-padding: 4em 0 0;
}
.ast-single-post .ast-post-format-content {
max-width: 100%;
}
.post-navigation + .comments-area {
border-top: none;
padding-top: 5em;
}
';
} else {
$nav_padding = astra_check_current_post_comment_enabled() || 0 < get_comments_number() ? '3em 0 1em' : '3em 0 0';
$static_css .= '
:root {
--ast-single-post-nav-padding: ' . $nav_padding . ';
}
';
}
$dynamic_css .= Astra_Enqueue_Scripts::trim_css( $static_css );
return $dynamic_css;
}