# ablocks/2.9.1/includes/blocks/form-checkbox/block.php

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

- Page: https://pluginprobe.com/plugins/ablocks/2.9.1/code/includes/blocks/form-checkbox/block.php
- Raw: https://pluginprobe.com/plugins/ablocks/2.9.1/raw/includes/blocks/form-checkbox/block.php
- Modified: 2025-04-22T12:59:06+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.9.1/code/includes/blocks/form-checkbox/block.php#L10-L20`.

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

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

use ABlocks\Classes\BlockBaseAbstract;
use ABlocks\Classes\CssGenerator;

class Block extends BlockBaseAbstract {
	protected $parent_block_name = 'form-builder';
	protected $block_name = 'form-checkbox';

	public function build_css( $attributes ) {
		$css_generator = new CssGenerator( $attributes );
		$css_generator->add_class_styles(
			'{{WRAPPER}}',
			$this->get_wrapper_css( $attributes ),
			$this->get_wrapper_css( $attributes, 'Tablet' ),
			$this->get_wrapper_css( $attributes, 'Mobile' )
		);
		$css_generator->add_class_styles(
			'{{WRAPPER}}.ablocks-block--form-checkbox',
			$this->get_input_block_main_wrapper( $attributes ),
			$this->get_input_block_main_wrapper( $attributes, 'Tablet' ),
			$this->get_input_block_main_wrapper( $attributes, 'Mobile' ),
		);
		return $css_generator->generate_css();
	}
	public function get_wrapper_css() {
		return [];
	}
	public function get_input_block_main_wrapper( $attributes, $device = '' ) {
		$css = [];
		$css['display'] = 'inline-block';
		$css['box-sizing'] = 'border-box';
		$css['padding'] = '0px 2px';
		if ( isset( $attributes['inputWidth'] ) ) {
			$css['width'] = ( $attributes['inputWidth'] - 1 ) . '%';
		}

		return $css;
	}
}

```
