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

Commit e1bb097

Browse files
EladBezalelmmalerba
authored andcommitted
docs(theming): defineTheme documentation (#10476)
fixes #10458
1 parent 2cd5018 commit e1bb097

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/core/services/theming/theming.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,12 @@ function ThemingProvider($mdColorPalette, $$mdMetaProvider) {
532532
* restrict: 'e',
533533
* link: function(scope, el, attrs) {
534534
* $mdTheming(el);
535+
*
536+
* $mdTheming.defineTheme('myTheme', {
537+
* primary: 'blue',
538+
* accent: 'pink',
539+
* dark: true
540+
* })
535541
* }
536542
* };
537543
* });
@@ -605,6 +611,24 @@ function ThemingProvider($mdColorPalette, $$mdMetaProvider) {
605611
* @returns {Function} remove function of the browser color
606612
*/
607613

614+
/**
615+
* @ngdoc method
616+
* @name $mdTheming#defineTheme
617+
* @description
618+
* Dynamically define a theme by an options object
619+
*
620+
* options are:<br/>
621+
* `primary` - The primary palette of the theme.<br/>
622+
* `accent` - The accent palette of the theme.<br/>
623+
* `warn` - The warn palette of the theme.<br/>
624+
* `background` - The background palette of the theme.<br/>
625+
* `dark` - Indicates if it's a dark theme.<br/>
626+
*
627+
* @param {String} name Theme name to define
628+
* @param {Object} options Theme definition options
629+
* @returns {Promise<string>} A resolved promise with the theme name
630+
*/
631+
608632
/* @ngInject */
609633
function ThemingService($rootScope, $mdUtil, $q, $log) {
610634
// Allow us to be invoked via a linking function signature.

0 commit comments

Comments
 (0)