... * ``` * * @see https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-asset-styleattr */ final class StyleAttrViewHelper extends AbstractViewHelper { public function __construct(private readonly DirectiveHashCollection $directiveHashCollection) {} public function initializeArguments(): void { $this->registerArgument('value', 'string', 'The inline style value (e.g. "color: green; text-decoration: underline;")', true); $this->registerArgument('csp', 'bool', 'Whether to collect a CSP hash for this style value', false, true); } public function render(): string { $value = trim($this->arguments['value'] ?? $this->renderChildren()); if ($this->arguments['csp'] ?? true) { $this->directiveHashCollection->addInlineHash(Directive::StyleSrcAttr, $value); } return $value; } }