[csswg-drafts] [mediaqueries-5] Logical Media Queries (#10156)

brandonmcconnell has just created a new issue for https://github.com/w3c/csswg-drafts:

== [mediaqueries-5] Logical Media Queries ==
### 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

<table>
  <tr>
    <th></th>
    <th>block</th>
    <th>inline</th>
  </tr>
  <tr>
    <th>range</th>
    <td><code>(min-block: &lt;size&gt;)</code><br><code>(max-block: &lt;size&gt;)</code></td>
    <td><code>(min-inline: &lt;size&gt;)</code><br><code>(max-inline: &lt;size&gt;)</code></td>
  </tr>
  <tr>
    <th>operator</th>
    <td><code>(block &gt; &lt;size&gt;)</code><br><code>(block &gt;= &lt;size&gt;)</code><br><code>(block &lt; &lt;size&gt;)</code><br><code>(block &lt;= &lt;size&gt;)</code></td>
    <td><code>(inline &gt; &lt;size&gt;)</code><br><code>(inline &gt;= &lt;size&gt;)</code><br><code>(inline &lt; &lt;size&gt;)</code><br><code>(inline &lt;= &lt;size&gt;)</code></td>
  </tr>
</table>

### Use Cases
- 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.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10156 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 28 March 2024 20:20:05 UTC