Re: [csswg-drafts] [css-grid] grid-template-width and grid-template-height (#9182)

> The problem with grid-template-width being different than the sum of the columns is that then it's not clear if e.g. justify-content: center will align the grid-template-width within the element, or the columns within the grid-template-width.

This is not a problem because `grid-template-width` is not an element that can be aligned. It's just a property to indicate how much fr/flex items should grow.

For example:

```css
.item {
  display: grid;
  grid-template-columns: 300px;
  justify-content: center;
}
```

is exactly like:

```css
.item {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-width: 300px;
  justify-content: center;
}
```

In both cases, `justify-content` has the same behavior, because `grid-template-width` doesn't change the Node tree inserting new elements. It just affects to the final widths of `fr` columns in the grid template.

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


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

Received on Monday, 25 March 2024 11:26:53 UTC