Re: [csswg-drafts] [css-grid] Property "grid-item-of": display any element as part of any given grid

> With named grid, I don't have to bother about the DOM relations between the place where the Grid is defined and the element I want to place onto it at all.

When you'd use `grid-item-of: .selector_for_the_grid`, ! don't think you'd have to "bother about the DOM relations between the place where the Grid is defined and the element". You'd simply point to the grid parent using any selector you want.

> The proposed approach opens the possibility to completely decouple the visual structure from the DOM structure, and relying to DOM relations (in form of selectors) seems to be kind of step back to me.

At some point you'd have to point to the element to which you want to apply the grid / the name. You'd do that using selectors. So we could (as long as there can only be one grid per element) use selectors directly - without requiring names.

If names are generally better then we should replace selectors with naming in CSS in all places - but that would require a lot of declaring of names. So I'm happy with using selectors.

> That said, I support your proposal in general and hope that it makes it to the implementation.

Great to hear! (I'd like to repeat that @meyerweb had created an example before I submitted this ticket. I didn't know about it when I submitted the ticket - in any case: credit where credit is due.)

> If implementers find the selector-based approach easier, I would be completely fine with it! :)

I think that `grid-item-of: .selector_for_the_grid` would work out nicely (selectors are a complete and supported way of pointing to an element eg the grid parent), and that naming is not required (when one of the features that require naming gets specd then it can feature naming), and that supporting selectors as values is not very hard (selectors are implemented already, just the delimiter is `;` instead of `{` ), and that naming always (at some point) gets applied via selectors so we can just as well use selectors, and that the CSS user should not be required to write a line that's not necessary (the line which declares the name).

But I have a hunch that I'm completely outnumbered 😀so I'll (obviously and in any case) let the CSS WG decide.

One main item we seem to agree on is that there could be a new property, and that it could be named `grid-item-of`- that's fundamentally positive and promising 😀

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

Received on Wednesday, 16 May 2018 16:12:14 UTC