Helper function to set mapbox stylesheet (avoids need for index.html just to set styles)
346601
function setStyleSheet(url) {
  /* global document */
  document.body.style.margin = '0px';
  const styles = document.createElement('link');
  styles.type = 'text/css';
  styles.rel = 'stylesheet';
  styles.href = url;
  document.head.appendChild(styles);
}
131572
@SuppressWarnings("unchecked")
    private static Map<String, Boolean> getRenderedStylesheetResources(FacesContext facesContext)
    {
        Map<String, Boolean> map = (Map<String, Boolean>) facesContext.getAttributes().get(
                RENDERED_STYLESHEET_RESOURCES_SET);
        if (map == null)
        {
            map = new HashMap<String, Boolean>();
            facesContext.getAttributes().put(RENDERED_STYLESHEET_RESOURCES_SET,map);
        }
        return map;
    }
834726
def update_style(self, title=None,defaults=None,mappings=None, verbose=False):
        
        u=self.__url
        host=u.split("//")[1].split(":")[0]
        port=u.split(":")[2].split("/")[0]
        version=u.split(":")[2].split("/")[1]

        if defaults:
            defaults_=[]
            for d in defaults:
                if d:
                    defaults_.append(d)
            defaults=defaults_

        if mappings:
            mappings_=[]
            for m in mappings:
                if m:
                    mappings_.append(m)
            mappings=mappings_

        URL="http://"+str(host)+":"+str(port)+"/v1/styles/"+str(title)
        if verbose:
            print(URL)
            sys.stdout.flush()

        response = requests.get(URL).json()

        olddefaults=response["defaults"]
        oldmappings=response["mappings"]

        if mappings:
            mappings_visual_properties=[ m["visualProperty"] for m in mappings ]
            newmappings=[ m for m in oldmappings if m["visualProperty"] not in mappings_visual_properties ]
            for m in mappings:
                newmappings.append(m)
        else:
            newmappings=oldmappings

        if defaults:
            defaults_visual_properties=[ m["visualProperty"] for m in defaults ]
            newdefaults=[ m for m in olddefaults if m["visualProperty"] not in defaults_visual_properties ]
            for m in defaults:
                newdefaults.append(m)
        else:
            newdefaults=olddefaults

        r=requests.delete(URL)
        checkresponse(r)

        URL="http://"+str(host)+":"+str(port)+"/v1/styles"
        PARAMS={"title":title,\
            "defaults":newdefaults,\
            "mappings":newmappings}
        r = requests.post(url = URL, json = PARAMS)
        checkresponse(r)
446752
private void appendStyleMap(final XMLUtil util, final Appendable appendable) throws IOException {
        appendable.append("<style:map");
        util.appendEAttribute(appendable, "style:condition", "value()>=0");
        util.appendEAttribute(appendable, "style:apply-style-name", this.dataStyle.getName());
        appendable.append("/>");
    }
856274
function (arg, val) {
            if (arguments.length == 1) {
                if (typeof arg == 'string') {
                    return currentStyle(this[0], arg);
                } else if (vQ.isPlainObject(arg)) {
                    var cssStr = '';
                    vQ.each(arg, function (key, val) {
                        cssStr += key + ':' + val + ';';
                    });
                    setStyle(this[0], cssStr);
                }
            } else if (arguments.length == 2) {
                setStyle(this[0], arg + ':' + val + ';');
            }
            return this;
        }
246165
function setCSS(el, properties) {
    var key;
    for (key in properties) {
      if (properties.hasOwnProperty(key)) {
        el.style[key] = properties[key];
      }
    }
  }
1148373
function checkStylesheet(i) {
  const start = i;
  let l;

  while (i < tokensLength) {
    if (l = checkSC(i)) tokens[i].stylesheet_child = 1;
    else if (l = checkRuleset(i)) tokens[i].stylesheet_child = 2;
    else if (l = checkInclude(i)) tokens[i].stylesheet_child = 3;
    else if (l = checkExtend(i)) tokens[i].stylesheet_child = 4;
    else if (l = checkMixin(i)) tokens[i].stylesheet_child = 5;
    else if (l = checkLoop(i)) tokens[i].stylesheet_child = 6;
    else if (l = checkConditionalStatement(i)) tokens[i].stylesheet_child = 7;
    else if (l = checkAtrule(i)) tokens[i].stylesheet_child = 8;
    else if (l = checkDeclaration(i)) tokens[i].stylesheet_child = 9;
    else if (l = checkDeclDelim(i)) tokens[i].stylesheet_child = 10;
    else throwError(i);

    i += l;
  }

  return i - start;
}
464790
function css(key, val) {
  var style, props;
  if(!this.length) {
    return this;
  }

  if(key && typeof key === 'object') {
    props = key;
  }else if(key && val) {
    props = {};
    props[key] = val;
  }

  // get style object
  if(key === undefined) {
    style = window.getComputedStyle(this.dom[0], null);
    // TODO: convert to plain object map?
    // for the moment return CSSStyleDeclaration
    return style;
  // get single style property value
  }else if(typeof key === 'string' && !val) {
    style = window.getComputedStyle(this.dom[0], null);
    return style.getPropertyValue(key);
  }

  // set inline styles
  this.each(function(el) {
    el.style = el.style;
    for(var z in props) {
      el.style[z] = '' + props[z];
    }
  });
  return this;
}
1163613
function stylesheets(options) {
    return this.stylesheets.reduce(function reduce(links, sheet) {
      return links + options.fn(sheet);
    }, '');
  }
72072
function styleTDTH(elm, name, value) {
            if (elm.tagName === "TD" || elm.tagName === "TH") {
              dom.setStyle(elm, name, value);
            } else {
              if (elm.children) {
                for (var i = 0; i < elm.children.length; i++) {
                  styleTDTH(elm.children[i], name, value);
                }
              }
            }
          }
322256
function (cssText, options) {
    var container = document.head || document.getElementsByTagName('head')[0]
    var style = document.createElement('style')
    options = options || {}
    style.type = 'text/css'
    if (options.href) {
      style.setAttribute('data-href', options.href)
    }
    if (style.sheet) { // for jsdom and IE9+
      style.innerHTML = cssText
      style.sheet.cssText = cssText
    }
    else if (style.styleSheet) { // for IE8 and below
      style.styleSheet.cssText = cssText
    }
    else { // for Chrome, Firefox, and Safari
      style.appendChild(document.createTextNode(cssText))
    }
    if (options.prepend) {
      container.insertBefore(style, container.childNodes[0]);
    } else {
      container.appendChild(style);
    }
    return style
  }
715971
function(initalStyles, onStyleChange) {
  /*jshint latedef:true */
    var _style = {},
        _COMPONENT_STYLES,
        _validStyleValues,
        isValidStyle,
        castValue;


    _COMPONENT_STYLES = [
      'showMicButton',
      'showSpeakerButton',
      'nameDisplayMode',
      'buttonDisplayMode',
      'backgroundImageURI',
      'audioLevelDisplayMode'
    ];

    _validStyleValues = {
      buttonDisplayMode: ['auto', 'mini', 'mini-auto', 'off', 'on'],
      nameDisplayMode: ['auto', 'off', 'on'],
      audioLevelDisplayMode: ['auto', 'off', 'on'],
      showSettingsButton: [true, false],
      showMicButton: [true, false],
      backgroundImageURI: null,
      showControlBar: [true, false],
      showArchiveStatus: [true, false],
      videoDisabledDisplayMode: ['auto', 'off', 'on']
    };

    // Validates the style +key+ and also whether +value+ is valid for +key+
    isValidStyle = function(key, value) {
      return key === 'backgroundImageURI' ||
        (_validStyleValues.hasOwnProperty(key) &&
          OT.$.arrayIndexOf(_validStyleValues[key], value) !== -1 );
    };

    castValue = function(value) {
      switch(value) {
        case 'true':
          return true;
        case 'false':
          return false;
        default:
          return value;
      }
    };

    // Returns a shallow copy of the styles.
    this.getAll = function() {
      var style = OT.$.clone(_style);

      for (var key in style) {
        if(!style.hasOwnProperty(key)) {
          continue;
        }
        if (OT.$.arrayIndexOf(_COMPONENT_STYLES, key) < 0) {

          // Strip unnecessary properties out, should this happen on Set?
          delete style[key];
        }
      }

      return style;
    };

    this.get = function(key) {
      if (key) {
        return _style[key];
      }

      // We haven't been asked for any specific key, just return the lot
      return this.getAll();
    };

    // *note:* this will not trigger onStyleChange if +silent+ is truthy
    this.setAll = function(newStyles, silent) {
      var oldValue, newValue;

      for (var key in newStyles) {
        if(!newStyles.hasOwnProperty(key)) {
          continue;
        }
        newValue = castValue(newStyles[key]);

        if (isValidStyle(key, newValue)) {
          oldValue = _style[key];

          if (newValue !== oldValue) {
            _style[key] = newValue;
            if (!silent) onStyleChange(key, newValue, oldValue);
          }

        } else {
          OT.warn('Style.setAll::Invalid style property passed ' + key + ' : ' + newValue);
        }
      }

      return this;
    };

    this.set = function(key, value) {
      OT.debug('setStyle: ' + key.toString());

      var newValue = castValue(value),
          oldValue;

      if (!isValidStyle(key, newValue)) {
        OT.warn('Style.set::Invalid style property passed ' + key + ' : ' + newValue);
        return this;
      }

      oldValue = _style[key];
      if (newValue !== oldValue) {
        _style[key] = newValue;

        onStyleChange(key, value, oldValue);
      }

      return this;
    };

    if (initalStyles) this.setAll(initalStyles, true);
  }
956060
function setStylesheet(s) {
	var id = "AMMLcustomStyleSheet";
	var n = document.getElementById(id);
	if(document.createStyleSheet) {
		// Test for IE's non-standard createStyleSheet method
		if(n)
			n.parentNode.removeChild(n);
		// This failed without the &nbsp;
		document.getElementsByTagName("head")[0].insertAdjacentHTML("beforeEnd","&nbsp;<style id='" + id + "'>" + s + "</style>");
	} else {
		if(n) {
			n.replaceChild(document.createTextNode(s),n.firstChild);
		} else {
			n = document.createElement("style");
			n.type = "text/css";
			n.id = id;
			n.appendChild(document.createTextNode(s));
			document.getElementsByTagName("head")[0].appendChild(n);
		}
	}
}
1220904
def _update_stylesheet(self, widget):
        """"""
        if is_dark_interface():
            css = qdarkstyle.load_stylesheet_from_environment()
            widget.setStyleSheet(css)
            palette = widget.palette()
            background = palette.color(palette.Window).lighter(150).name()
            border = palette.color(palette.Window).lighter(200).name()
            name = widget.__class__.__name__
            widget.setObjectName(name)
            extra_css = '''
                {0}#{0} {{
                    background-color:{1};
                    border: 1px solid {2};
                }}'''.format(name, background, border)
            widget.setStyleSheet(css + extra_css)
443480
function setStyle(descriptor,key,set,update,el)
        {
          var _proto = el.style,
              _descriptor = descriptor,
              _key = key,
              _keyCP = key.replace(/([A-Z])/g, "-$1").replace('webkit','-webkit'),
              _set = set,
              _update = update,
              _el = el,
              _oldValue,
              _value;
          return {
            get:function(){return _value;},
            set:function styleSet(v)
            {
              _oldValue = _value;
              if(_set(_el,_key,v,_oldValue,undefined,this._stopChange))
              {
                _value = v;
                _proto.setProperty(_keyCP,v);
              }
              if(!this._stopChange)
              {
                _update(_el,_key,v,_oldValue);
              }
              this._stopChange = undefined;
            },
            enumerable:true,
            configurable:true
          }
        }
838113
function style(styles, options = {}) {

	return Class => {

        initCoreMap(storage, Class);
        initStyleMap(storage, Class);

        let map = storage.get(Class);
        let styleMap = map.get('@style');

        // Stylesheets holds the styles (ast) that
        // are passed by the @style decorator
        styleMap.set('stylesheets', styles);

        // referenceNodes holds the current created domNodes (customElements)
        let nodes = styleMap.get('referenceNodes');

        // stylesheetStates holds the event state (event reached or not)
        // of each style-ast in styles object
        let stylesheetStates = styleMap.get('stylesheetStates');

        /**
         * Its required when we use @style multiple times!
         * Only once registration!
         */
        if(map.get('@style').get('callbacksDefined')){
            return;
        }

        let createdAndAttached = domNode => {
            setPath(domNode, '$stylesheets', []);
            // create stylesheet node when no referenceNodes (customelement) exists
            if(!nodes.size) {
                // default state of each style-ast is false (undefined)
                let stylesheetStates = styleMap.get('stylesheetStates');
                createStylesheet(Class, styles, domNode, options, stylesheetStates);
            }
            !nodes.has(domNode) && nodes.set(domNode, domNode);
        };

        map.get('@callbacks').get('created' ).push(createdAndAttached);
        map.get('@callbacks').get('attached').push(createdAndAttached);
        map.get('@callbacks').get('detached').push(domNode => {

            // cleanup
            domNode.$stylesheets.forEach(stylesheet => stylesheet.destroy());

            // remove detached node from referenceNodes
            nodes.has(domNode) && nodes.delete(domNode);

            // not each domNode has $stylesheets, so return when no once found.
            if(!domNode.$stylesheets.length) {
                return null;
            }

            // stylesheetStates (attachOn) are the event state (reached or not reached) of each
            // array object (styles, imports, ...) that are passed by style decorator.
            // The state of an array object is required ...
            // [
            //   {
            //      attachOn: 'load',
            //      type: 'on',
            //      imports: ["a.css", "b.css", "c.css"],
            //      styles: '.baz {color: green;}',
            //   },
            //   {
            //      attachOn: 'immediately',
            //      type: 'lala',
            //      imports: [],
            //      styles: '.laz {color: green;}',
            //   }
            // ]
            stylesheetStates = syncStylesheetStates(domNode.$stylesheets, stylesheetStates) || [];

            // when elements detached from document.body, we need a new node that take the role of $stylesheet
            let node = (nodes.values()).next().value;

            // when node is valid, create fresh stylesheet
            if(node) {
                createStylesheet(Class, styles, node, options, stylesheetStates);
            }

            // save the stylesheetStates
            styleMap.set('stylesheetStates', stylesheetStates);
            //cleanup
            delete domNode.$stylesheets;

        });

        map.get('@style').set('callbacksDefined', true);
	}
}
1177831
function(index, style)
	{
		style = YAHOO.lang.JSON.stringify(style);
		if(this._swf && this._swf.setSeriesStylesByIndex) this._swf.setSeriesStylesByIndex(index, style);
	}