Material: Multiple theme changing not working

Created on 13 Mar 2015  路  2Comments  路  Source: angular/material

I forked the 'Muppet' demo and added a selector to change theme's - but while the md-theme is being updated after you make a selection - the class is remaining the same md-default-theme.

I'm using ... ng-theme="{{theme}}" md-theme-watch> and $mdThemingProvider.alwaysWatchTheme(true);

http://codepen.io/Xeoncross/pen/ByqObP?editors=101

theme

Most helpful comment

Hey, just come across this, updated plunkr: http://codepen.io/SimeonC/pen/vONeON. (We also have this issue on the 0.9.0-rc3 version).

As you can see that the md-theme works on the element it's created on, but it does not cascade to all child elements that already exist - the old md-xxxx-theme classes are not replaced. This kinda defeats the purpose of theming.

EDIT: Of specific note is the md-list to the left that doesn't change, in 0.9.0 we get don't even get the md-toolbar changing the theme.

EDIT: A second edit, I've found that md-theme-watch is not functioning the same as $mdThemingProvider.alwaysWatchTheme(true);. The latter works where as the former doesn't. http://codepen.io/SimeonC/pen/pJyjdY

All 2 comments

You want to use md-theme, instead of ng-theme.

Hey, just come across this, updated plunkr: http://codepen.io/SimeonC/pen/vONeON. (We also have this issue on the 0.9.0-rc3 version).

As you can see that the md-theme works on the element it's created on, but it does not cascade to all child elements that already exist - the old md-xxxx-theme classes are not replaced. This kinda defeats the purpose of theming.

EDIT: Of specific note is the md-list to the left that doesn't change, in 0.9.0 we get don't even get the md-toolbar changing the theme.

EDIT: A second edit, I've found that md-theme-watch is not functioning the same as $mdThemingProvider.alwaysWatchTheme(true);. The latter works where as the former doesn't. http://codepen.io/SimeonC/pen/pJyjdY

Was this page helpful?
0 / 5 - 0 ratings