Service that makes an element apply theming related classes to itself.
| Parameter | Type | Description |
|---|---|---|
element
element
|
element |
to apply theming to |
$mdTheming.registered(themeName);
Determine is specified theme name is a valid, registered theme
| Parameter | Type | Description |
|---|---|---|
* themeName
string
|
string |
the theme to check if registered |
| Returns | Description |
|---|---|
boolean |
whether the theme is registered or not |
$mdTheming.defaultTheme();
Returns the default theme
| Returns | Description |
|---|---|
string |
The default theme |
$mdTheming.generateTheme(name);
Lazy generate themes - by default, every theme is generated when defined.
You can disable this in the configuration section using the
$mdThemingProvider.generateThemesOnDemand(true);
The theme name that is passed in must match the name of the theme that was defined as part of the configuration block.
| Parameter | Type | Description |
|---|---|---|
* name
string
|
string |
theme name to generate |
$mdTheming.setBrowserColor(options);
Sets browser header coloring for more info please visit: https://developers.google.com/web/fundamentals/design-and-ui/browser-customization/theme-color
The default color is 800 from primary palette of the default theme
options are:
theme - A defined theme via $mdThemeProvider to use the palettes from. Default is default theme.
palette - Can be any one of the basic material design palettes, extended defined palettes and 'primary',
'accent', 'background' and 'warn'. Default is primary
hue - The hue from the selected palette. Default is 800
| Parameter | Type | Description |
|---|---|---|
* options
Object
|
Object |
Options object for the browser color |
| Returns | Description |
|---|---|
Function |
remove function of the browser color |
$mdTheming.defineTheme(name, options);
Dynamically define a theme by an options object
options are:
primary - The primary palette of the theme.
accent - The accent palette of the theme.
warn - The warn palette of the theme.
background - The background palette of the theme.
dark - Indicates if it's a dark theme.
| Parameter | Type | Description |
|---|---|---|
* name
String
|
String |
Theme name to define |
* options
Object
|
Object |
Theme definition options |
| Returns | Description |
|---|---|
Promise<string> |
A resolved promise with the theme name |
$mdTheming.THEMES
Property to get all the themes defined
| Returns | Description |
|---|---|
Object |
All the themes defined with their properties |
$mdTheming.PALETTES
Property to get all the palettes defined
| Returns | Description |
|---|---|
Object |
All the palettes defined with their colors |