Nosun Engine Workspace

Developer documentation for core global controls and utility helpers used within custom Elementor elements.

Control Matrix Overview

Method Default ID Render Types Default Fallback (Shorthand) Description & Logic Behaviour Selectors
add_container_width() 'container_width' 'class' | 'inline' 'default' (class)
'' (inline)
Injects standard site container max-widths. If evaluated null, defaults automatically shift based on the rendering type. ✓ Supported
add_spacing() 'spacing' 'class' | 'inline' 'm' (class)
var(--space-m, ... ) (inline)
Applies layout margins/paddings. Falling back to an inline responsive clamp() function logic loop if the CSS class structure is bypassed. ✓ Supported
add_button_style() 'button_style' 'primary filled' Populates standardized UI lookups (Text links, solid fills, or transparent outlines) directly mapped onto theme style architectures. ✓ Supported
add_button_size() 'button_size' 'size-default' Pulls structured component scale parameters (e.g., size-small, size-large) to append onto action triggers. ✓ Supported
add_color() 'color' 'class' | 'inline' 'text'
(Or '' if class/empty flag combo)
Smart Translation Engine: Developers can define defaults using friendly shorthands like 'none', 'primary', or 'headlines'. The method automatically intercepts it and outputs complex Elementor-safe variable fallback chains dynamically if inline is targeted. ✓ Supported

Implementation Guide Examples

Basic Global Package Injection

// Basic injections mapping classes directly onto target templates
Nosun_Elementor_Controls::add_container_width( $this );
Nosun_Elementor_Controls::add_color( $this, 'text_color', 'Textfarbe' ); // Defaults clean to 'text'

Using Shorthand Defaults with Inline Selectors

You don't need to specify complex CSS variable strings. Just pass the name string directly.

Nosun_Elementor_Controls::add_color( 
	$this, 
	'title_color', 
	'Titel Farbe', 
	'inline', 
	'headlines', // <-- Automatically parses safely to: var(--c-headlines, var(--e-global-color-primary))
	false, 
	[ '{{WRAPPER}} .custom-title' => 'color: {{VALUE}};' ] 
);

Nosun_Elementor_Controls::add_color( 
	$this, 
	'box_bg', 
	'Box Hintergrund', 
	'inline', 
	'none', // <-- Set custom default state to None/Inherit securely
	false, 
	[ '{{WRAPPER}} .box' => 'background-color: {{VALUE}};' ] 
);
💡 Framework Guideline Keep using raw $this->add_control() processes if targeted rules require localized visibility arrays ('condition' configurations) or layout segmentations unique to a completely standalone widget component.