Код: Выделить всё
customElements.define( "my-component",
class extends HTMLElement {
constructor() {
super();
this.attachShadow({mode:'open'});
this.shadowRoot.append(document.getElementById('my-component-template')
.content
.cloneNode(true));
}
}
);< /code>
:host {
display: inline-block;
box-sizing: border-box;
border: 1px solid black;
min-width: 64px;
min-height: 64px;
/* height: 0; */
}
.container {
display: grid;
grid-template-columns: 1fr;
grid-template-rows: 1fr 10%;
width: 100%;
height: 100%;
.element1, .element2 {
width: 100%;
height: 100%;
}
.element1 { background-color: cyan; }
.element2 { background-color: black; }
}
Что может быть неотъемлемой причиной для этого?
Подробнее здесь: https://stackoverflow.com/questions/796 ... lready-set
Мобильная версия