static get styles() {
const width = window.innerWidth
const height = window.innerHeight
return css`
:host{
display: block;
}
.my-img{
max-width: ${width}px;
max-height: ${height}px;
}
`
}
I wrote this CSS in a web component, it works.
However, when the browser window resizes, the CSS can not change automatically.
How can I enforce it to re-calculate after window resize?