Library.Styles

Do not use this directly, this Library needs to be implemented on a class.

Example

var myClassPrototype = new MAF.Class({
    Implements: [
       Library.Styles
    ]
 });

Methods

getStyle(key) → {Object}

This method returns the given CSS property value of element.

Parameters:

NameTypeDescription
keyString

CSS property to fetch.

Returns:

CSS style requested.

getStylesCopy() → {Object}

Returns:

Cloned object with all the styles applied on this component.

setStyle(key, value) → {MAF.Class}

Parameters:

NameTypeDescription
keyString

CSS property to apply to on this element.

valueObject

CSS value

Returns:

This

setStyles(styles) → {MAF.Class}

This method modifies element's CSS style properties. Styles are passed as a hash of property-value pairs in which the properties are specified in their camelized form.

Parameters:

NameTypeDescription
stylesObject

Object with CSS styles to apply to the element.

Returns:

This

Example

.setStyles({
    backgroundColor: '#900',
    fontSize: '12px'
 });