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: Una Kravets via GitHub <sysbot+gh@w3.org>
Date: Tue, 09 Jun 2020 19:56:24 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-641536604-1591732583-sysbot+gh@w3.org>
@Loirooriol yes, I would expect if at any point, logical flow was added to the parent, the margins would become logical. This would also make it easier to port over codebases that set styles in JS to logical properties.

Order wouldn't matter here in terms of *when* the properties are adjusted -- the browser would parse the margins differently based on `flow-mode`. `flow-mode` will inherit to the parent, unless it is reset on the given element, so it's possible to have logical flow in a parent and physical flow in a child.

For the expansion example, the expanded sequence will always be rendered in the same `flow-mode` as any other margin set on the element, so it shouldn't collide. This is true for physical margin properties (top, left, bottom, right)

In the case that `flow-mode` is set to `physical`, and a logical value is set (margin-inline-start, margin-block-start, etc.), will be converted to their physical counterparts of margin-left, margin-top, etc.

When no `flow-mode` is set on any element up the tree, the default values for `margin-top` vs. `margin-block-start` apply.

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

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:27 UTC