BaseElement
This is the theme plugin. It provides a theming system that allows for consistent styling across elementswith support for inheritance, named styles, and dynamic theme switching.
Functions
| Method | Returns | Description |
|---|---|---|
| BaseElement:applyTheme | BaseElement | Applies theme styles to the element |
| BaseElement:getTheme | table | Gets theme properties for the element |
BaseElement:applyTheme(self, applyToChildren)
Applies the current theme to this element
Parameters
selfBaseElementThe element to apply theme toapplyToChildrenboolean? Whether to apply theme to child elements (default: true)
Returns
BaseElementselfThe element instance
BaseElement:getTheme(self)
Gets the theme properties for this element
Parameters
selfBaseElementThe element to get theme for
Returns
tablestylesThe theme properties
ThemeAPI
The Theme API provides methods for managing themes globally
Functions
| Method | Returns | Description |
|---|---|---|
| ThemeAPI.setTheme | - | Sets a new theme |
| ThemeAPI.getTheme | table | Gets the current theme |
| ThemeAPI.loadTheme | - | Loads theme from JSON file |
ThemeAPI.setTheme(newTheme)
Sets the current theme
Parameters
newThemetableThe theme configuration to set
ThemeAPI.getTheme()
Gets the current theme configuration
Returns
tablethemeThe current theme configuration
ThemeAPI.loadTheme(path)
Loads a theme from a JSON file
Parameters
pathstringPath to the theme JSON file