xref: /plugin/combo/ComboStrap/Opacity.php (revision 82a60d039cd81033dc8147c27f0a50716b7a5301)
137748cd8SNickeau<?php
237748cd8SNickeau
337748cd8SNickeau
437748cd8SNickeaunamespace ComboStrap;
537748cd8SNickeau
637748cd8SNickeau
737748cd8SNickeauclass Opacity
837748cd8SNickeau{
937748cd8SNickeau
1037748cd8SNickeau    const OPACITY_ATTRIBUTE = "opacity";
1137748cd8SNickeau
1237748cd8SNickeau    /**
1337748cd8SNickeau     * Set the opacity
1437748cd8SNickeau     *
1537748cd8SNickeau     * For a background image, the opacity is set on the {@link Background::processBackgroundAttributes()}
1637748cd8SNickeau     * Because the image background parameters are in array, it seems
1737748cd8SNickeau     * that they are not interfering
1837748cd8SNickeau     *
1937748cd8SNickeau     * @param TagAttributes $tagAttributes
2037748cd8SNickeau     */
2137748cd8SNickeau    public static function processOpacityAttribute(TagAttributes &$tagAttributes){
2237748cd8SNickeau
2337748cd8SNickeau        if ($tagAttributes->hasComponentAttribute(self::OPACITY_ATTRIBUTE)) {
2437748cd8SNickeau            $value = $tagAttributes->getValueAndRemove(self::OPACITY_ATTRIBUTE);
25*82a60d03SNickeau            $tagAttributes->addStyleDeclarationIfNotSet("opacity",$value);
2637748cd8SNickeau        }
2737748cd8SNickeau
2837748cd8SNickeau    }
2937748cd8SNickeau
3037748cd8SNickeau
3137748cd8SNickeau}
32