add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline--outer-wrap .ablocks-icon-maker svg', $this->get_content_timeline_icon_css( $attributes ), $this->get_content_timeline_icon_css( $attributes, 'Tablet' ), $this->get_content_timeline_icon_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_icon_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline--outer-wrap .ablocks-icon-maker .ablocks-icon-wrap img.ablocks-image-icon', $this->get_content_timeline_icon_image_css( $attributes ), $this->get_content_timeline_icon_image_css( $attributes, 'Tablet' ), $this->get_content_timeline_icon_image_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_icon_image_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline--outer-wrap .ablocks__in-view-icon .ablocks-icon-wrap', $this->get_content_timeline_icon_background_css( $attributes ), $this->get_content_timeline_icon_background_css( $attributes, 'Tablet' ), $this->get_content_timeline_icon_background_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_icon_background_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline .ablocks-block-content-timeline__line', $this->get_content_timeline_connector_css( $attributes ), $this->get_content_timeline_connector_css( $attributes, 'Tablet' ), $this->get_content_timeline_connector_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_connector_css( $attributes, $device ); } ) ); $this->add_item_gap_line_gap_and_icon_styles( $css_generator, $attributes ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline--outer-wrap', $this->get_content_timeline_horizontal_gap_css( $attributes ), $this->get_content_timeline_horizontal_gap_css( $attributes, 'Tablet' ), $this->get_content_timeline_horizontal_gap_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_horizontal_gap_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline--outer-wrap .ablocks-block-content-timeline-child--field .ablocks-block-content-timeline-child__content-part', $this->get_content_timeline_content_css( $attributes ), $this->get_content_timeline_content_css( $attributes, 'Tablet' ), $this->get_content_timeline_content_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_content_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline-child__content-part .ablocks-block-content-timeline-child__arrow::after', $this->get_content_timeline_content_background_css( $attributes ), $this->get_content_timeline_content_background_css( $attributes, 'Tablet' ), $this->get_content_timeline_content_background_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_content_background_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline--outer-wrap .ablocks__in-view-icon', $this->get_content_timeline_connector_alignment_css( $attributes ), $this->get_content_timeline_connector_alignment_css( $attributes, 'Tablet' ), $this->get_content_timeline_connector_alignment_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_connector_alignment_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline-child__date', $this->get_content_timeline_date_alignment_css( $attributes ), $this->get_content_timeline_date_alignment_css( $attributes, 'Tablet' ), $this->get_content_timeline_date_alignment_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_date_alignment_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline-child__date,.ablocks-block-content-timeline-child__inner-content-date', $this->get_content_timeline_date_css( $attributes ), $this->get_content_timeline_date_css( $attributes, 'Tablet' ), $this->get_content_timeline_date_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_date_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline-child__inner-content-date', $this->get_content_timeline_date_mobile_css( $attributes, 'Mobile' ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline-child__inner-content-date:hover', $this->get_content_timeline_date_hover_mobile_css( $attributes, 'Mobile' ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline-child__date-inner', $this->get_content_timeline_show_date_center_css( $attributes, '' ), $this->get_content_timeline_show_date_center_css( $attributes, 'Tablet' ), $this->get_content_timeline_show_date_center_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_show_date_center_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline-child__date', $this->get_content_timeline_show_date_left_right_css( $attributes, '' ), $this->get_content_timeline_show_date_left_right_css( $attributes, 'Tablet' ), $this->get_content_timeline_show_date_left_right_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_show_date_left_right_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline-child__inner-content-date', $this->get_content_timeline_show_date_mobile_css( $attributes, '' ), $this->get_content_timeline_show_date_mobile_css( $attributes, 'Tablet' ), $this->get_content_timeline_show_date_mobile_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_show_date_mobile_css( $attributes, $device ); } ) ); return $css_generator->generate_css(); } public function build_css_v2( $attributes ) { $css_generator = new CssGeneratorV2( $attributes, $this->block_name ); // Generate and add CSS styles for different parts of the block $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-icon-maker svg', $this->get_content_timeline_icon_css( $attributes ), $this->get_content_timeline_icon_css( $attributes, 'Tablet' ), $this->get_content_timeline_icon_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_icon_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-icon-maker .ablocks-icon-wrap img.ablocks-image-icon', $this->get_content_timeline_icon_image_css( $attributes ), $this->get_content_timeline_icon_image_css( $attributes, 'Tablet' ), $this->get_content_timeline_icon_image_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_icon_image_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline--outer-wrap .ablocks__in-view-icon', $this->get_content_timeline_icon_background_css( $attributes ), $this->get_content_timeline_icon_background_css( $attributes, 'Tablet' ), $this->get_content_timeline_icon_background_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_icon_background_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline .ablocks-block-content-timeline__line', $this->get_content_timeline_connector_css( $attributes ), $this->get_content_timeline_connector_css( $attributes, 'Tablet' ), $this->get_content_timeline_connector_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_connector_css( $attributes, $device ); } ) ); $this->add_item_gap_line_gap_and_icon_styles( $css_generator, $attributes ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline--outer-wrap', $this->get_content_timeline_horizontal_gap_css( $attributes ), $this->get_content_timeline_horizontal_gap_css( $attributes, 'Tablet' ), $this->get_content_timeline_horizontal_gap_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_horizontal_gap_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline--outer-wrap .ablocks-block-content-timeline-child--field .ablocks-block-content-timeline-child__content-part', $this->get_content_timeline_content_css( $attributes ), $this->get_content_timeline_content_css( $attributes, 'Tablet' ), $this->get_content_timeline_content_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_content_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline-child__content-part .ablocks-block-content-timeline-child__arrow::after', $this->get_content_timeline_content_background_css( $attributes ), $this->get_content_timeline_content_background_css( $attributes, 'Tablet' ), $this->get_content_timeline_content_background_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_content_background_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline--outer-wrap .ablocks__in-view-icon', $this->get_content_timeline_connector_alignment_css( $attributes ), $this->get_content_timeline_connector_alignment_css( $attributes, 'Tablet' ), $this->get_content_timeline_connector_alignment_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_connector_alignment_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline-child__date', $this->get_content_timeline_date_alignment_css( $attributes ), $this->get_content_timeline_date_alignment_css( $attributes, 'Tablet' ), $this->get_content_timeline_date_alignment_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_date_alignment_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline-child__date,.ablocks-block-content-timeline-child__inner-content-date', $this->get_content_timeline_date_css( $attributes ), $this->get_content_timeline_date_css( $attributes, 'Tablet' ), $this->get_content_timeline_date_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_date_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline-child__inner-content-date', $this->get_content_timeline_date_mobile_css( $attributes, 'Mobile' ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline-child__inner-content-date:hover', $this->get_content_timeline_date_hover_mobile_css( $attributes, 'Mobile' ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline-child__date-inner', $this->get_content_timeline_show_date_center_css( $attributes, '' ), $this->get_content_timeline_show_date_center_css( $attributes, 'Tablet' ), $this->get_content_timeline_show_date_center_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_show_date_center_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline-child__date', $this->get_content_timeline_show_date_left_right_css( $attributes, '' ), $this->get_content_timeline_show_date_left_right_css( $attributes, 'Tablet' ), $this->get_content_timeline_show_date_left_right_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_show_date_left_right_css( $attributes, $device ); } ) ); $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline-child__inner-content-date', $this->get_content_timeline_show_date_mobile_css( $attributes, '' ), $this->get_content_timeline_show_date_mobile_css( $attributes, 'Tablet' ), $this->get_content_timeline_show_date_mobile_css( $attributes, 'Mobile' ), $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_content_timeline_show_date_mobile_css( $attributes, $device ); } ) ); return $css_generator->generate_css(); } /** * Item Gap, Line to Content Gap and the icon setup (All mode); shared by * the v1 and v2 generators. Mirrors edit.js. */ private function add_item_gap_line_gap_and_icon_styles( $css_generator, $attributes ) { $css_generator->add_class_styles( '{{WRAPPER}} .ablocks-block-content-timeline--outer-wrap .ablocks-block-content-timeline-child--field', $this->get_content_timeline_icon_size_var_css( $attributes ) ); // Item Gap only between consecutive items, never above the first one // (`~` also skips the inline