You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This proposal introduces new media queries that are based on the logical inline and block dimensions of the viewport, rather than width and height. This aligns with the growing support for logical styles in modern web development.
Motivation
Current CSS media queries are based on the width and height of the viewport, which can be problematic when dealing with layouts that are not constrained to a single axis (e.g. responsive designs, rotated screens, internationalization, etc.). This proposal aims to provide a more flexible and logical way to target styles based on the inline and block dimensions of the viewport.
Targeting styles based on the logical dimensions of the viewport, rather than the static w/h viewport dimensions
Creating layout-agnostic styles that work well in both landscape and portrait orientations
Designing responsive components that can adapt to changes in the viewport's logical dimensions, especially useful in the case of internationalization
Conclusion
This proposal aims to introduce a more logical and flexible approach to media queries in CSS, aligning with the growing trend towards layout-agnostic web design. By focusing on the inline and block dimensions of the viewport, rather than the physical width and height, developers can create more robust and adaptable styles for a wide range of device and layout scenarios.
The text was updated successfully, but these errors were encountered:
The difficulty here is, how do you know what the writing mode of the viewport is? It depends on the contents, which can change depending on the media query.
Abstract
This proposal introduces new media queries that are based on the logical inline and block dimensions of the viewport, rather than width and height. This aligns with the growing support for logical styles in modern web development.
Motivation
Current CSS media queries are based on the width and height of the viewport, which can be problematic when dealing with layouts that are not constrained to a single axis (e.g. responsive designs, rotated screens, internationalization, etc.). This proposal aims to provide a more flexible and logical way to target styles based on the inline and block dimensions of the viewport.
Proposed Media Queries
(min-block: <size>)
(max-block: <size>)
(min-inline: <size>)
(max-inline: <size>)
(block > <size>)
(block >= <size>)
(block < <size>)
(block <= <size>)
(inline > <size>)
(inline >= <size>)
(inline < <size>)
(inline <= <size>)
Use Cases
Conclusion
This proposal aims to introduce a more logical and flexible approach to media queries in CSS, aligning with the growing trend towards layout-agnostic web design. By focusing on the inline and block dimensions of the viewport, rather than the physical width and height, developers can create more robust and adaptable styles for a wide range of device and layout scenarios.
The text was updated successfully, but these errors were encountered: