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

Theming is not inherited by dialogs #1399

Closed
hkgrani opened this issue Feb 5, 2015 · 7 comments
Closed

Theming is not inherited by dialogs #1399

hkgrani opened this issue Feb 5, 2015 · 7 comments

Comments

@hkgrani
Copy link

hkgrani commented Feb 5, 2015

Have a look at the plunk : http://plnkr.co/edit/VRvi9JCq7I81QvtTTP94?p=preview

Dialogs will use "default" theme

For custom dialogs you can set theming but it would be nice if it could be inherited by the theme "state" from where the dialog was invoked

@ThomasBurleson
Copy link
Contributor

That sounds like an intuitive UX.

@ThomasBurleson
Copy link
Contributor

@rschmukler - has this been fixed already?

@rschmukler
Copy link
Contributor

@hkgrani the theme is inherited from the parent container that you put the element in. ie. if you specify a parent, the dialog will have the same theme as the parent. I'm not sure if I think that inheriting from the invoking button / event is that intuitive, in that, just because a button has a different theme doesn't mean that a dialog that it spawns should have a context different than the application wide context (default).

I think I'd rather force an explicit configuration than infer something that I'm not sure most developers would expect to happen. I'm open to hearing thoughts to the contrary, if I am the only one that that wouldn't be intuitive to.

@hkgrani
Copy link
Author

hkgrani commented Feb 17, 2015

@rschmukler my understanding is that for dialogs you do not currently inherit the theme from the parent container. I think the reason for that is that the dialog (.md-dialog-container) are put as a direct child to the body tag and not as a child to the element where it was invoked.
My simple plunker example is not a good example of a real use case for this so I will try to describe a better example.

Google documents, Inbox for gmail and Google play store are all examples of complex apps that use colors/theming to help the user understand what part of the application they are in. Building something like this in anguar material you could specify a different theme per main route (green for apps, red for films, blue for books etc). In this scenario (I think) dialog would be the only component that would break the "theme inheritance chain". Themes for custom dialogs could be set "manually" or dynamically if templates are shared across routes. For simple dialogs I see no way to set theme though

Looking at the documentation one more time I see that there is an option to set the parent element. Setting that to something other than document.body may help for theming but I am afraid that would break the backdrop or something similar

Anyways, its not a big problem and I may have misunderstood or are using the components wrongly. If no one else see a use for a "inherit theming" option I am fine with that.

@rschmukler rschmukler self-assigned this Feb 23, 2015
@seiyria
Copy link

seiyria commented Feb 27, 2015

Not sure if it merits a separate issue or not, but theming also is not inherited by mdSelect.

@nkoterba
Copy link

nkoterba commented Aug 4, 2015

So we've just "upgraded" from MD 0.8.3 to 0.10.

In 0.8.3, md-dialog had the md-default-theme class applied to it, e.g.: md-dialog.md-default-theme, in what I believe was the CSS styles injected into the <head> by material design.

This created a dialog in our app of:
image

In the inspector:
image

In 0.10.0, md-dialog.md-default-theme no longer seems to be applied, creating a dialog of:
image

In the inspector:
image

with the exact same code base (aside from updates to Angular and Material Design libs).

I guess my question is if md-default-theme will no longer by default be applied to md-dialog how exactly can we set a theme on md-dialog?

@ThomasBurleson ThomasBurleson modified the milestones: post-1.0 , Backlog Sep 4, 2015
@ThomasBurleson ThomasBurleson modified the milestones: post-1.0 , Backlog Jan 5, 2016
@devversion
Copy link
Member

Can anyone confirm that this is related to #5899?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants