summaryrefslogtreecommitdiff
path: root/inc/dynamic-css/container-layouts.php
blob: 82196fba015d50d64b47cec5dac3643ca2d729f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
/**
 * Container Layout - Dynamic CSS
 *
 * @package astra
 * @since 3.3.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * Container Layout - Dynamic CSS.
 *
 * @since 3.3.0
 */
function astra_container_layout_css() {
	$container_layout = astra_get_content_layout();
   
	$page_container_css = '';
   
	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-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%;
          }
          .ast-page-builder-template.single-post .site-content > .ast-container {
            max-width: 100%;
          }';

		if ( is_rtl() ) {

			$page_container_css .= '
            .ast-page-builder-template .entry-header {
                margin-top: 4em;
                margin-right: auto;
                margin-left: auto;
                padding-right: 20px;
                padding-left: 20px;
            }
            .ast-page-builder-template .ast-archive-description {
                margin-top: 4em;
                margin-right: auto;
                margin-left: auto;
                padding-right: 20px;
                padding-left: 20px;
            }
            .ast-page-builder-template.ast-no-sidebar .entry-content .alignwide {
                margin-right: 0;
                margin-left: 0;
            }
            .single.ast-page-builder-template .entry-header {
                padding-right: 20px;
                padding-left: 20px;
            }
            .ast-page-builder-template.ast-no-sidebar .entry-content .alignwide {
                margin-right: 0;
                margin-left: 0;
            }';

		} else {
			$page_container_css .= '
            .ast-page-builder-template .entry-header {
                margin-top: 4em;
                margin-left: auto;
                margin-right: auto;
                padding-left: 20px;
                padding-right: 20px;
            }
            .ast-page-builder-template .ast-archive-description {
                margin-top: 4em;
                margin-left: auto;
                margin-right: auto;
                padding-left: 20px;
                padding-right: 20px;
            }
            .ast-page-builder-template.ast-no-sidebar .entry-content .alignwide {
                margin-left: 0;
                margin-right: 0;
            }
            .single.ast-page-builder-template .entry-header {
                padding-left: 20px;
                padding-right: 20px;
            }
            .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;
}