PluginProbe
Depicter — Popup & Slider Builder / 1.9.2
Depicter — Popup & Slider Builder v1.9.2
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
← All changes | app/src/Document/Models/Common/Styles.php +37 -2 1.5.21.9.2 View file →
@@ -2,11 +2,14 @@
2 2 namespace Depicter\Document\Models\Common;
3 3
4 4
5 5 use Depicter\Document\CSS\Breakpoints;
6 +use Depicter\Document\Models\Traits\HasDataSheetTrait;
6 7
7 8 class Styles
8 9 {
10 + use HasDataSheetTrait;
11 +
9 12 /**
10 13 * @var Styles\Transform
11 14 */
12 15 public $transform;
@@ -123,11 +126,33 @@
123 126 'corner',
124 127 'margin'
125 128 ];
126 129
127 - return $this->generateCssForModules( $cssModules, $states );
130 + $stylesList = $this->generateCssForModules( $cssModules, $states );
131 + $stylesList = $this->replaceDynamicTags( $stylesList );
132 +
133 + return $stylesList;
128 134 }
129 135
136 + protected function replaceDynamicTags( $stylesList ){
137 + if( ! $dataSheet = $this->getDataSheet() ){
138 + return $stylesList;
139 + }
140 +
141 + foreach( $stylesList as $key => $value ){
142 + if( empty( $value) ){
143 + continue;
144 + }
145 + if( is_string( $value ) ){
146 + $stylesList[ $key ] = \Depicter::dataSource()->tagsManager()->convert( $value, $dataSheet );
147 + } elseif( is_array( $value ) ) {
148 + $stylesList[ $key ] = $this->replaceDynamicTags( $value );
149 + }
150 + }
151 +
152 + return $stylesList;
153 + }
154 +
130 155 /**
131 156 * Get styles for SVG
132 157 *
133 158 * @return array
@@ -186,8 +211,18 @@
186 211 $css['hover'] = !empty( $this->hover->{$cssModule} ) ? $this->hover->{$cssModule}->set( $css['hover'] ) : $css['hover'];
187 212 }
188 213 }
189 214
215 + // check if hover style is disabled for one breakpoint then remove all the css modules for that breakpoint
216 + if ( in_array( 'hover', $states ) ) {
217 + $devices = Breakpoints::names();
218 + foreach ( $devices as $device ) {
219 + if ( empty( $this->hover->enable->{$device} ) ) {
220 + $css['hover'][ $device ] = [];
221 + }
222 + }
223 + }
224 +
190 225 return $css;
191 226 }
192 227
193 228 /**
@@ -207,9 +242,9 @@
207 242 }
208 243
209 244 /**
210 245 * Get blending mode styles
211 - *
246 + *
212 247 * @return array
213 248 */
214 249 public function getBlendingModeStyle(): array{
215 250 return $this->generateCssForModules(['blendingMode']);