| @@ -100,8 +100,9 @@ | ||
| 100 | 100 | '{{WRAPPER}}:not(.ablocks-has-block-container), {{WRAPPER}}.ablocks-block--price-menu > .ablocks-block-container', |
| 101 | 101 | $this->get_all_menu_css( $attributes, '' ), |
| 102 | 102 | $this->get_all_menu_css( $attributes, 'Tablet' ), |
| 103 | 103 | $this->get_all_menu_css( $attributes, 'Mobile' ), |
| 104 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_all_menu_css( $attributes, $device ); } ) | |
| 104 | 105 | ); |
| 105 | 106 | $css_generator->add_class_styles( |
| 106 | 107 | '{{WRAPPER}} .ablocks-price-menu-item, {{WRAPPER}} .ablocks-price-menu-item-details', |
| 107 | 108 | $this->get_gap_around_css( $attributes, '' ), |
| @@ -106,8 +107,9 @@ | ||
| 106 | 107 | '{{WRAPPER}} .ablocks-price-menu-item, {{WRAPPER}} .ablocks-price-menu-item-details', |
| 107 | 108 | $this->get_gap_around_css( $attributes, '' ), |
| 108 | 109 | $this->get_gap_around_css( $attributes, 'Tablet' ), |
| 109 | 110 | $this->get_gap_around_css( $attributes, 'Mobile' ), |
| 111 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_gap_around_css( $attributes, $device ); } ) | |
| 110 | 112 | ); |
| 111 | 113 | $css_generator->add_class_styles( |
| 112 | 114 | '{{WRAPPER}} .ablocks-price-menu-item-details-brief', |
| 113 | 115 | $this->get_details_brief_css( $attributes, '' ), |
| @@ -112,8 +114,9 @@ | ||
| 112 | 114 | '{{WRAPPER}} .ablocks-price-menu-item-details-brief', |
| 113 | 115 | $this->get_details_brief_css( $attributes, '' ), |
| 114 | 116 | $this->get_details_brief_css( $attributes, 'Tablet' ), |
| 115 | 117 | $this->get_details_brief_css( $attributes, 'Mobile' ), |
| 118 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_details_brief_css( $attributes, $device ); } ) | |
| 116 | 119 | ); |
| 117 | 120 | $css_generator->add_class_styles( |
| 118 | 121 | '{{WRAPPER}} .ablocks-block--price-menu-item', |
| 119 | 122 | $this->get_item_css( $attributes, '' ), |
| @@ -118,8 +121,9 @@ | ||
| 118 | 121 | '{{WRAPPER}} .ablocks-block--price-menu-item', |
| 119 | 122 | $this->get_item_css( $attributes, '' ), |
| 120 | 123 | $this->get_item_css( $attributes, 'Tablet' ), |
| 121 | 124 | $this->get_item_css( $attributes, 'Mobile' ), |
| 125 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_item_css( $attributes, $device ); } ) | |
| 122 | 126 | ); |
| 123 | 127 | $css_generator->add_class_styles( |
| 124 | 128 | '{{WRAPPER}} .ablocks-block--price-menu-item:hover', |
| 125 | 129 | $this->get_item_hover_css( $attributes, '' ), |
| @@ -124,8 +128,9 @@ | ||
| 124 | 128 | '{{WRAPPER}} .ablocks-block--price-menu-item:hover', |
| 125 | 129 | $this->get_item_hover_css( $attributes, '' ), |
| 126 | 130 | $this->get_item_hover_css( $attributes, 'Tablet' ), |
| 127 | 131 | $this->get_item_hover_css( $attributes, 'Mobile' ), |
| 132 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_item_hover_css( $attributes, $device ); } ) | |
| 128 | 133 | ); |
| 129 | 134 | |
| 130 | 135 | $css_generator->add_class_styles( |
| 131 | 136 | '{{WRAPPER}} .ablocks-price-menu-item', |
| @@ -131,8 +136,9 @@ | ||
| 131 | 136 | '{{WRAPPER}} .ablocks-price-menu-item', |
| 132 | 137 | $this->get_inner_item_css( $attributes, '' ), |
| 133 | 138 | $this->get_inner_item_css( $attributes, 'Tablet' ), |
| 134 | 139 | $this->get_inner_item_css( $attributes, 'Mobile' ), |
| 140 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_inner_item_css( $attributes, $device ); } ) | |
| 135 | 141 | ); |
| 136 | 142 | |
| 137 | 143 | // TitleText CSS |
| 138 | 144 | $css_generator->add_class_styles( |
| @@ -139,8 +145,9 @@ | ||
| 139 | 145 | '{{WRAPPER}} .ablocks-price-menu-item-details-title', |
| 140 | 146 | $this->get_title_text_css( $attributes, '' ), |
| 141 | 147 | $this->get_title_text_css( $attributes, 'Tablet' ), |
| 142 | 148 | $this->get_title_text_css( $attributes, 'Mobile' ), |
| 149 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_title_text_css( $attributes, $device ); } ) | |
| 143 | 150 | ); |
| 144 | 151 | // DescriptionText CSS |
| 145 | 152 | $css_generator->add_class_styles( |
| 146 | 153 | '{{WRAPPER}} .ablocks-price-menu-item-details-des', |
| @@ -146,8 +153,9 @@ | ||
| 146 | 153 | '{{WRAPPER}} .ablocks-price-menu-item-details-des', |
| 147 | 154 | $this->get_description_text_css( $attributes, '' ), |
| 148 | 155 | $this->get_description_text_css( $attributes, 'Tablet' ), |
| 149 | 156 | $this->get_description_text_css( $attributes, 'Mobile' ), |
| 157 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_description_text_css( $attributes, $device ); } ) | |
| 150 | 158 | ); |
| 151 | 159 | // SeparatorText CSS |
| 152 | 160 | $css_generator->add_class_styles( |
| 153 | 161 | '{{WRAPPER}} .ablocks-price-menu-divider__pattern-' . ( $attributes['dividerType'] === 'mask-style' ? 'mask' : 'css' ), |
| @@ -153,8 +161,9 @@ | ||
| 153 | 161 | '{{WRAPPER}} .ablocks-price-menu-divider__pattern-' . ( $attributes['dividerType'] === 'mask-style' ? 'mask' : 'css' ), |
| 154 | 162 | $this->get_divider_css( $attributes, '' ), |
| 155 | 163 | $this->get_divider_css( $attributes, 'Tablet' ), |
| 156 | 164 | $this->get_divider_css( $attributes, 'Mobile' ), |
| 165 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_divider_css( $attributes, $device ); } ) | |
| 157 | 166 | ); |
| 158 | 167 | // PriceText CSS |
| 159 | 168 | $css_generator->add_class_styles( |
| 160 | 169 | '{{WRAPPER}} .ablocks-price-menu-item-price', |
| @@ -160,8 +169,9 @@ | ||
| 160 | 169 | '{{WRAPPER}} .ablocks-price-menu-item-price', |
| 161 | 170 | $this->get_price_text_css( $attributes, '' ), |
| 162 | 171 | $this->get_price_text_css( $attributes, 'Tablet' ), |
| 163 | 172 | $this->get_price_text_css( $attributes, 'Mobile' ), |
| 173 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_price_text_css( $attributes, $device ); } ) | |
| 164 | 174 | ); |
| 165 | 175 | |
| 166 | 176 | return $css_generator->generate_css(); |
| 167 | 177 | } |
| @@ -174,9 +184,9 @@ | ||
| 174 | 184 | |
| 175 | 185 | public function get_item_css( $attributes, $device = '' ) { |
| 176 | 186 | $css = []; |
| 177 | 187 | |
| 178 | - if ( isset( $attributes['transition'] ) ) { | |
| 188 | + if ( ! empty( $attributes['transition'] ) ) { | |
| 179 | 189 | $css['transition-duration'] = $attributes['transition'] . 's'; |
| 180 | 190 | } |
| 181 | 191 | return array_merge( |
| 182 | 192 | [ 'background' => Color::get_css( isset( $attributes['itemBackground'] ) ? $attributes['itemBackground'] : '' ) ], |