******************** Style related *************************************
190805
@Override protected Skin createDefaultSkin() {
        switch (skinType) {
            case AMP            : return new AmpSkin(Gauge.this);
            case PLAIN_AMP      : return new PlainAmpSkin(Gauge.this);
            case BULLET_CHART   : return new BulletChartSkin(Gauge.this);
            case DASHBOARD      : return new DashboardSkin(Gauge.this);
            case FLAT           : return new FlatSkin(Gauge.this);
            case INDICATOR      : return new IndicatorSkin(Gauge.this);
            case KPI            : return new KpiSkin(Gauge.this);
            case MODERN         : return new ModernSkin(Gauge.this);
            case SIMPLE         : return new SimpleSkin(Gauge.this);
            case SLIM           : return new SlimSkin(Gauge.this);
            case SPACE_X        : return new SpaceXSkin(Gauge.this);
            case QUARTER        : return new QuarterSkin(Gauge.this);
            case HORIZONTAL     : return new HSkin(Gauge.this);
            case VERTICAL       : return new VSkin(Gauge.this);
            case LCD            : return new LcdSkin(Gauge.this);
            case TINY           : return new TinySkin(Gauge.this);
            case BATTERY        : return new BatterySkin(Gauge.this);
            case LEVEL          : return new LevelSkin(Gauge.this);
            case LINEAR         : return new LinearSkin(Gauge.this);
            case DIGITAL        : return new DigitalSkin(Gauge.this);
            case SIMPLE_DIGITAL : return new SimpleDigitalSkin(Gauge.this);
            case SECTION        : return new SectionSkin(Gauge.this);
            case BAR            : return new BarSkin(Gauge.this);
            case WHITE          : return new WhiteSkin(Gauge.this);
            case CHARGE         : return new ChargeSkin(Gauge.this);
            case SIMPLE_SECTION : return new SimpleSectionSkin(Gauge.this);
            case TILE_KPI       : return new TileKpiSkin(Gauge.this);
            case TILE_TEXT_KPI  : return new TileTextKpiSkin(Gauge.this);
            case TILE_SPARK_LINE: return new TileSparklineSkin(Gauge.this);
            case GAUGE          :
            default             : return new GaugeSkin(Gauge.this);
        }
    }
916492
def set_style(self, style):
        
        if style is not None:
            try:
                self.style.update(style)
            except ValueError:
                for s in style.split(';'):
                    k, v = s.split(':', 1)
                    self.style[k.strip()] = v.strip()
308564
function(nodes, options) {
        for(var i=0, len=nodes.length; i<len; i++) {
            var style = this.parseStyle(nodes[i]);
            if(style) {
                var styleName = (options.styleBaseUrl || "") + "#" + style.id;
                
                this.styles[styleName] = style;
            }
        }
    }
377971
function addStyles(page, styles) {
        page.evaluate(function(styles) {
            var style = document.createElement('style'),
                content = document.createTextNode(styles),
                head = document.head;

            style.setAttribute('type', 'text/css');
            style.appendChild(content);

            head.insertBefore(style, head.firstChild);
        }, styles);
    }
25969
function handleStyles(styles, props, context) {
  let current
  const mappedArgs = []
  const nonGlamorClassNames = []
  for (let i = 0; i < styles.length; i++) {
    current = styles[i]
    while (typeof current === 'function') {
      current = current(props, context)
    }
    if (typeof current === 'string') {
      const {glamorStyles, glamorlessClassName} = extractGlamorStyles(current)
      mappedArgs.push(...glamorStyles)
      nonGlamorClassNames.push(...glamorlessClassName)
    } else if (Array.isArray(current)) {
      const recursed = handleStyles(current, props, context)
      mappedArgs.push(...recursed.mappedArgs)
      nonGlamorClassNames.push(...recursed.nonGlamorClassNames)
    } else {
      mappedArgs.push(current)
    }
  }
  return {mappedArgs, nonGlamorClassNames}
}
675568
function(settings, styles) {
  if (_.isArray(styles) && styles.length > 0) {
    _.each(styles, function(obj) {
      if (!_.has(obj, 'name')) {
        return;
      }
      var style = _.findWhere(settings.styles, { name: obj.name });
      if (!_.isUndefined(style)) {
        style.configure(obj);
      } else {
        settings.styles.push( toGrawlixStyle(obj) );
      }
    });
  }
  return settings;
}
236327
function(style, url, callback) {
    var text = style.textContent;
    var done = function(text) {
      style.textContent = text;
      callback(style);
    };
    this.resolve(text, url, done);
  }
997319
function() {
        var style = this._element.style,
            coord = this.__coord || [0, 0, 0, 0],
            co = {
                x: coord[0],
                y: coord[1],
                w: coord[2],
                h: coord[3]
            },
            prefix = Crafty.support.prefix,
            trans = [];

        if (this._cssStyles.visibility !== this._visible) {
            this._cssStyles.visibility = this._visible;
            if (!this._visible) {
                style.visibility = "hidden";
            } else {
                style.visibility = "visible";
            }
        }

        //utilize CSS3 if supported
        if (Crafty.support.css3dtransform && !this.avoidCss3dTransforms) {
            trans.push(
                "translate3d(" + ~~this._x + "px," + ~~this._y + "px,0)"
            );
        } else {
            if (this._cssStyles.left !== this._x) {
                this._cssStyles.left = this._x;
                style.left = ~~this._x + "px";
            }
            if (this._cssStyles.top !== this._y) {
                this._cssStyles.top = this._y;
                style.top = ~~this._y + "px";
            }
        }

        if (this._cssStyles.width !== this._w) {
            this._cssStyles.width = this._w;
            style.width = ~~this._w + "px";
        }
        if (this._cssStyles.height !== this._h) {
            this._cssStyles.height = this._h;
            style.height = ~~this._h + "px";
        }
        if (this._cssStyles.zIndex !== this._z) {
            this._cssStyles.zIndex = this._z;
            style.zIndex = this._z;
        }

        if (this._cssStyles.opacity !== this._alpha) {
            this._cssStyles.opacity = this._alpha;
            style.opacity = this._alpha;
            style[prefix + "Opacity"] = this._alpha;
        }

        if (this._mbr) {
            var origin = this._origin.x + "px " + this._origin.y + "px";
            style.transformOrigin = origin;
            style[prefix + "TransformOrigin"] = origin;
            if (Crafty.support.css3dtransform)
                trans.push("rotateZ(" + this._rotation + "deg)");
            else trans.push("rotate(" + this._rotation + "deg)");
        }

        if (this._flipX) {
            trans.push("scaleX(-1)");
        }

        if (this._flipY) {
            trans.push("scaleY(-1)");
        }

        if (this._cssStyles.transform !== trans.join(" ")) {
            this._cssStyles.transform = trans.join(" ");
            style.transform = this._cssStyles.transform;
            style[prefix + "Transform"] = this._cssStyles.transform;
        }

        this.trigger("Draw", {
            style: style,
            type: "DOM",
            co: co
        });

        return this;
    }
992263
private void applyHtmlStyle(Element element, ShapeStyle style) {
		if (style.getFillColor() != null && !"".equals(style.getFillColor())) {
			Dom.setStyleAttribute(element, "fillColor", style.getFillColor());
		}
		Dom.setStyleAttribute(element, "fillOpacity", Float.toString(style.getFillOpacity()));
		if (style.getStrokeColor() != null && !"".equals(style.getStrokeColor())) {
			Dom.setStyleAttribute(element, "stroke", style.getStrokeColor());
		}
		Dom.setStyleAttribute(element, "strokeOpacity", Float.toString(style.getStrokeOpacity()));
		if (style.getStrokeWidth() >= 0) {
			Dom.setStyleAttribute(element, "strokeWidth", Float.toString(style.getStrokeWidth()));
		}
	}
169128
function appendStyle(code) {
        var dom = document.createElement('style');
        dom.innerHTML = code;
        head.appendChild(dom);
    }
842808
def stylize(text, styles, reset=True):
    """"""
    terminator = attr("reset") if reset else ""
    return "{}{}{}".format("".join(styles), text, terminator)
633969
function hstyle(st) {
			// Prepare string
			var s = '';
			for (var key in st) {
				s += '<' + key;
				for (var attr in st[key]) {
					s += ' ';
					if (attr.substr(0, 2) == 'x:') {
						s += attr;
					} else {
						s += 'ss:';
					}
					s += attr + '="' + st[key][attr] + '"';
				}
				s += '/>';
			}

			var hh = hash(s);
			// Store in hash
			if (styles[hh]) {
			} else {
				styles[hh] = {styleid: stylesn};
				s2 += '<Style ss:ID="s' + stylesn + '">';
				s2 += s;
				s2 += '</Style>';
				stylesn++;
			}
			return 's' + styles[hh].styleid;
		}
1152971
public void applyStyleToElement(Style style, JRDesignElement designElemen) {
        if (style == null) {
//			log.warn("NULL style passed to object");
            JRDesignStyle style_ = new JRDesignStyle();
            style_.setName(createUniqueStyleName());
            designElemen.setStyle(style_);
            try {
                getDesign().addStyle(style_);
            } catch (JRException e) {
                //duplicated style, its ok
            }
//			return null;
            return;
        }
        boolean existsInDesign = style.getName() != null
                && design.getStylesMap().get(style.getName()) != null;
        //		&& !style.isOverridesExistingStyle();

        JRDesignStyle jrstyle;
        //Let's allways add a new JR style
        if (existsInDesign && !style.isOverridesExistingStyle()) {
            jrstyle = (JRDesignStyle) design.getStylesMap().get(style.getName());
        } else {
            addStyleToDesign(style); //Order maters. This line fist
            jrstyle = style.transform();
        }

        designElemen.setStyle(jrstyle);
        if (designElemen instanceof JRDesignTextElement) {
            JRDesignTextElement textField = (JRDesignTextElement) designElemen;
            if (style.getStreching() != null)
                textField.setStretchType(StretchTypeEnum.getByValue(style.getStreching().getValue()));
            textField.setPositionType(PositionTypeEnum.FLOAT);

        }
        if (designElemen instanceof JRDesignTextField) {
            JRDesignTextField textField = (JRDesignTextField) designElemen;
            textField.setStretchWithOverflow(style.isStretchWithOverflow());

            if (!textField.isBlankWhenNull() && style.isBlankWhenNull()) //TODO Re check if this condition is ok
                textField.setBlankWhenNull(true);
        }

        if (designElemen instanceof JRDesignGraphicElement) {
            JRDesignGraphicElement graphicElement = (JRDesignGraphicElement) designElemen;
            graphicElement.setStretchType(StretchTypeEnum.getByValue(style.getStreching().getValue()));
            graphicElement.setPositionType(PositionTypeEnum.FLOAT);
        }
    }
1104770
function(style)
	{
		if (style != null)
		{
			var pairs = style.split(';');
			var stylename = pairs[0];
			
			if (stylename.indexOf('=') < 0)
			{
				return stylename;
			}
		}
				
		return '';
	}
147131
private void style(View view, int value) {
        view.setScaleX(value);
        view.setScaleY(value);
        view.setAlpha(value);
    }
1167577
public void setStyle(String style) {

        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_style)) {
            m_component.removeStyleName(m_style);
        }
        m_style = style;
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_style)) {
            m_component.addStyleName(m_style);
        }
    }
30621
function (otherStyle, overwrite) {
        if (otherStyle) {
            for (var name in otherStyle) {
                if (otherStyle.hasOwnProperty(name)
                    && (overwrite === true
                        || (
                            overwrite === false
                                ? !this.hasOwnProperty(name)
                                : otherStyle[name] != null
                        )
                    )
                ) {
                    this[name] = otherStyle[name];
                }
            }
        }
    }