- From: 張俊芝 via GitHub <noreply@w3.org>
- Date: Fri, 09 Jan 2026 16:19:56 +0000
- To: public-css-archive@w3.org
Zhang-Junzhi has just created a new issue for https://github.com/w3c/csswg-drafts:
== Support Negative Indexing in env(viewport-segment-* x y) for Right/Bottom Referencing ==
The current `env(viewport-segment-* x y)` syntax only supports zero‑based left‑to‑right / top‑to‑bottom indexing. Referencing segments from the right or bottom is cumbersome and non‑semantic.
For example, to get the width of the rightmost viewport segment, authors must:
Query `horizontal-viewport-segments`.
Calculate the index as `horizontal-viewport-segments - 1`.
Write separate `@media` blocks for each possible segment count:
```
@media (horizontal-viewport-segments: 4) {
.item { width: env(viewport-segment-width 3 0); }
}
@media (horizontal-viewport-segments: 3) {
.item { width: env(viewport-segment-width 2 0); }
}
/* …and so on */
```
This forces enumeration instead of direct, logical referencing. It becomes unwieldy for responsive layouts that should adapt to any segment count without hard‑coded per‑count rules.
The lack of a straightforward way to address segments from the right or bottom limits the utility and readability of the feature. Consider extending the indexing mechanism to support more intuitive right‑to‑left and bottom‑to‑top references.
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13319 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 9 January 2026 16:19:57 UTC