PolymerElements / paper-dialog

A Material Design dialog
https://www.webcomponents.org/element/PolymerElements/paper-dialog
63 stars 41 forks source link

Styles not applied to paper-dialog slotted elements. #157

Open anandanand84 opened 6 years ago

anandanand84 commented 6 years ago

Styles are not applied in to the paper-dialog slotted elements h2, buttons ... as shown in below image. I see in the paper-dialog-shared-styles the styles are applied for ::content and not for ::slotted, but the demo works fine.

screen shot 2017-11-14 at 10 14 09 pm screen shot 2017-11-14 at 10 19 50 pm
phidias51 commented 6 years ago

All of my dialogs are now broken. The slotted content doesn't appear at all when surrounded by a paper-dialog-scrollable element. The default dialog styling doesn't work, causing the dialog to appear as a transparent overlay on top of the page. This really needs to be fixed.

valdrinkoshi commented 6 years ago

are you loading paper-dialog-behavior 2.x? it has the correct styles for slotted elements https://github.com/PolymerElements/paper-dialog-behavior/blob/master/paper-dialog-shared-styles.html

Also, please beware of the changes in paper-dialog 2.0 https://github.com/PolymerElements/paper-dialog#changes-in-20

paper-dialog-behavior 2.0 styles only direct h2 and .buttons children of the dialog because of how ::slotted works (compound selector will select only top level nodes)

phidias51 commented 6 years ago

@valdrinkoshi Yes. I'm loading the paper-dialog-shared-styles, although strictly speaking, I shouldn't have to. Either way, it makes no difference. The dialog still appears transparently on top of my page.

anandanand84 commented 6 years ago

@phidias51 Actually I dont get this problem anymore. If I correctly remember the problem for me was I had some old dependencies being loaded which loaded old paper dialog. Make sure every dependency in your bower_components is 2.0 or 1-2. Fix anything 1.0 the issue should be fixed.

phidias51 commented 6 years ago

@anandanand84 I'm currently using paper-dialog v 2.1.1 so I should be good.

anandanand84 commented 6 years ago

@phidias51 It is not because of paper-dialog, it may sound weird but go through all your polymer elemnets in bower_components directory or see your resolution in bower.json something is 1.0 which make it behave different