<?php
$styles = [];
$background = isset($attributes['backgroundColor']) ? (string) $attributes['backgroundColor'] : '';
$text_color = isset($attributes['textColor']) ? (string) $attributes['textColor'] : '';
$icon_color = isset($attributes['iconColor']) ? (string) $attributes['iconColor'] : '';

if ($background !== '') {
  $styles[] = 'background:' . $background;
}
if ($text_color !== '') {
  $styles[] = 'color:' . $text_color;
}
if ($icon_color !== '') {
  $styles[] = '--nordie-info-icon-color:' . $icon_color;
}

$style_attr = $styles ? ' style="' . esc_attr(implode(';', $styles)) . '"' : '';
?>
<section class="fjord-info fjord-reveal">
  <div class="fjord-info__inner"<?php echo $style_attr; ?>>
    <?php echo $content; ?>
  </div>
</section>
