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