From 126f4fd67602f48212eff182e271f5775bc09bbd Mon Sep 17 00:00:00 2001 From: Michael Prentice Date: Sun, 10 Apr 2016 23:15:31 -0400 Subject: [PATCH] update(docs): improve docs for extending an existing theme Changing the default text color (black/white) on buttons is a common question that keeps coming up. Hopefully this will help people better understand how to do that. --- docs/content/Theming/03_configuring_a_theme.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/content/Theming/03_configuring_a_theme.md b/docs/content/Theming/03_configuring_a_theme.md index 9d400d7bcf5..f4a114b6597 100644 --- a/docs/content/Theming/03_configuring_a_theme.md +++ b/docs/content/Theming/03_configuring_a_theme.md @@ -110,17 +110,21 @@ angular.module('myApp', ['ngMaterial']) }); -Sometimes it is easier to extend an existing color palette to overwrite a few -colors than define a whole new one. You can use `$mdThemingProvider.extendPalette` +### Extending Existing Palettes + +Sometimes it is easier to extend an existing color palette to change a few properties +than to define a whole new palette. You can use `$mdThemingProvider.extendPalette` to quickly extend an existing color palette. angular.module('myApp', ['ngMaterial']) .config(function($mdThemingProvider) { - // Extend the red theme with a few different colors + // Extend the red theme with a different color and make the contrast color black instead of white. + // For example: raised button text will be black instead of white. var neonRedMap = $mdThemingProvider.extendPalette('red', { - '500': 'ff0000' + '500': '#ff0000', + 'contrastDefaultColor': 'dark' }); // Register the new color palette map with the name `neonRed` @@ -128,7 +132,7 @@ angular.module('myApp', ['ngMaterial']) // Use that theme for the primary intentions $mdThemingProvider.theme('default') - .primaryPalette('neonRed') + .primaryPalette('neonRed'); });