Currently we have media queries, but in most cases widgets have not the full width of the viewport.
media queries
One of the new CSS Houdini APIs:
How can we load JavaScript code into a website?