Re: [csswg-drafts] [css-grid-3] Renaming `masonry` keyword (#9733)

When it comes to API design I like to remember the rule "make invalid states unprepresentable". With this rule in mind, applying masonry layout vertically/horizontally via `grid-template-rows: off` or `grid-template-columns: off` creates the possibility of an invalid state:

```css
.invalid-masonry {
  display: grid;
  grid-template-rows: off;
  grid-template-columns: off;
}
/* invalid but still possible */
```

Therefore I’d argue for using a different display value like `display: waterfall`, which could then have a `flow-direction` of `inline`, `block` etc. Turning one axis off in grid layout creates an invalid case and also disables the main idea of grid layouts in my view. I’d love to see more ideas that go into the direction of avoiding invalid CSS, so that we cannot shoot ourselves in the foot this easily. Another upside of `flow-direction` is that one might toggle the waterfall direction via a single CSS variable. `flow-direction: var(--direction);`

-- 
GitHub Notification of comment by maxhoffmann
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9733#issuecomment-2087240705 using your GitHub account


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

Received on Tuesday, 30 April 2024 20:50:42 UTC