W3C home > Mailing lists > Public > public-css-archive@w3.org > May 2017

Re: [csswg-drafts] [css-cascade] non-destructive shorthands

From: François REMY via GitHub <sysbot+gh@w3.org>
Date: Tue, 30 May 2017 05:28:12 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-304778299-1496122091-sysbot+gh@w3.org>
As far as I can remember, this is indeed a syntax we had discussed at some point, though as a way to create shorthands for custom properties. 

--custom-layout: {
   sizing: basic-mode,
   placement: auto;
that would be equivalent of something like
--custom-layout\\sizing: basic-mode;
--custom-layout\\placement: auto;
but would also reset to initial a property like ```--custom-layout\\direction``` if one was defined on the element.

I wonder though, if the goal here is not to reset all the sub-properties, why not using a property like ```margin-inline``` directly if that is the specific property you want to set and not the entire margin? ```margin-inline: ....``` seems shorter to write than ```margin: { inline: ... }```.

Though, of course, we don't have a ```margin-inline``` property as far as I know. That seems like a different problem though, isn't it? I guess if that is something you find valuable, you can create one by doing:

* { --margin-inline: 0; --margin-block: 0; margin: var(--margin-block) var(margin-inline); }

Then you can set ```--margin-inline``` anywhere if that is what you want, and if you want to really set the entire margin, then you can use ```margin```. Does that make sense?

GitHub Notification of comment by FremyCompany
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1461#issuecomment-304778299 using your GitHub account
Received on Tuesday, 30 May 2017 05:28:19 UTC

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