Looks like that mdi is not working inside web components, or do I miss something?
I want to develop a web component that encapsulates it's dependencies, adding the link to the parent document works, but it violates the original intent.
<html>
<body>
<x-webcomponent></x-webcomponent>
<script>
customElements.define(
"x-webcomponent",
class extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: "open" });
this.shadowRoot.innerHTML = `
<style>@import url('https://cdn.materialdesignicons.com/4.9.95/css/materialdesignicons.min.css');</style>
<span class="mdi mdi-home"></span>
`;
}
}
);
</script>
</body>
</html>
@import
is not working and I guess because it refers other resources also... – Embark<link>
in outer doc helps, but I don't feel it an elegant solution. – Embark