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:

Name Type Description
key String

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:

Name Type Description
key String

CSS property to apply to on this element.

value Object

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:

Name Type Description
styles Object

Object with CSS styles to apply to the element.

Returns:

This

Example

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