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

> I considered a component case where class names are dynamically generated by the component code, so I wouldn't know them in advance (but would have some control over the CSS inside the components). In this case, the selector-based approach would be too limiting for me.

In your code examples you're using selectors when applying the name(s), thus there is no difference regarding the aspects you list. In both cases you'd point at the grid element using a selector (in your examples you point at the grid element using a selector, where you name it). And when a future feature requires naming it can (and should) require naming.

> then naming the exact grid becomes necessary

(Sorry for the repetition:) When a future feature requires naming it can (and should) require naming.

> Maybe ideally we could have both options at some point? :)

Yes, I also had considered this. Allow `grid-item-of: selector(.the-grid)`, and also offer `grid-name: the-grid` & `grid-item-of: the-grid` so that naming can be used where necessary. But think it's more important to get the fundamental functionality of the feature, and to get it specd and implemented in the sooner-than-later future. This requires that the feature wish stays lean. So I'd suggest to have either selectors or naming for pointing to the respective grid, not both. I could live with either option.

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

Received on Thursday, 17 May 2018 10:25:02 UTC