Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

docs(theming): defineTheme documentation #10476

Merged
merged 1 commit into from
Mar 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/core/services/theming/theming.js
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,12 @@ function ThemingProvider($mdColorPalette, $$mdMetaProvider) {
* restrict: 'e',
* link: function(scope, el, attrs) {
* $mdTheming(el);
*
* $mdTheming.defineTheme('myTheme', {
* primary: 'blue',
* accent: 'pink',
* dark: true
* })
* }
* };
* });
Expand Down Expand Up @@ -605,6 +611,24 @@ function ThemingProvider($mdColorPalette, $$mdMetaProvider) {
* @returns {Function} remove function of the browser color
*/

/**
* @ngdoc method
* @name $mdTheming#defineTheme
* @description
* Dynamically define a theme by an options object
*
* options are:<br/>
* `primary` - The primary palette of the theme.<br/>
* `accent` - The accent palette of the theme.<br/>
* `warn` - The warn palette of the theme.<br/>
* `background` - The background palette of the theme.<br/>
* `dark` - Indicates if it's a dark theme.<br/>
*
* @param {String} name Theme name to define
* @param {Object} options Theme definition options
* @returns {Promise<string>} A resolved promise with the theme name
*/

/* @ngInject */
function ThemingService($rootScope, $mdUtil, $q, $log) {
// Allow us to be invoked via a linking function signature.
Expand Down