DEV Community

Discussion on: A Ridiculously Simple Way For Creating Responsive Web Apps

Collapse
forbidd3n profile image
Chris Tang

I'm agree for the title was a bit misleading, was thinking if there are something out of the box aside from media queries.
Perhaps you could look at the new way of CSS function instead.
Something like:

.container {
  width: clamp(400px, 75vw, 1140px);
}
Enter fullscreen mode Exit fullscreen mode

That will simply clamp the .container with desire width together with its minimum 400px and maximum 1140px values. And the best part here is you can get rid of media queries, of course this is just a simple example.

Reference: clamp() CSS function