@@ -416,16 +416,33 @@ public function register_container_spacing( Controls_Stack $element, $section_id
416
416
)
417
417
);
418
418
419
+ $ no_padding_styles = array (
420
+ '{{WRAPPER}} .elementor-repeater-item-ang_container_no_padding.elementor-element ' => '--padding-block-start: 0px; --padding-inline-end: 0px; --padding-block-end: 0px; --padding-inline-start: 0px; ' ,
421
+ );
422
+
423
+ $ padding_preset_styles = array (
424
+ '{{WRAPPER}} {{CURRENT_ITEM}}.elementor-element ' => '--padding-block-start: {{TOP}}{{UNIT}}; --padding-inline-end: {{RIGHT}}{{UNIT}}; --padding-block-end: {{BOTTOM}}{{UNIT}}; --padding-inline-start: {{LEFT}}{{UNIT}} ' ,
425
+ );
426
+
427
+ // Backwards compatibility with v3.15.3 and lower.
428
+ if ( Utils::is_elementor_pre ( '3.16.0 ' ) ) {
429
+ $ no_padding_styles = array (
430
+ '{{WRAPPER}} .elementor-repeater-item-ang_container_no_padding.elementor-element ' => '--padding-top: 0px; --padding-right: 0px; --padding-bottom: 0px; --padding-left: 0px; ' ,
431
+ );
432
+
433
+ $ padding_preset_styles = array (
434
+ '{{WRAPPER}} {{CURRENT_ITEM}}.elementor-element ' => '--padding-top: {{TOP}}{{UNIT}}; --padding-right: {{RIGHT}}{{UNIT}}; --padding-bottom: {{BOTTOM}}{{UNIT}}; --padding-left: {{LEFT}}{{UNIT}} ' ,
435
+ );
436
+ }
437
+
419
438
// Hack for adding no padding styles at container presets.
420
439
$ element ->add_control (
421
440
'ang_container_no_padding_hidden ' ,
422
441
array (
423
442
'label ' => __ ( 'No Padding Styles ' , 'ang ' ),
424
443
'type ' => Controls_Manager::HIDDEN ,
425
444
'default ' => 'no ' ,
426
- 'selectors ' => array (
427
- '{{WRAPPER}} .elementor-repeater-item-ang_container_no_padding.elementor-element ' => '--padding-top: 0px; --padding-right: 0px; --padding-bottom: 0px; --padding-left: 0px; ' ,
428
- ),
445
+ 'selectors ' => $ no_padding_styles ,
429
446
)
430
447
);
431
448
@@ -580,9 +597,7 @@ public function register_container_spacing( Controls_Stack $element, $section_id
580
597
'unit ' => 'px ' ,
581
598
),
582
599
'size_units ' => array ( 'px ' , 'em ' , '% ' , 'rem ' , 'vw ' , 'custom ' ),
583
- 'selectors ' => array (
584
- '{{WRAPPER}} {{CURRENT_ITEM}}.elementor-element ' => '--padding-top: {{TOP}}{{UNIT}}; --padding-right: {{RIGHT}}{{UNIT}}; --padding-bottom: {{BOTTOM}}{{UNIT}}; --padding-left: {{LEFT}}{{UNIT}} ' ,
585
- ),
600
+ 'selectors ' => $ padding_preset_styles ,
586
601
'global ' => array (
587
602
'active ' => false ,
588
603
),
@@ -1218,6 +1233,7 @@ public function tweak_section_padding_control( Element_Base $element ) {
1218
1233
* @param Element_Base $element Element_Base Class.
1219
1234
*/
1220
1235
public function tweak_container_widget ( Element_Base $ element ) {
1236
+
1221
1237
if ( ! Utils::is_elementor_container () ) { // Return early if Flexbox container is not active.
1222
1238
return ;
1223
1239
}
@@ -1231,7 +1247,7 @@ public function tweak_container_widget( Element_Base $element ) {
1231
1247
1232
1248
// Register default options array.
1233
1249
$ options = array (
1234
- 'none ' => __ ( 'Default ' , 'ang ' ),
1250
+ 'default_padding ' => __ ( 'Default ' , 'ang ' ),
1235
1251
'ang_container_no_padding ' => __ ( 'No Padding ' , 'ang ' ),
1236
1252
);
1237
1253
@@ -1274,13 +1290,14 @@ public function tweak_container_widget( Element_Base $element ) {
1274
1290
$ element ->add_control (
1275
1291
'ang_container_spacing_size ' ,
1276
1292
array (
1277
- 'label ' => __ ( 'Spacing Preset ' , 'ang ' ),
1278
- 'description ' => sprintf ( '<a href="#" class="ang-notice blue" onClick="%1$s">%2$s</a> ' , "analog.redirectToPanel( 'ang_container_spacing' ) " , __ ( 'Edit in Style Kits ' , 'ang ' ) ),
1279
- 'type ' => Controls_Manager::SELECT ,
1280
- 'hide_in_inner ' => true ,
1281
- 'default ' => 'none ' ,
1282
- 'options ' => $ options ,
1283
- 'prefix_class ' => 'elementor-repeater-item- ' ,
1293
+ 'label ' => __ ( 'Spacing Preset ' , 'ang ' ),
1294
+ 'description ' => sprintf ( '<a href="#" class="ang-notice blue" onClick="%1$s">%2$s</a> ' , "analog.redirectToPanel( 'ang_container_spacing' ) " , __ ( 'Edit in Style Kits ' , 'ang ' ) ),
1295
+ 'type ' => Controls_Manager::SELECT ,
1296
+ 'hide_in_inner ' => false ,
1297
+ 'default ' => 'default_padding ' ,
1298
+ 'options ' => $ options ,
1299
+ 'prefix_class ' => 'elementor-repeater-item- ' ,
1300
+ 'frontend_available ' => true ,
1284
1301
)
1285
1302
);
1286
1303
@@ -1320,7 +1337,7 @@ public function tweak_container_widget_styles( Element_Base $element ) {
1320
1337
'label ' => __ ( 'Background presets ' , 'ang ' ),
1321
1338
'description ' => sprintf ( '<a href="#" class="ang-notice blue" onClick="%1$s">%2$s</a> ' , 'analog.openThemeStyles() ' , 'Edit in Style Kits ' ),
1322
1339
'type ' => Controls_Manager::SELECT ,
1323
- 'hide_in_inner ' => true ,
1340
+ 'hide_in_inner ' => false ,
1324
1341
'default ' => 'none ' ,
1325
1342
'options ' => $ bg_presets ,
1326
1343
'prefix_class ' => 'sk- ' ,
0 commit comments