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

Re: [csswg-drafts] [css-logical] Flow-relative syntax for `margin`-like shorthands (#1282)

From: Mike Bremford via GitHub <sysbot+gh@w3.org>
Date: Tue, 09 Jun 2020 22:19:52 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-641611673-1591741191-sysbot+gh@w3.org>
Funny, I hadn't seen this thread until its resurrection. I've recently been dealing with the equivalent properties in PDF, which are *always* ordered in logical order - and personally, I hate it. Mainly for the reason that @Loirooriol raises two posts above - the meaning of the property value now cannot be determined without going up through the hierarchy to check the writing-mode of the ancestors. It makes it harder to visually inspect CSS to know what it means, it makes it harder to move nodes around in the tree, and it makes it harder to import styles from external sources.

This last point matters; if we were doing something like this 20 years ago it would be different. But I think it's fair to say there's an established body of CSS out there that uses the `margin` shorthand. If the way that property is parsed can now be changed by altering an ancestor, I predict that for someone, somewhere, it will cause an awful lot of pain.

For that reason, I agree 100% with @Loirooriol's points above, and personally would lean towards @fantasai's original proposal of using a magic ident: `margin: logical 1px 2px 3px 4px` or similar. If you have to do this every time you want to specify margins, paddings or borders in logical order, it's a bit more verbose. That sucks, but only a little. However on the plus side, it's completely bulletproof against unintended side-effects.

-- 
GitHub Notification of comment by faceless2
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1282#issuecomment-641611673 using your GitHub account
Received on Tuesday, 9 June 2020 22:19:53 UTC

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