PluginProbe
BlockSpare – Gutenberg Blocks, AI Content Generator & Site Builder for News, Magazine & Blogs / 5.0.1
BlockSpare – Gutenberg Blocks, AI Content Generator & Site Builder for News, Magazine & Blogs v5.0.1
5.0.1 4.1.0 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 2.1.2 2.5.0 2.5.3 All 39 releases
blockspare / inc / block-banner / frontend-render / post-category-style.php

post-category-style.php in BlockSpare – Gutenberg Blocks, AI Content Generator & Site Builder for News, Magazine & Blogs 5.0.1, at inc/block-banner/frontend-render/post-category-style.php

128 lines 5.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!function_exists('blockspare_posts_category_style')) {
4
5 function blockspare_posts_category_style(
6 $block_content,
7 $attributes,
8 $blockuniqueclass,
9 $color,
10 $backgroundColor,
11 $borderColor,
12 $secondColor,
13 $secondBackgroundColor,
14 $secondBorderColor,
15 $thirdColor,
16 $thirdBackgroundColor,
17 $thirdBorderColor
18 ) {
19
20
21
22 // border-radius
23 if ($attributes['categoryLayoutOption'] == 'border' || $attributes['categoryLayoutOption'] == 'solid') {
24 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a{
25 border-radius:' . $attributes['categoryBorderRadius'] . "px" . ';
26 }';
27 }
28
29 // border
30 if ($attributes['categoryLayoutOption'] == 'border') {
31 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a{
32 border-style: solid;
33 border-width:' . $attributes['categoryBorderWidth'] . "px" . ';
34 }';
35 }
36
37 // underline
38 if ($attributes['categoryLayoutOption'] == 'underline') {
39 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a{
40 border-bottom-style: solid;
41 border-bottom-width:' . $attributes['categoryBorderWidth'] . "px" . ';
42 padding-left: 0;
43 padding-right: 0;
44 }';
45 }
46
47 // colors
48 if ($attributes['colorType'] == 'bs-single-color') {
49 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a{
50 color:' . $color . "!important" . ';
51 }';
52
53 if ($attributes['categoryLayoutOption'] == 'solid') {
54 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a{
55 background-color:' . $backgroundColor . "!important" . ';
56 }';
57 }
58
59 if ($attributes['categoryLayoutOption'] == 'border' || $attributes['categoryLayoutOption'] == 'underline') {
60 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a{
61 border-color:' . $borderColor . ';
62 }';
63 }
64 } else {
65 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a:nth-child(3n + 1){
66 color:' . $color . "!important" . ';
67 }';
68 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a:nth-child(3n + 2){
69 color:' . $secondColor . "!important" . ';
70 }';
71 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a:nth-child(3n){
72 color:' . $thirdColor . "!important" . ';
73 }';
74
75 if ($attributes['categoryLayoutOption'] == 'solid') {
76 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a:nth-child(3n + 1){
77 background-color:' . $backgroundColor . "!important" . ';
78 }';
79 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a:nth-child(3n + 2){
80 background-color:' . $secondBackgroundColor . "!important" . ';
81 }';
82 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a:nth-child(3n){
83 background-color:' . $thirdBackgroundColor . "!important" . ';
84 }';
85 }
86
87 if ($attributes['categoryLayoutOption'] == 'border' || $attributes['categoryLayoutOption'] == 'underline') {
88 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a:nth-child(3n + 1){
89 border-color:' . $borderColor . ';
90 }';
91 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a:nth-child(3n + 2){
92 border-color:' . $secondBorderColor . ';
93 }';
94 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a:nth-child(3n){
95 border-color:' . $thirdBorderColor . ';
96 }';
97 }
98 }
99
100 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category{
101 margin-top:' . $attributes['categoryMarginTop'] . 'px' . ';
102 margin-bottom:' . $attributes['categoryMarginBottom'] . 'px' . ';
103 margin-left:' . $attributes['categoryMarginLeft'] . 'px' . ';
104 margin-right:' . $attributes['categoryMarginRight'] . 'px' . ';
105 }';
106
107 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a {
108 font-size:' . $attributes['postCategoryFontSize'] . $attributes['postCategoryFontSizeType'] . ';
109 ' . bscheckFontfamily($attributes['postCategoryFontFamily']) . ';
110 ' . bscheckFontfamilyWeight($attributes['postCategoryFontWeight']) . ';
111 }';
112
113 $block_content .= '@media (max-width: 1025px) { ';
114 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a {
115 font-size:' . $attributes['postCategoryFontSizeTablet'] . $attributes['postCategoryFontSizeType'] . '
116 }';
117 $block_content .= '}';
118
119 $block_content .= '@media (max-width: 767px) { ';
120 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a {
121 font-size:' . $attributes['postCategoryFontSizeMobile'] . $attributes['postCategoryFontSizeType'] . '
122 }';
123 $block_content .= '}';
124
125 return $block_content;
126 }
127 }
128