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

Re: [csswg-drafts] [css-grid] I think the gutter math behind cell sizes is broken

From: Mats Palmgren via GitHub <sysbot+gh@w3.org>
Date: Tue, 04 Oct 2016 00:19:55 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-251263953-1475540394-sysbot+gh@w3.org>
I don't think this math corresponds to how Grid resolves <flex> sizes:
width: calc(100% * 1/12 - (30px - 30px / 6));
width: calc(100% * 7/12 - (30px - 30px / 6));

Grid calculates the <flex> sizes based on the content size subtracted
by the grid-gaps.  So it's more like:
width: calc((100% - 5*30px) * 1/12);
width: calc((100% - 5*30px) * 7/12);

But CSS doesn't understand that, so you have to do something like 
this:
width: calc(100% * 1/12 - 150px * 1/12);
width: calc(100% * 7/12 - 150px * 7/12);


-- 
GitHub Notification of comment by MatsPalmgren
Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/563#issuecomment-251263953 
using your GitHub account
Received on Tuesday, 4 October 2016 00:20:08 UTC

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