Astra_Update_Header_Builder_Design::configure()

Configure the ability.


Description


Return

(void)


Source

File: inc/abilities/customizer/header/class-astra-update-header-builder-design.php

	public function configure() {
		$this->id          = 'astra/update-header-builder-design';
		$this->label       = __( 'Update Astra Header Builder Design Options', 'astra' );
		$this->description = __( 'Updates design options for Astra header builder sections (above, primary, below) including background, border color, border size, padding and margin.', 'astra' );
		$this->category    = 'astra';

		$this->meta = array(
			'tool_type'   => 'write',
			'constraints' => array(
				'dependencies' => array(
					array(
						'tool'             => 'astra/get-header-builder-design',
						'description_hint' => 'Get current design settings before updating to preserve existing values',
					),
				),
				'usage_hints'  => array(
					'section'      => 'Required. Target header section to update: "above", "primary", or "below". Each section has independent design settings. Primary header is main navigation bar. DEFAULT to "primary" if user does not explicitly mention above/below header - most users refer to the main primary header when saying "header".',
					'background'   => 'Responsive background object with desktop/tablet/mobile keys. Each device can have: background-color (hex/rgba for header color), background-image (URL for hero header), background-repeat (repeat/no-repeat/repeat-x/repeat-y), background-position (e.g., "center center"), background-size (auto/cover/contain), background-attachment (scroll for normal, fixed for parallax), background-type (color/image/gradient), overlay-type (color/gradient), overlay-color, overlay-gradient. Primary header typically uses solid background-color. Partial updates merge with existing.',
					'border_color' => 'Bottom border color in CSS format (hex like "#dddddd", rgba like "rgba(0,0,0,0.08)", or color name). Creates separation line below header section. Common for primary header to separate from page content. Empty string removes border.',
					'border_size'  => 'Bottom border thickness in pixels (0-10). 0 = no border. Common values: 1px (standard subtle separation), 2px (more prominent). Max 10px for headers (vs 600px for footer) as headers need subtler styling. Works with border_color.',
					'padding'      => 'Responsive internal spacing with desktop/tablet/mobile keys. Each device has top/right/bottom/left (numeric values) and units via desktop-unit/tablet-unit/mobile-unit (px/em/rem/%). Example: {"desktop": {"top": "15", "bottom": "15"}, "desktop-unit": "px"} for compact header. Primary header padding directly affects perceived header height and logo/menu spacing. Common desktop: 10-30px for compact, 20-60px for spacious. Mobile often smaller for screen space.',
					'margin'       => 'Responsive external spacing with desktop/tablet/mobile keys. Each device has top/right/bottom/left (numeric values) and units. Rarely used for headers (more common: padding). Typically 0 for sticky/fixed headers. May add top margin to push header down from viewport edge.',
					'responsive'   => 'All design properties support device-specific values (desktop/tablet/mobile). Desktop values required at minimum. Tablet/mobile inherit from desktop if not specified. Headers often need different padding on mobile (smaller for space). Use responsive backgrounds to hide header images on mobile.',
					'workflow'     => 'Best practice: 1) Call get-header-builder-design to see current values, 2) Modify only properties you want to change, 3) Provide section parameter (required), 4) Use CSS color formats (hex/rgba), numeric values with units for spacing, 5) Test responsive values especially on mobile where header space is limited.',
				),
			),
		);
	}

User Contributed Notes

You must log in before being able to contribute a note or feedback.