1<?php 2 3 4namespace ComboStrap; 5 6 7use ComboStrap\TagAttribute\BackgroundAttribute; 8 9class Opacity 10{ 11 12 const OPACITY_ATTRIBUTE = "opacity"; 13 14 /** 15 * Set the opacity 16 * 17 * For a background image, the opacity is set on the {@link BackgroundAttribute::processBackgroundAttributes()} 18 * Because the image background parameters are in array, it seems 19 * that they are not interfering 20 * 21 * @param TagAttributes $tagAttributes 22 */ 23 public static function processOpacityAttribute(TagAttributes &$tagAttributes){ 24 25 if ($tagAttributes->hasComponentAttribute(self::OPACITY_ATTRIBUTE)) { 26 $value = $tagAttributes->getValueAndRemove(self::OPACITY_ATTRIBUTE); 27 $tagAttributes->addStyleDeclarationIfNotSet("opacity",$value); 28 } 29 30 } 31 32 33} 34