GetStyleClass(); $sPrimaryColor = $oStyle->GetMainColor(); $sComplementaryColor = $oStyle->GetComplementaryColor(); if (!is_null($sPrimaryColor) && !is_null($sComplementaryColor)) { $aCSSClasses = array_merge(explode(' ', $sStyleClass), ['ibo-field-badge']); $oBadge = new FieldBadge(null, $aCSSClasses); $sDecorationClasses = $oStyle->GetDecorationClasses(); if (!is_null($sDecorationClasses) && !empty($sDecorationClasses)) { $oBadge->AddHtml(" "); } $oBadge->AddHtml("$sValue"); // Add custom style // TODO 3.0 To be removed when compilation supports generated CSS $oBadge->AddHtml(<< .$sStyleClass { color: $sComplementaryColor; background-color: $sPrimaryColor; } HTML ); } } if (!$oBadge) { $oBadge = new FieldBadge(); $oBadge->AddHtml("$sValue"); } return $oBadge; } }