Responsive Elements is a proposal to extend the functionality of Media Queries to apply to Elements, allowing individual Elements to respond to local changes. Like existing Media Queries, these element media queries would consist of at least one expression that limits the scope of the selector; such as width, height, and aspect ratio.
[selector]:media([query]) { [declarations] }
.heading { font-size: 2em; }
.heading:media(max-width: 479px) {
font-size: 1em;
}
.calendar *:matches(.day, .panel) {
width: 100%;
}
.calendar:media(min-width: 360px) *:matches(.day, .panel) {
width: 50%;
}
Responsive Elements respond to local conditions, even when the document conditions do not change. For example, a widget can change its appearance when displayed in a narrow column or a wide column, even if in both scenarios the document width is the same.