# Mixin: Styleable

## domjscomp. Styleable

Mixin adds methods css and style manipulations

### Methods

#### addStyle(style)

  Add css class to element

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `style` | string | array.<string> | class to add

#### containsStyle(style)

  Check if element contains css class

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `style` | string | style to check

  ##### Returns:

  has / has not
  Type
    boolean

#### css()

  Manipulate style properties Method accepts: 2 params, first is name of style, second is value; 'null' as param to remove all style properties; 'object' where keys ar style names and values are values

  ##### Returns:

  returns self for chaining
  Type
    object

  ##### Example

      css('opacity',1);
      css(null);
      css({opacity:1});

#### getStyles()

  Get all css classes

  ##### Returns:

  classes
  Type
    array.<string>

#### removeAllStyles()

  Remove all css classes from element

#### removeStyle(style)

  Remove css class from element

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `style` | string | array.<string> | class to remove

#### toggleStyle(style)

  Toggle css class. If elemet has class remove it , if not add it. If class is added return true else return false

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `style` | string | style to toggle

  ##### Returns:

  added / removed
  Type
    boolean

#### Search results