OOjsUI Object-Oriented JavaScript – User Interface

- Main Page
- Related Pages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | List of all members
OOUI\Theme Class Reference

Theme logic. More...

Inheritance diagram for OOUI\Theme:
[legend]

## Public Member Functions
| getElementClasses (Element $element)
| Get a list of classes to be applied to a widget. More...
| updateElementClasses (Element $element)
| Update CSS classes provided by the theme. More...

## Static Public Member Functions
static | setSingleton (Theme $theme=null)
static | singleton ()

## Detailed Description

Theme logic.

## Member Function Documentation

OOUI\Theme::getElementClasses | ( | Element | $element | ) |

Get a list of classes to be applied to a widget.

The 'on' and 'off' lists combined MUST contain keys for all classes the theme adds or removes, otherwise state transitions will not work properly.

Parameters

  Element | $element | Element for which to get classes

Returns
  array Categorized class names with `on` and `off` lists

static OOUI\Theme::setSingleton | ( | Theme | $theme = `null` | ) |
| static

Parameters

  Theme | null | $theme |

static OOUI\Theme::singleton | ( |  | ) |
| static

Returns
  Theme

Exceptions

  Exception |

OOUI\Theme::updateElementClasses | ( | Element | $element | ) |

Update CSS classes provided by the theme.

For elements with theme logic hooks, this should be called any time there's a state change.

Parameters

  Element | $element | Element for which to update classes

Returns
  array Categorized class names with `on` and `off` lists

The documentation for this class was generated from the following file:

- php/Theme.php