W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2020

Re: [csswg-drafts] [css-box] Explicit control over margin collapsing (#1324)

From: Eliot Slevin via GitHub <sysbot+gh@w3.org>
Date: Thu, 26 Nov 2020 23:54:05 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-734510280-1606434843-sysbot+gh@w3.org>
The inconsistent handling of margin collapsing adds another level of complexity to the majority of projects. Elements such as headers, paragraphs, subheaders - their spacing should ideally be consistent no matter how they're laid out. 

I agree we don't want collapsing margins in grid or flex. It's just a strange result. 

What I would _love_ to be able to do is disable margin collapsing in the normal css box model - so spacing is consistent no matter the layout method. 

There's lots of workarounds for this, overflows, :after's, clearfixes, just not using box model full stop, not using margins and only using padding - but they're all sketchy hacks with trade offs. 

If I could start every project with:

    box-sizing: border-box;
    margin-collapse: seperate;

I'd be stoked. 

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

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 26 November 2020 23:54:07 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:22 UTC