Open brandonmcconnell opened 7 months ago
Should these not be {max-/min-}block-size
and {max-/min-}inline-size
respectively?
Should these not be
{max-/min-}block-size
and{max-/min-}inline-size
respectively?
@KennethHoff Perhaps!
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.