Re: [css-grid] Punt subgrids to level 2?

On 04/22/2014 11:39 PM, L. David Baron wrote:
> On Friday 2014-02-28 12:45 -0800, fantasai wrote:
>> On 02/03/2014 06:20 PM, Tab Atkins Jr. wrote:
>>>
>>> I know it's currently at-risk, but I don't feel like that section of
>>> the spec will be CR-ready before Chrome and IE are ready to ship
>>> implementations of the rest of the spec publicly.  We should go ahead
>>> and punt it now, rather than pretending that it'll stay through to CR
>>> or delaying the CR of the spec due to this.
>>
>> That would be equivalent to shipping Regions with only element-based
>> region containers. The reason many people in the WG are against that
>> is because it encourages bad markup design. Shipping grid without
>> subgrid also encourages bad markup design. Worse, in fact, because it
>> requires *stripping* markup that otherwise would be there, not just
>> adding in a few extraneous empty elements.
>
> Does 'display-box: contents' [1] help at all to alleviate this
> concern?  In other words, could authors use 'display-box: contents'
> to avoid having to eliminate markup in the same way that subgrids
> allow them to avoid eliminating markup?  (If so, how would using
> display-box: contents compare to using subgrids?)

It does help: *if* it is implemented reliably at the same time as
grid, it eliminates the need to eliminate any structural grouping
elements (and thus my primary objection to deferring subgrid).

It doesn't replace subgrids because subgrid provides
   1. localized addressing for grid positions [1]
   2. the ability to render the wrapper
       a. as a border or background visually grouping its contents
       b. as a grouping container for other effects like transforms
          e.g. creating a "popping out" effect on hover

Wrt 1, see the second example in
   http://fantasai.inkedblade.net/style/discuss/subgrid-markup/
   You could use subgrids with local addressing to easily pull
   up the images over their headings within each section box
   while also using auto-flow (or any other positioning pattern)
   to organize the boxes overall. Without it, each sub-item has
   to be positioned explicitly in the master grid: 'display:
   contents' can't replace that functionality.

~fantasai

Received on Wednesday, 23 April 2014 08:28:45 UTC