'How do I trigger a media query manually?

I'm trying to create a component demo container where a user can drag a slider to change the width of the container to see the responsive component changing. Please see the first component here. The components have media queries and not container styling.

Example

How can I make the size of the container force the component to adjust as if it's the actual screen size?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source