[csswg-drafts] [css-grid-2] conditional subgrid fallback when no parent grid is available (#6692)

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

== [css-grid-2] conditional subgrid fallback when no parent grid is available ==
Reference: https://drafts.csswg.org/css-grid-2/#subgrids

# Issue:
When `subgrid` is used on a container whose parent does not have a grid declared, there is no way to provide alternate grid lines as a fallback. Using the cascade as in the example below does not work because even without the parent grid, the `subgrid` declaration is still valid.

```css
.subgrid {
  grid-template-columns: repeat(4, 1fr); /* fallback does not work*/
  grid-template-columns: subgrid;
}
```

# Expected behavior
Provide grid line fallbacks for `subgrid` when a parent grid is not present. 
Example: 

```css
grid-template-columns: subgrid, repeat(4, 1fr);
```

# Scenario
A component uses the parent grid if it is present through conditional `subgrid`. If the parent has a grid, the subgrid applies, otherwise the component uses its own grid lines.

# Sandbox
I've built a rudimentary example to demonstrate the above scenario:
https://codepen.io/mor10/pen/ZEyVpZb



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


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

Received on Tuesday, 28 September 2021 00:30:31 UTC