Re: [csswg-drafts] [css-grid-2] subgrid and grid-gap

It's not that difficult to comprehend. 

The gap would always base itself on where the centre of the grid line is and work outwards from there.

300px wide outer grid.
Outer grid gap: 50px 
grid-template-columns: 100px 1fr;
Subgrid gap: 0;

1fr = 300 - 100 - 50 = 150px
Subgrid left cell = 100px + (50/2) = 125px
subgrid right cell = 300 - 100 - (50/2) = 175px

Same thing but this time with a subgrid gap of 20
Subgrid left cell = 100px + (50/2) - 20 = 105px
subgrid right cell = 300 - 100 - (50/2) - 20 = 155px

Did that clear things up at all?

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

Received on Thursday, 8 February 2018 13:24:26 UTC