Responsive Design with Progressive Enhancement
suggest changeModern browsers support media queries directly. No JavaScript media-query polyfill or conditional Internet Explorer stylesheet is needed.
Start with a layout suitable for limited space, then enhance it when more space is available:
.layout {
display: grid;
gap: 1rem;
}
@media (width >= 48rem) {
.layout {
grid-template-columns: minmax(0, 1fr) 18rem;
}
}
Choose breakpoints according to the content rather than named devices. Use media queries for viewport or user preferences, and container queries when a reusable component should respond to the space provided by its parent.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents