PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.14.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.14.0
2.14.0 2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 All 81 releases
← All changes | includes/controls/typography.php +11 -1 2.13.1 → 2.14.0 View file →
@@ -91,9 +91,10 @@
91 91 // Helper: add CSS property with global fallback
92 92 $add_prop = function( $prop, $local_val, $local_unit, $global_key, $css_var_name ) use ( $attribute_global_name, $global_value, &$css ) {
93 93 if ( ! empty( $global_value[ $global_key ] ) ) {
94 94 $css[ $prop ] = "var(--ablocks-{$attribute_global_name}-{$css_var_name})";
95 - } elseif ( ! empty( $local_val ) ) {
95 + } elseif ( \ABlocks\Helper::has_responsive_value( $local_val ) ) {
96 + // A stored 0 is a real value (matches the editor's addProp()).
96 97 $css[ $prop ] = $local_unit ? $local_val . $local_unit : $local_val;
97 98 }
98 99 };
99 100
@@ -145,8 +146,17 @@
145 146
146 147 foreach ( $map as $prop => $css_prop ) {
147 148 $local_val = $value[ $prop . $device ] ?? '';
148 149 $local_unit = $value[ $prop . 'Unit' . $device ] ?? '';
150 + // A custom breakpoint has no unit default, so a value set there
151 + // without touching the unit compiled unitless. Cascade like the
152 + // editor's unit selector does, else px. Native devices unchanged.
153 + if ( '' === $local_unit && ! in_array( $device, [ '', 'Tablet', 'Mobile' ], true ) ) {
154 + $local_unit = \ABlocks\Helper::get_responsive_value( (array) $attribute_value, $prop . 'Unit', $device );
155 + if ( ! $local_unit ) {
156 + $local_unit = 'px';
157 + }
158 + }
149 159 $global_key = $prop . $device;
150 160
151 161 $css_var_name = $css_prop . ( $device ? '-' . strtolower( $device ) : '' );
152 162