Set multiple styles at one $str e.g. "BI"
505989
function SetStyles($str)
	{
		$style = '';
		foreach (['B', 'I'] as $s) {
			if (strpos($str, $s) !== false) {
				$this->$s = true;
				$style .= $s;
			} else {
				$this->$s = false;
			}
		}
		$this->currentfontstyle = $style;
		$this->SetFont('', $style, 0, false);
	}
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()
352223
def _set_desc(self):
        """"""
        # TODO: manage different in/out styles
        if self.docs['in']['desc']:
            self.docs['out']['desc'] = self.docs['in']['desc']
        else:
            self.docs['out']['desc'] = ''
851746
function styleItalic(sq) {
  if (sq.hasFormat('i') || sq.hasFormat('em')) {
    sq.changeFormat(null, {tag: 'i'});
  } else if (!sq.hasFormat('a') && !sq.hasFormat('PRE')) {
    if (sq.hasFormat('code')) {
      sq.changeFormat(null, {tag: 'code'});
    }
    sq.italic();
  }
}
1188786
public static function apply($str, $styles)
    {
        Arguments::validate($str, ['string']);
        Arguments::validate($styles, ['string', 'array']);

        if(!is_array($styles)) { $styles = [$styles]; }
        foreach($styles as $style) {
            $str = self::_apply($str, $style);
        }
        return $str;
    }
3684
def attr(self, *args, **kwargs):
        """"""
        kwargs.update({k: bool for k in args})
        for key, value in kwargs.items():
            if key == "klass":
                self.attrs["klass"].update(value.split())
            elif key == "style":
                if isinstance(value, str):
                    splitted = iter(re.split(";|:", value))
                    value = dict(zip(splitted, splitted))
                self.attrs["style"].update(value)
            else:
                self.attrs[key] = value
        self._stable = False
        return self
236256
function stringifyStyle(style) {
  if (typeof style === 'string') {
    return style;
  }
  var values = [];
  for (var key in style) {
    values.push(key + ':' + style[key]);
  }
  return values.join(';');
}
850811
function initStyle(opt_config) {
  var config = objects.clone(defaultConfig);
  if (opt_config) {
    objects.merge(config, opt_config);
  }
  var attrName = config.attributeName;
  var selector = '[' + attrName + ']';
  var rules = {};
  rules[selector] = {'display': 'none !important'};
  ui.createStyle(rules);
}
6389
function(node, att, val, style) {
        style = style || node.style;
        var CUSTOM_STYLES = Y_DOM.CUSTOM_STYLES,
            current;

        if (style) {
            if (val === null || val === '') { // normalize unsetting
                val = '';
            } else if (!isNaN(new Number(val)) && re_unit.test(att)) { // number values may need a unit
                val += Y_DOM.DEFAULT_UNIT;
            }

            if (att in CUSTOM_STYLES) {
                if (CUSTOM_STYLES[att].set) {
                    CUSTOM_STYLES[att].set(node, val, style);
                    return; // NOTE: return
                } else if (typeof CUSTOM_STYLES[att] === 'string') {
                    att = CUSTOM_STYLES[att];
                }
            }
            style[att] = val; 
        }
    }
723680
def _asStr(self):
        '''
            
        '''

        styleDict = self._styleDict
        if styleDict:
            return '; '.join([name + ': ' + value for name, value in styleDict.items()])
        return ''
1334333
function applyStyle($text, $styles = [])
    {
        if (!self::$supported)
            return $text;

        if (is_string($styles))
        {
            $styles = [$styles];
        }

        $output = $text;
        foreach ($styles as $style) {
            if (isset(self::$theme[$style])) {
                $output = $this->applyStyle($output, self::$theme[$style]);
            } else {
                if (isset(self::$styles[$style])) {
                    $pre  = $this->escSequence(self::$styles[$style]);
                    $post = $this->escSequence(0);
                } else {
                    $pre = $post = '';
                }

                $output = $pre . $output . $post;
            }
        }

        return $output;
    }
1057798
def _read_style(style):
    ''' '''

    if isinstance(style, string_types):
        style = [style]
    else:
        style = list(style)

    return style
231706
function setStyle(element, styles) {
  var style = element.style;


  forEach(styles, function (value, property) {
    if (REGEXP_SUFFIX.test(property) && isNumber(value)) {
      value += 'px';
    }

    style[property] = value;
  });
}
79986
protected function set_active_styles() {

		if ( ! empty( $this->struct['size'] ) ) {
			$str = '';
			foreach ( $this->struct['size'] as $fr ) {
				$str .= $fr . 'fr ';
			}
			$style = '.uix-grid.col-' . implode( '-', $this->struct['size'] ) . '{grid-template-columns:' . $str . ';}';
			$style .= '@media screen and (max-width: 600px){';
			$style .= '.uix-grid.col-' . implode( '-', $this->struct['size'] ) . '{grid-template-columns:1fr;}';
			$style .= '}';
			uix_share()->set_active_styles( $style );
		}
	}
1104770
function(style)
	{
		if (style != null)
		{
			var pairs = style.split(';');
			var stylename = pairs[0];
			
			if (stylename.indexOf('=') < 0)
			{
				return stylename;
			}
		}
				
		return '';
	}
468993
def center_str(txt, font_name, font_size, offset=0):
    """"""
    return -(text_width(txt, font_name, font_size) / 2.0) + offset
711736
def _compose_style(self):
        """"""
        valid_styles = (
            'color', 'width', 'filter', 'strokeWidth', 'strokeColor',
        )
        self.styling = '\n'.join(
            '{prop}: {style}'.format(prop=s, style=getattr(self, s))
            for s in valid_styles
            if getattr(self, s) is not None
        )