• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/node/style.php
  • Класс: BitrixLandingNodeStyle
  • Вызов: Style::getStyle
static function getStyle(Block $block, string $selector): array
{
	$data = [];
	$resultList = self::getNodesBySelector($block, $selector);

	foreach ($resultList as $pos => $res)
	{
		if ($res->getNodeType() === $res::ELEMENT_NODE)
		{
			$classList = trim($res->getAttribute('class'));
			if ($classList)
			{
				$data['classList'][$pos] = $classList;
			}

			$styles = StyleInliner::getStyle($res);
			$stylesPrepared = [];
			foreach ($styles as $key => $style)
			{
				if ($style && $key !== 'background-image')
				{
					$stylesPrepared[$key] = $style;
				}
				if ($key === 'background-image' && $style === '')
				{
					$stylesPrepared[$key] = $style;
				}
			}
			if (!empty($stylesPrepared))
			{
				$data['style'][$pos] = $stylesPrepared;

			}
		}
	}

	return $data;
}