CSS API

setCss

A css property will be written to the current stylesheet. The rule will be chosen based on the parameters passed.

tilepieces.core.setCss(element, propertyName, value, selectorText);

Parameters

element
The DOM element that should be affected by the property. If insertStyleSheets is not setted, the property will be written in its style attribute.
propertyName
DOMString representing the CSS property name (hyphen case) to be modified.
value
DOMString containing the new property value. If not specified, treated as the empty string. Note: value should not contain "!important", and if the chosen rule for insertion already exists it will be ignored.
selectorText
If not specified, it will take the one associated with the element. This is either the last rule (by specificity) associated with the element or one formed by tagName + assigned classes (for example "div.class1.class2").

Return Value

The value actually assigned by the browser to the rule. This may differ from the value written in the parameters.