Open jyasskin opened 9 years ago
It looks like I can work around the problem by putting the <style>
element inside the <paper-dialog>
. Then it gets moved into the <overlay-host>
shadow dom, where it becomes scoped and can apply to the <paper-dialog>
's contents. Maybe this just needs documentation.
+1 having exactly the same issue and using same workaround.
That is an unfortunate restriction of layered
mode which is the default for paper-dialog
to ensure it appears on top of everything else. I'll add more documentation.
I just ran into this myself and it's counter intuitive to put elements inside of
This one is giving me grief as well.
I worked-around by adding a class to my paper-action-dialog and importing a page-level stylesheet that uses html /deep/ .mySpecificClass { }
.
Any specific elements used within the dialog need to be styled in a similar fashion.
ie: html /deep/ .mySpecificClass > .title { color: blue };
This feels wrong since the page-level stylesheet needs to know the details of my dialog's implementation. I would simply use a non-layered dialog, but I encountered This Issue.
I tried to write a custom element containing a
<paper-dialog>
and a<style>
section to style the contents of the dialog:By moving the whole
<paper-dialog>
element into the shadow of an<overlay-host>
, without pulling along the associated<style>
block, you lose any styles I wanted for the content of the dialog. To work around this, I'd have to give each<paper-dialog>
a globally-unique ID, which kind of defeats the purpose of web components.