Adds css properties to this element.
438634
def css(self, *props, **kwprops):
        """"""
        self._stable = False
        styles = {}
        if props:
            if len(props) == 1 and isinstance(props[0], Mapping):
                styles = props[0]
            else:
                raise WrongContentError(self, props, "Arguments not valid")
        elif kwprops:
            styles = kwprops
        else:
            raise WrongContentError(self, None, "args OR wkargs are needed")
        return self.attr(style=styles)
480162
public void add(String cssClass) {
    if (StringUtils.isBlank(cssClass)) {
      return;
    }
    String[] parts = StringUtils.split(cssClass, " ");
    for (String part : parts) {
      items.add(StringUtils.trim(part));
    }
  }
1314005
function setCss (dom, obj) {
    let css = ''

    for (let key in obj) {
      if (!obj[key] && obj[key] !== 0) {
        dom.style.removeProperty(dasherize(key))
      } else {
        css += dasherize(key) + ':' + obj[key] + ';'
      }
    }

    dom.style.cssText += ';' + css
  }
1295872
@Override
    public void addEmbeddedStyles(final StylesContainer stylesContainer) {
        if (this.header != null) this.header.addEmbeddedStyles(stylesContainer);
        if (this.footer != null) this.footer.addEmbeddedStyles(stylesContainer);
    }
61117
private void setSupportedCSS() {

		Map<String, CSSProperty> props = new HashMap<String, CSSProperty>(
				TOTAL_SUPPORTED_DECLARATIONS, 1.0f);

		Map<String, Term<?>> values = new HashMap<String, Term<?>>(
				TOTAL_SUPPORTED_DECLARATIONS, 1.0f);

		// text type
		props.put("color", Color.color);
		values.put("color", DEFAULT_UA_COLOR);
		props.put("opacity", Opacity.number);
		values.put("opacity", DEFAULT_UA_OPACITY);
		props.put("font", Font.component_values);
		props.put("font-family", DEFAULT_UA_FONT_FAMILY);
		props.put("font-size", FontSize.MEDIUM);
		props.put("font-style", FontStyle.NORMAL);
		props.put("font-variant", FontVariant.NORMAL);
		props.put("font-weight", FontWeight.NORMAL);
		props.put("text-decoration", TextDecoration.NONE);
		props.put("text-transform", TextTransform.NONE);

		// text spacing
		props.put("white-space", WhiteSpace.NORMAL);
		props.put("text-align", DEFAULT_UA_TEXT_ALIGN);
		props.put("text-indent", TextIndent.length);
		values.put("text-indent", DEFAULT_UA_TEXT_IDENT);
		props.put("line-height", LineHeight.NORMAL);
		props.put("word-spacing", WordSpacing.NORMAL);
		props.put("letter-spacing", LetterSpacing.NORMAL);
		props.put("vertical-align", VerticalAlign.BASELINE);
		props.put("direction", Direction.LTR);
		props.put("unicode-bidi", UnicodeBidi.NORMAL);
		props.put("tab-size", TabSize.integer);
		values.put("tab-size", DEFAULT_UA_TAB_SIZE);

		// layout box
		props.put("margin", Margin.component_values);
		props.put("margin-top", Margin.length);
		values.put("margin-top", DEFAULT_UA_MARGIN);
		props.put("margin-right", Margin.length);
		values.put("margin-right", DEFAULT_UA_MARGIN);
		props.put("margin-bottom", Margin.length);
		values.put("margin-bottom", DEFAULT_UA_MARGIN);
		props.put("margin-left", Margin.length);
		values.put("margin-left", DEFAULT_UA_MARGIN);

		props.put("padding", Padding.component_values);
		props.put("padding-top", Padding.length);
		values.put("padding-top", DEFAULT_UA_PADDING);
		props.put("padding-right", Padding.length);
		values.put("padding-right", DEFAULT_UA_PADDING);
		props.put("padding-bottom", Padding.length);
		values.put("padding-bottom", DEFAULT_UA_PADDING);
		props.put("padding-left", Padding.length);
		values.put("padding-left", DEFAULT_UA_PADDING);

		props.put("border", Border.component_values);
		props.put("border-top", Border.component_values);
		props.put("border-right", Border.component_values);
		props.put("border-bottom", Border.component_values);
		props.put("border-left", Border.component_values);

		props.put("border-width", BorderWidth.component_values);
		props.put("border-top-width", BorderWidth.MEDIUM);
		props.put("border-right-width", BorderWidth.MEDIUM);
		props.put("border-bottom-width", BorderWidth.MEDIUM);
		props.put("border-left-width", BorderWidth.MEDIUM);
		props.put("border-style", BorderStyle.component_values);
		props.put("border-top-style", BorderStyle.NONE);
		props.put("border-right-style", BorderStyle.NONE);
		props.put("border-bottom-style", BorderStyle.NONE);
		props.put("border-left-style", BorderStyle.NONE);

		props.put("border-color", BorderColor.component_values);
		props.put("border-top-color", BorderColor.color);
        values.put("border-top-color", DEFAULT_BORDER_COLOR);
		props.put("border-right-color", BorderColor.color);
		values.put("border-right-color", DEFAULT_BORDER_COLOR);
		props.put("border-bottom-color", BorderColor.color);
		values.put("border-bottom-color", DEFAULT_BORDER_COLOR);
		props.put("border-left-color", BorderColor.color);
		values.put("border-left-color", DEFAULT_BORDER_COLOR);

        props.put("border-radius", BorderRadius.component_values);
		props.put("border-top-left-radius", BorderRadius.list_values);
		values.put("border-top-left-radius", DEFAULT_UA_BORDER_RADIUS);
        props.put("border-top-right-radius", BorderRadius.list_values);
        values.put("border-top-right-radius", DEFAULT_UA_BORDER_RADIUS);
        props.put("border-bottom-right-radius", BorderRadius.list_values);
        values.put("border-bottom-right-radius", DEFAULT_UA_BORDER_RADIUS);
        props.put("border-bottom-left-radius", BorderRadius.list_values);
        values.put("border-bottom-left-radius", DEFAULT_UA_BORDER_RADIUS);
		
		props.put("width", Width.AUTO);
		props.put("min-width", MinWidth.length);
		values.put("min-width", DEFAULT_UA_MIN_WIDTH);
		props.put("max-width", MaxWidth.NONE);
		props.put("height", Height.AUTO);
		props.put("min-height", MinHeight.length);
		values.put("min-height", DEFAULT_UA_MIN_HEIGHT);
		props.put("max-height", MaxHeight.NONE);
		props.put("overflow", Overflow.component_values);
        props.put("overflow-x", Overflow.VISIBLE);
        props.put("overflow-y", Overflow.VISIBLE);
		props.put("clip", Clip.AUTO);
		props.put("box-sizing", BoxSizing.CONTENT_BOX);
        props.put("box-shadow", BoxShadow.NONE);

		// positioning
		props.put("display", Display.INLINE);
		props.put("position", Position.STATIC);
		props.put("top", Top.AUTO);
		props.put("right", Right.AUTO);
		props.put("bottom", Bottom.AUTO);
		props.put("left", Left.AUTO);
		props.put("float", CSSProperty.Float.NONE);
		props.put("clear", Clear.NONE);
		props.put("z-index", ZIndex.AUTO);
		props.put("visibility", Visibility.VISIBLE);
		props.put("transform", Transform.NONE);
		props.put("transform-origin", TransformOrigin.list_values);
		values.put("transform-origin", DEFAULT_UA_TRANSFORM_ORIGIN);

		// background
		props.put("background", Background.component_values);
		props.put("background-attachment", BackgroundAttachment.SCROLL);
		props.put("background-color", BackgroundColor.color);
		values.put("background-color", DEFAULT_BACKGROUND_COLOR);
		props.put("background-image", BackgroundImage.NONE);
		props.put("background-position", BackgroundPosition.list_values);
		values.put("background-position", DEFAULT_UA_BACKGROUND_POSITION);
		props.put("background-size", BackgroundSize.list_values);
        values.put("background-size", DEFAULT_UA_BACKGROUND_SIZE);
		props.put("background-repeat", BackgroundRepeat.REPEAT);
		
		// box shadow
		props.put("box-shadow", BoxShadow.NONE);

		// elements
		props.put("list-style", ListStyle.component_values);
		props.put("list-style-type", ListStyleType.DISC);
		props.put("list-style-position", ListStylePosition.OUTSIDE);
		props.put("list-style-image", ListStyleImage.NONE);

		props.put("border-collapse", BorderCollapse.SEPARATE);
		props.put("border-spacing", BorderSpacing.list_values);
		values.put("border-spacing", DEFAULT_UA_BORDER_SPACING);
		props.put("empty-cells", EmptyCells.SHOW);
		props.put("table-layout", TableLayout.AUTO);
		props.put("caption-side", CaptionSide.TOP);

		// other supported by tables (width, vertical-align)
		// are already defined
		props.put("content", Content.NORMAL);
		props.put("quotes", Quotes.NONE);
		props.put("counter-increment", CounterIncrement.NONE);
		props.put("counter-reset", CounterReset.NONE);

		// filter
		props.put("filter", Filter.NONE);
        props.put("backdrop-filter", BackdropFilter.NONE);
		
		// miscellaneous
		props.put("cursor", Cursor.AUTO);
		props.put("outline", Outline.component_values);
		props.put("outline-width", OutlineWidth.MEDIUM);
		props.put("outline-style", OutlineStyle.NONE);
		props.put("outline-color", OutlineColor.INVERT);

		props.put("page-break", PageBreak.AUTO);
		props.put("page-break-before", PageBreak.AUTO);
		props.put("page-break-after", PageBreak.AUTO);
		props.put("page-break-inside", PageBreakInside.AUTO);

		props.put("widows", Widows.integer);
		values.put("widows", DEFAULT_UA_WIDOWS);
		props.put("orphans", Orphans.integer);
		values.put("orphans", DEFAULT_UA_ORPHANS);

		// other values according to
		// http://www.w3.org/TR/CSS21/propidx.html

		props.put("azimuth", Azimuth.CENTER);
		props.put("cue", Cue.component_values);
		props.put("cue-before", Cue.NONE);
		props.put("cue-after", Cue.NONE);
		props.put("elevation", Elevation.LEVEL);
		props.put("pause", Pause.component_values);
		props.put("pause-before", Pause.time);
		values.put("pause-before", DEFAULT_UA_PAUSE_BEFORE);
		props.put("pause-after", Pause.time);
		values.put("pause-after", DEFAULT_UA_PAUSE_AFTER);
		props.put("pitch-range", PitchRange.number);
		values.put("pitch-range", DEFAULT_UA_PITCH_RANGE);
		props.put("pitch", Pitch.MEDIUM);
		props.put("play-during", PlayDuring.AUTO);
		props.put("richness", Richness.number);
		values.put("richness", DEFAULT_UA_RICHNESS);
		props.put("speak-header", SpeakHeader.ONCE);
		props.put("speak-numeral", SpeakNumeral.CONTINUOUS);
		props.put("speak-punctuation", SpeakPunctuation.NONE);
		props.put("speak", Speak.NORMAL);
		props.put("speech-rate", SpeechRate.MEDIUM);
		props.put("stress", Stress.number);
		values.put("stress", DEFAULT_UA_STRESS);
		props.put("voice-family", DEFAULT_UA_VOICE_FAMILY);
		props.put("volume", Volume.MEDIUM);

		// Flexbox
        props.put("flex", Flex.component_values);
        props.put("flex-flow", FlexFlow.component_values);
		props.put("flex-direction", FlexDirection.ROW);
		props.put("flex-wrap", FlexWrap.NOWRAP);
		props.put("flex-basis", FlexBasis.AUTO);
		props.put("flex-grow", FlexGrow.number);
		values.put("flex-grow", DEFAULT_FLEX_GROW);
		props.put("flex-shrink", FlexShrink.number);
		values.put("flex-shrink", DEFAULT_FLEX_SHRINK);
		props.put("order", Order.integer);
		values.put("order", DEFAULT_ORDER);
		props.put("justify-content", JustifyContent.FLEX_START);
		props.put("align-content", AlignContent.STRETCH);
		props.put("align-items", AlignItems.STRETCH);
		props.put("align-self", AlignSelf.AUTO);

        // grid layout
        props.put("grid", Grid.component_values);
        props.put("grid-gap", GridGap.component_values);
        props.put("grid-row-gap", GridGap.NORMAL);
        props.put("grid-column-gap", GridGap.NORMAL);
        props.put("grid-area", Grid.component_values);
        props.put("grid-row", Grid.component_values);
        props.put("grid-column", Grid.component_values);
        props.put("grid-row-start", GridStartEnd.AUTO);
        props.put("grid-column-start", GridStartEnd.AUTO);
        props.put("grid-row-end", GridStartEnd.AUTO);
        props.put("grid-column-end", GridStartEnd.AUTO);
        props.put("grid-template", Grid.component_values);
        props.put("grid-template-areas", GridTemplateAreas.NONE);
        props.put("grid-template-rows", GridTemplateRowsColumns.NONE);
        props.put("grid-template-columns", GridTemplateRowsColumns.NONE);
        props.put("grid-auto-flow", GridAutoFlow.ROW);
        props.put("grid-auto-rows", GridAutoRowsColumns.AUTO);
        props.put("grid-auto-columns", GridAutoRowsColumns.AUTO);
        
        // animation
        props.put("animation", Animation.component_values);
        props.put("animation-delay", AnimationDelay.time);
        values.put("animation-delay", DEFAULT_TIME);
        props.put("animation-direction", AnimationDirection.NORMAL);
        props.put("animation-duration", AnimationDuration.time);
        values.put("animation-duration", DEFAULT_TIME);
        props.put("animation-fill-mode", AnimationFillMode.NONE);
        props.put("animation-iteration-count", AnimationIterationCount.number);
        values.put("animation-iteration-count", DEFAULT_ITERATION_COUNT);
        props.put("animation-name", AnimationName.NONE);
        props.put("animation-play-state", AnimationPlayState.RUNNING);
        props.put("animation-timing-function", AnimationTimingFunction.EASE);
        
        // transition
        props.put("transition", Transition.component_values);
        props.put("transition-delay", TransitionDelay.time);
        values.put("transition-delay", DEFAULT_TIME);
        props.put("transition-duration", TransitionDuration.time);
        values.put("transition-duration", DEFAULT_TIME);
        props.put("transition-property", TransitionProperty.ALL);
        props.put("transition-timing-function", TransitionTimingFunction.EASE);

		this.defaultCSSproperties = props;
		this.defaultCSSvalues = values;
	}
1180696
private void applyStyles(Document doc) {
        Elements allStyledElements = doc.getElementsByAttribute(CSS_STYLE);

        for (Element e : allStyledElements) {
            String newStyle = e.attr(CSS_STYLE);
            String oldStyle = e.attr(STYLE_ATTR);
            e.attr(STYLE_ATTR, (newStyle + "; " + oldStyle).replace(";;", ";"));
            e.removeAttr(CSS_STYLE);
        }
    }
334990
function ( Parent, proto, options ) {
  		if ( !options.css ) return;

  		var id = uuid();
  		var styles = options.noCssTransform ? options.css : transformCss( options.css, id );

  		proto.cssId = id;

  		addCSS( { id: id, styles: styles } );

  	}
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;
    }
1011879
function add_css()
    {
        if ($this->css_loaded) {
            return;
        }

        $skin_path = $this->enigma->local_skin_path();
        $this->enigma->include_stylesheet("$skin_path/enigma.css");
        $this->css_loaded = true;
    }
895989
function createProperties(el) {
	var properties = {};

	if (!el.hasAttributes()) {
		return properties;
	}

	var ns;
	if (el.namespaceURI && el.namespaceURI !== HTML_NAMESPACE) {
		ns = el.namespaceURI;
	}

	var attr;
	for (var i = 0; i < el.attributes.length; i++) {
		// use built in css style parsing
		if(el.attributes[i].name == 'style'){
			attr = createStyleProperty(el);
		}
		else if (ns) {
			attr = createPropertyNS(el.attributes[i]);
		} else {
			attr = createProperty(el.attributes[i]);
		}

		// special case, namespaced attribute, use properties.foobar
		if (attr.ns) {
			properties[attr.name] = {
				namespace: attr.ns
				, value: attr.value
			};

		// special case, use properties.attributes.foobar
		} else if (attr.isAttr) {
			// init attributes object only when necessary
			if (!properties.attributes) {
				properties.attributes = {}
			}
			properties.attributes[attr.name] = attr.value;

		// default case, use properties.foobar
		} else {
			properties[attr.name] = attr.value;
		}
	};

	return properties;
}
232322
public function init()
    {
        Html::addCssClass($this->htmlOptions, Enum::SWITCH_BUTTON);
        if ($this->size) {
            Html::addCssClass($this->htmlOptions, $this->size);
        }
        if ($this->radius) {
            Html::addCssClass($this->htmlOptions, $this->radius);
        }
        parent::init();
    }
1330221
def add_class(self, cssclass):
        """"""
        if self.has_class(cssclass):
            return self
        return self.toggle_class(cssclass)
1339856
protected function addDefaultStyles() {
        $this->consoleFormatter->style('error')->parseStyle('clr=white bg=red');
        $this->consoleFormatter->style('warning')->parseStyle('clr=black bg=yellow');
        $this->consoleFormatter->style('success')->parseStyle('clr=black bg=green');

        $this->consoleFormatter->style('question')->parseStyle('clr=green');
        $this->consoleFormatter->style('header')->parseStyle('clr=yellow');
        $this->consoleFormatter->style('title')->parseStyle('clr=yellow');
        $this->consoleFormatter->style('keyword')->parseStyle('clr=green');

        $this->consoleFormatter->style('green')->parseStyle('clr=green');
        $this->consoleFormatter->style('yellow')->parseStyle('clr=yellow');
        $this->consoleFormatter->style('red')->parseStyle('clr=red');
        $this->consoleFormatter->style('white')->parseStyle('clr=white');
        $this->consoleFormatter->style('blue')->parseStyle('clr=blue');
        $this->consoleFormatter->style('gray')->parseStyle('clr=gray');
        $this->consoleFormatter->style('black')->parseStyle('clr=black');

        $this->consoleFormatter->style('bold')->parseStyle('fmt=bold');
        $this->consoleFormatter->style('italic')->parseStyle('fmt=italic');
        $this->consoleFormatter->style('underline')->parseStyle('fmt=underline');
        $this->consoleFormatter->style('strikethrough')->parseStyle('fmt=strikethrough');
    }
470381
protected void bind(Element element, CmsDomUtil.Style... attributes) {

        if (m_elem == null) {
            // create playground
            m_elem = DOM.createDiv();
            Style style = m_elem.getStyle();
            style.setVisibility(Style.Visibility.HIDDEN);
            style.setPosition(Style.Position.ABSOLUTE);
            style.setLeft(-5000, Style.Unit.PX);
            style.setTop(-5000, Style.Unit.PX);
        }
        // copy all relevant CSS properties
        Style style = m_elem.getStyle();
        for (CmsDomUtil.Style attr : attributes) {
            String attrName = attr.toString();
            style.setProperty(attrName, CmsDomUtil.getCurrentStyle(element, attr));
        }
        // append playground
        RootPanel.getBodyElement().appendChild(m_elem);
    }
886573
protected final function AddCssIDField()
    {
        $name = 'CssID';
        $this->AddField(Input::Text($name, $this->Content()->GetCssID()), false, Trans("Core.ContentForm.$name"));
    }
1168919
private void initCss() {

        I_CmsLayoutBundle.INSTANCE.galleryDialogCss().ensureInjected();
        I_CmsLayoutBundle.INSTANCE.galleryResultItemCss().ensureInjected();
        I_CmsLayoutBundle.INSTANCE.listTreeCss().ensureInjected();
        I_CmsLayoutBundle.INSTANCE.previewDialogCss().ensureInjected();
        I_CmsLayoutBundle.INSTANCE.croppingDialogCss().ensureInjected();
        I_CmsLayoutBundle.INSTANCE.imageEditorFormCss().ensureInjected();
        I_CmsLayoutBundle.INSTANCE.imageAdvancedFormCss().ensureInjected();
    }
1267947
public static void addDisablingOverlay(Element element) {

        Element overlay = DOM.createDiv();
        overlay.addClassName(I_CmsLayoutBundle.INSTANCE.generalCss().disablingOverlay());
        element.getStyle().setPosition(Position.RELATIVE);
        element.appendChild(overlay);
    }