Make gr-modal-styles backward compatible with Polymer
The gr-modal-styles module could only be used by Lit Elements, but
not by old Polymer-based DOM modules. Since Polymer support has not
yet fully been removed, this change adds compatibility again.
Release-Notes: skip
Change-Id: I073c2768538454e41aee8e976f135921361fe772
diff --git a/polygerrit-ui/app/styles/gr-modal-styles.ts b/polygerrit-ui/app/styles/gr-modal-styles.ts
index b1bcf51..a8b5dc4 100644
--- a/polygerrit-ui/app/styles/gr-modal-styles.ts
+++ b/polygerrit-ui/app/styles/gr-modal-styles.ts
@@ -28,3 +28,13 @@
opacity: var(--modal-opacity, 0.6);
}
`;
+
+const $_documentContainer = document.createElement('template');
+$_documentContainer.innerHTML = `<dom-module id="gr-modal-styles">
+ <template>
+ <style>
+ ${modalStyles.cssText}
+ </style>
+ </template>
+</dom-module>`;
+document.head.appendChild($_documentContainer.content);