# ablocks/2.11.1/includes/blocks/marquee/block.php

aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder &amp; Animation Builder, version 2.11.1. 77 lines.

- Page: https://pluginprobe.com/plugins/ablocks/2.11.1/code/includes/blocks/marquee/block.php
- Raw: https://pluginprobe.com/plugins/ablocks/2.11.1/raw/includes/blocks/marquee/block.php
- Modified: 2025-07-14T14:48:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ablocks/2.11.1/code/includes/blocks/marquee/block.php#L10-L20`.

```php
<?php
namespace ABlocks\Blocks\Marquee;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

use ABlocks\Classes\BlockBaseAbstract;
use ABlocks\Classes\CssGenerator;
use ABlocks\Classes\CssGeneratorV2;
use ABlocks\Controls\Range;


class Block extends BlockBaseAbstract {
	protected $block_name = 'marquee';

	public function build_css_v1( $attributes ) {
		// Generate CSS start
		$css_generator = new CssGenerator( $attributes, $this->block_name );

		$css_generator->add_class_styles(
			'{{WRAPPER}} .ablocks-block-marquee .ablocks-block-marquee__children',
			$this->get_inner_block_css( $attributes ),
			$this->get_inner_block_css( $attributes, 'Tablet' ),
			$this->get_inner_block_css( $attributes, 'Mobile' )
		);

		return $css_generator->generate_css();
	}
	public function build_css_v2( $attributes ) {
		// Generate CSS start
		$css_generator = new CssGeneratorV2( $attributes, $this->block_name );

		$css_generator->add_class_styles(
			'{{WRAPPER}} .ablocks-block-marquee .ablocks-block-marquee__children',
			$this->get_inner_block_css( $attributes ),
			$this->get_inner_block_css( $attributes, 'Tablet' ),
			$this->get_inner_block_css( $attributes, 'Mobile' )
		);

		return $css_generator->generate_css();
	}

	public function build_css( $attributes ) {
		if ( isset( $attributes['blockVersion'] ) && (int) $attributes['blockVersion'] === 2 ) {
			return $this->build_css_v2( $attributes );
		}
		return $this->build_css_v1( $attributes );
	}

	public function get_inner_block_css( $attributes, $device = '' ) {
		$css = [];
		if ( ! empty( $attributes['gap'][ 'value' . $device ] ) ) {
			$gap_value = $attributes['gap'][ 'value' . $device ];
			$gap_unit = ! empty( $attributes['gap'][ 'valueUnit' . $device ] )
				? $attributes['gap'][ 'valueUnit' . $device ]
				: 'px';

			$css['gap'] = $gap_value . $gap_unit;
		}
		return array_merge(
			Range::get_css([
				'attributeValue'       => $attributes['gap'],
				'attribute_object_key' => 'value',
				'isResponsive'         => true,
				'defaultValue'         => 12,
				'hasUnit'              => false,
				'unitDefaultValue'     => 'px',
				'property'             => 'gap',
				'device'               => $device,
			]),
			$css
		);
	}

}

```
