Re: [csswg-drafts] [css-grid] Display any element as part of any given grid

> CSS never used selectors as values before

That's not an argument against it 😀

Having a selector as value looks unfamiliar, but that's not an issue.

>  it would be a new idiom for CSS parsers

Every CSS implementation supports CSS selectors.

By the way, the quotes probably aren't necessary:
```
grid-item-of: .the_grid;
```

> Also, selectors can change if DOM is modified dynamically, while grid names assigned through CSS property would be unaffected in the same case.

When naming a grid you're always binding it to an element, right? ... to which you point using a CSS selector 😉

>  if at some point in the future it becomes possible for the element to establish more than one grid (this idea is cropping up from time to time), then referencing the grid by name would be more unambiguous and flexible than referencing its originating element by selector.

If that will indeed get specd, then that is a good reason for naming.

Pointing to eg the grid named "grid_two" of an element could be done using something like this
```
grids-of(.the_grid_element)[grid_two]
/* grids-of(.selector)[name] */
```
... or using the (if I understood you correctly) global names you're suggesting.

My main wish is the functionality enabling us to display any element as grid item of any grid. I'll sure take it - no matter whether it requires me to declare names (even if there's just one grid for the grid parent); or whether it allows me to point at the respective grid parent using a selector without having to declare names when there's just one grid for that element.

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

Received on Wednesday, 16 May 2018 08:14:55 UTC