| @@ -26,9 +26,10 @@ | ||
| 26 | 26 | $css_generator->add_class_styles( |
| 27 | 27 | '{{WRAPPER}}', |
| 28 | 28 | $this->get_wrapper_css( $attributes ), |
| 29 | 29 | $this->get_wrapper_css( $attributes, 'Tablet' ), |
| 30 | - $this->get_wrapper_css( $attributes, 'Mobile' ) | |
| 30 | + $this->get_wrapper_css( $attributes, 'Mobile' ), | |
| 31 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_wrapper_css( $attributes, $device ); } ) | |
| 31 | 32 | ); |
| 32 | 33 | // Generate wrapper CSS end |
| 33 | 34 | |
| 34 | 35 | // Generate button CSS start |
| @@ -35,9 +36,10 @@ | ||
| 35 | 36 | $css_generator->add_class_styles( |
| 36 | 37 | '{{WRAPPER}} .ablocks-block-container .ablocks-button', |
| 37 | 38 | $this->get_button_css( $attributes ), |
| 38 | 39 | $this->get_button_css( $attributes, 'Tablet' ), |
| 39 | - $this->get_button_css( $attributes, 'Mobile' ) | |
| 40 | + $this->get_button_css( $attributes, 'Mobile' ), | |
| 41 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_button_css( $attributes, $device ); } ) | |
| 40 | 42 | ); |
| 41 | 43 | // Generate button CSS end |
| 42 | 44 | |
| 43 | 45 | // Generate button hover CSS start |
| @@ -44,9 +46,10 @@ | ||
| 44 | 46 | $css_generator->add_class_styles( |
| 45 | 47 | '{{WRAPPER}} .ablocks-block-container .ablocks-button:hover', |
| 46 | 48 | $this->get_button_hover_css( $attributes ), |
| 47 | 49 | $this->get_button_hover_css( $attributes, 'Tablet' ), |
| 48 | - $this->get_button_hover_css( $attributes, 'Mobile' ) | |
| 50 | + $this->get_button_hover_css( $attributes, 'Mobile' ), | |
| 51 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_button_hover_css( $attributes, $device ); } ) | |
| 49 | 52 | ); |
| 50 | 53 | |
| 51 | 54 | // Generate button icon hover CSS |
| 52 | 55 | $css_generator->add_class_styles( |
| @@ -52,9 +55,10 @@ | ||
| 52 | 55 | $css_generator->add_class_styles( |
| 53 | 56 | '{{WRAPPER}} .ablocks-block-container .ablocks-button:hover .ablocks-icon-wrap svg.ablocks-svg-icon', |
| 54 | 57 | $this->get_icon_hover_css( $attributes ), |
| 55 | 58 | $this->get_icon_hover_css( $attributes, 'Tablet' ), |
| 56 | - $this->get_icon_hover_css( $attributes, 'Mobile' ) | |
| 59 | + $this->get_icon_hover_css( $attributes, 'Mobile' ), | |
| 60 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_icon_hover_css( $attributes, $device ); } ) | |
| 57 | 61 | ); |
| 58 | 62 | |
| 59 | 63 | // Generate button text CSS start |
| 60 | 64 | $css_generator->add_class_styles( |
| @@ -66,15 +70,17 @@ | ||
| 66 | 70 | $css_generator->add_class_styles( |
| 67 | 71 | '{{WRAPPER}} .ablocks-icon-wrap', |
| 68 | 72 | Icon::get_wrapper_css( $attributes ), |
| 69 | 73 | Icon::get_wrapper_css( $attributes, 'Tablet' ), |
| 70 | - Icon::get_wrapper_css( $attributes, 'Mobile' ) | |
| 74 | + Icon::get_wrapper_css( $attributes, 'Mobile' ), | |
| 75 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return Icon::get_wrapper_css( $attributes, $device ); } ) | |
| 71 | 76 | ); |
| 72 | 77 | $css_generator->add_class_styles( |
| 73 | 78 | '{{WRAPPER}} .ablocks-icon-wrap:hover', |
| 74 | 79 | Icon::get_wrapper_hover_css( $attributes ), |
| 75 | 80 | Icon::get_wrapper_hover_css( $attributes, 'Tablet' ), |
| 76 | - Icon::get_wrapper_hover_css( $attributes, 'Mobile' ) | |
| 81 | + Icon::get_wrapper_hover_css( $attributes, 'Mobile' ), | |
| 82 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return Icon::get_wrapper_hover_css( $attributes, $device ); } ) | |
| 77 | 83 | ); |
| 78 | 84 | |
| 79 | 85 | $css_generator->add_class_styles( |
| 80 | 86 | '{{WRAPPER}} .ablocks-icon-wrap img.ablocks-image-icon', |
| @@ -79,9 +85,10 @@ | ||
| 79 | 85 | $css_generator->add_class_styles( |
| 80 | 86 | '{{WRAPPER}} .ablocks-icon-wrap img.ablocks-image-icon', |
| 81 | 87 | Icon::get_element_image_css( $attributes ), |
| 82 | 88 | Icon::get_element_image_css( $attributes, 'Tablet' ), |
| 83 | - Icon::get_element_image_css( $attributes, 'Mobile' ) | |
| 89 | + Icon::get_element_image_css( $attributes, 'Mobile' ), | |
| 90 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return Icon::get_element_image_css( $attributes, $device ); } ) | |
| 84 | 91 | ); |
| 85 | 92 | $css_generator->add_class_styles( |
| 86 | 93 | '{{WRAPPER}} .ablocks-icon-wrap img.ablocks-image-icon:hover', |
| 87 | 94 | Icon::get_element_image_hover_css( $attributes ), |
| @@ -91,15 +98,17 @@ | ||
| 91 | 98 | $css_generator->add_class_styles( |
| 92 | 99 | '{{WRAPPER}} .ablocks-icon-wrap svg.ablocks-svg-icon', |
| 93 | 100 | Icon::get_element_css( $attributes ), |
| 94 | 101 | Icon::get_element_css( $attributes, 'Tablet' ), |
| 95 | - Icon::get_element_css( $attributes, 'Mobile' ) | |
| 102 | + Icon::get_element_css( $attributes, 'Mobile' ), | |
| 103 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return Icon::get_element_css( $attributes, $device ); } ) | |
| 96 | 104 | ); |
| 97 | 105 | $css_generator->add_class_styles( |
| 98 | 106 | '{{WRAPPER}} .ablocks-icon-wrap svg.ablocks-svg-icon:hover', |
| 99 | 107 | Icon::get_element_image_hover_css( $attributes ), |
| 100 | 108 | Icon::get_element_image_hover_css( $attributes, 'Tablet' ), |
| 101 | - Icon::get_element_image_hover_css( $attributes, 'Mobile' ) | |
| 109 | + Icon::get_element_image_hover_css( $attributes, 'Mobile' ), | |
| 110 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return Icon::get_element_image_hover_css( $attributes, $device ); } ) | |
| 102 | 111 | ); |
| 103 | 112 | |
| 104 | 113 | return $css_generator->generate_css(); |
| 105 | 114 | } |
| @@ -109,9 +118,10 @@ | ||
| 109 | 118 | $css_generator->add_class_styles( |
| 110 | 119 | '{{WRAPPER}}', |
| 111 | 120 | $this->get_wrapper_css( $attributes ), |
| 112 | 121 | $this->get_wrapper_css( $attributes, 'Tablet' ), |
| 113 | - $this->get_wrapper_css( $attributes, 'Mobile' ) | |
| 122 | + $this->get_wrapper_css( $attributes, 'Mobile' ), | |
| 123 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_wrapper_css( $attributes, $device ); } ) | |
| 114 | 124 | ); |
| 115 | 125 | // Generate wrapper CSS end |
| 116 | 126 | |
| 117 | 127 | // Generate button CSS start |
| @@ -118,9 +128,10 @@ | ||
| 118 | 128 | $css_generator->add_class_styles( |
| 119 | 129 | '{{WRAPPER}} .ablocks-button', |
| 120 | 130 | $this->get_button_css( $attributes ), |
| 121 | 131 | $this->get_button_css( $attributes, 'Tablet' ), |
| 122 | - $this->get_button_css( $attributes, 'Mobile' ) | |
| 132 | + $this->get_button_css( $attributes, 'Mobile' ), | |
| 133 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_button_css( $attributes, $device ); } ) | |
| 123 | 134 | ); |
| 124 | 135 | |
| 125 | 136 | // Generate button hover CSS start |
| 126 | 137 | $css_generator->add_class_styles( |
| @@ -126,9 +137,10 @@ | ||
| 126 | 137 | $css_generator->add_class_styles( |
| 127 | 138 | '{{WRAPPER}} .ablocks-button:hover', |
| 128 | 139 | $this->get_button_hover_css( $attributes ), |
| 129 | 140 | $this->get_button_hover_css( $attributes, 'Tablet' ), |
| 130 | - $this->get_button_hover_css( $attributes, 'Mobile' ) | |
| 141 | + $this->get_button_hover_css( $attributes, 'Mobile' ), | |
| 142 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_button_hover_css( $attributes, $device ); } ) | |
| 131 | 143 | ); |
| 132 | 144 | |
| 133 | 145 | // Generate button icon hover CSS |
| 134 | 146 | $css_generator->add_class_styles( |
| @@ -134,9 +146,10 @@ | ||
| 134 | 146 | $css_generator->add_class_styles( |
| 135 | 147 | '{{WRAPPER}} .ablocks-button:hover .ablocks-icon-wrap svg.ablocks-svg-icon', |
| 136 | 148 | $this->get_icon_hover_css( $attributes ), |
| 137 | 149 | $this->get_icon_hover_css( $attributes, 'Tablet' ), |
| 138 | - $this->get_icon_hover_css( $attributes, 'Mobile' ) | |
| 150 | + $this->get_icon_hover_css( $attributes, 'Mobile' ), | |
| 151 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_icon_hover_css( $attributes, $device ); } ) | |
| 139 | 152 | ); |
| 140 | 153 | |
| 141 | 154 | // Generate button text CSS start |
| 142 | 155 | $css_generator->add_class_styles( |
| @@ -148,15 +161,17 @@ | ||
| 148 | 161 | $css_generator->add_class_styles( |
| 149 | 162 | '{{WRAPPER}} .ablocks-icon-wrap', |
| 150 | 163 | Icon::get_wrapper_css( $attributes ), |
| 151 | 164 | Icon::get_wrapper_css( $attributes, 'Tablet' ), |
| 152 | - Icon::get_wrapper_css( $attributes, 'Mobile' ) | |
| 165 | + Icon::get_wrapper_css( $attributes, 'Mobile' ), | |
| 166 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return Icon::get_wrapper_css( $attributes, $device ); } ) | |
| 153 | 167 | ); |
| 154 | 168 | $css_generator->add_class_styles( |
| 155 | 169 | '{{WRAPPER}} .ablocks-icon-wrap:hover', |
| 156 | 170 | Icon::get_wrapper_hover_css( $attributes ), |
| 157 | 171 | Icon::get_wrapper_hover_css( $attributes, 'Tablet' ), |
| 158 | - Icon::get_wrapper_hover_css( $attributes, 'Mobile' ) | |
| 172 | + Icon::get_wrapper_hover_css( $attributes, 'Mobile' ), | |
| 173 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return Icon::get_wrapper_hover_css( $attributes, $device ); } ) | |
| 159 | 174 | ); |
| 160 | 175 | |
| 161 | 176 | $css_generator->add_class_styles( |
| 162 | 177 | '{{WRAPPER}} .ablocks-icon-wrap img.ablocks-image-icon', |
| @@ -161,9 +176,10 @@ | ||
| 161 | 176 | $css_generator->add_class_styles( |
| 162 | 177 | '{{WRAPPER}} .ablocks-icon-wrap img.ablocks-image-icon', |
| 163 | 178 | Icon::get_element_image_css( $attributes ), |
| 164 | 179 | Icon::get_element_image_css( $attributes, 'Tablet' ), |
| 165 | - Icon::get_element_image_css( $attributes, 'Mobile' ) | |
| 180 | + Icon::get_element_image_css( $attributes, 'Mobile' ), | |
| 181 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return Icon::get_element_image_css( $attributes, $device ); } ) | |
| 166 | 182 | ); |
| 167 | 183 | $css_generator->add_class_styles( |
| 168 | 184 | '{{WRAPPER}} .ablocks-icon-wrap img.ablocks-image-icon:hover', |
| 169 | 185 | Icon::get_element_image_hover_css( $attributes ), |
| @@ -168,20 +184,23 @@ | ||
| 168 | 184 | '{{WRAPPER}} .ablocks-icon-wrap img.ablocks-image-icon:hover', |
| 169 | 185 | Icon::get_element_image_hover_css( $attributes ), |
| 170 | 186 | Icon::get_element_image_hover_css( $attributes, 'Tablet' ), |
| 171 | 187 | Icon::get_element_image_hover_css( $attributes, 'Mobile' ), |
| 188 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return Icon::get_element_image_hover_css( $attributes, $device ); } ) | |
| 172 | 189 | ); |
| 173 | 190 | $css_generator->add_class_styles( |
| 174 | 191 | '{{WRAPPER}} .ablocks-icon-wrap svg.ablocks-svg-icon', |
| 175 | 192 | Icon::get_element_css( $attributes ), |
| 176 | 193 | Icon::get_element_css( $attributes, 'Tablet' ), |
| 177 | - Icon::get_element_css( $attributes, 'Mobile' ) | |
| 194 | + Icon::get_element_css( $attributes, 'Mobile' ), | |
| 195 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return Icon::get_element_css( $attributes, $device ); } ) | |
| 178 | 196 | ); |
| 179 | 197 | $css_generator->add_class_styles( |
| 180 | 198 | '{{WRAPPER}} .ablocks-icon-wrap svg.ablocks-svg-icon:hover', |
| 181 | 199 | Icon::get_element_image_hover_css( $attributes ), |
| 182 | 200 | Icon::get_element_image_hover_css( $attributes, 'Tablet' ), |
| 183 | - Icon::get_element_image_hover_css( $attributes, 'Mobile' ) | |
| 201 | + Icon::get_element_image_hover_css( $attributes, 'Mobile' ), | |
| 202 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return Icon::get_element_image_hover_css( $attributes, $device ); } ) | |
| 184 | 203 | ); |
| 185 | 204 | |
| 186 | 205 | return $css_generator->generate_css(); |
| 187 | 206 | } |