W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2021

Re: [csswg-drafts] [css-box-4] Padding/Margin horizontal and vertical shorthands (#6507)

From: Masataka Yakura via GitHub <sysbot+gh@w3.org>
Date: Tue, 10 Aug 2021 18:49:57 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-896231584-1628621396-sysbot+gh@w3.org>
Hi. The good news is there are already such shorhands available. They are called `margin/padding-block` and `margin/padding-inline`, and are defined in the [CSS Logical Properties module](https://drafts.csswg.org/css-logical/).

* [margin-block | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin-block)
* [margin-inline | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin-inline)
* [padding-block | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/padding-block)
* [padding-inline | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/padding-inline)

Technically they are not horizontal or vertical, but in many cases you can use `margin/padding-inline` as horizontal and `margin/padding-block` as vertical shorthands. I know the names and their behaviors are bit complicated, but they are already available on browsers so you can use them today.

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

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 10 August 2021 18:49:59 UTC

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