W3C home > Mailing lists > Public > public-css-archive@w3.org > September 2016

Re: [csswg-drafts] [css-grid] making percentage grid-gaps zero for the purpose of intrinsic sizing doesn't make sense

From: Mats Palmgren via GitHub <sysbot+gh@w3.org>
Date: Wed, 14 Sep 2016 14:01:06 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-247022298-1473861664-sysbot+gh@w3.org>
Reply to @mrego:
I think you misunderstand how percentages contributes to intrinsic
sizing.  If you have:

```
  grid: 100px 100px / 200px 200px;
  grid-gap: 10%;

```
then the intrinsic size is ~444.44px.
The grid-gap can't be 40px (10% of 200+200) because that would make
the size 440px and 10% of 440px is 44px, not 40px.
The way to calculate it is as I described above:
size = sum_of_coords / (1.0 - sum_of_percentages)

(i.e. 400 / (1.0 - 0.1) for the example above)


-- 
GitHub Notification of comment by MatsPalmgren
Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/472#issuecomment-247022298 
using your GitHub account
Received on Wednesday, 14 September 2016 14:01:17 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:03 UTC