W3C home > Mailing lists > Public > www-style@w3.org > December 2014

Re: [css-logical-props] do shorthands have logical component longhands?

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 18 Dec 2014 16:46:18 -0800
Message-ID: <CAAWBYDAd8Y0=rGNboD919wmGT_p9XztcMOFVSA=j+Jp28XfrrQ@mail.gmail.com>
To: Cameron McCormack <cam@mcc.id.au>
Cc: www-style list <www-style@w3.org>
On Thu, Dec 18, 2014 at 4:27 PM, Cameron McCormack <cam@mcc.id.au> wrote:
> I'm working on making Gecko's logical properties behave as proposed in
> various mails to this list, where both physical and logical properties
> behave like normal properties in declarations but which are resolved at
> cascade time (after an initial computation of direction and writing-mode) to
> appropriate physical property values.
>
> One question I have is whether logical longhand properties are considered to
> be parts of the corresponding shorthand, for example is margin-inline-start
> a longhand component of margin?  I think the answer should probably be "no"
> as you don't know what values to set the logical properties to:
>
>   div { margin: 1px 2px 3px 4px; }
>
> What would be the values of margin-inline-{start,end} in the declaration?
>
> In terms of its effect on the layout of the document, it doesn't really
> matter, since margin-{left,right} would override any previous
> margin-inline-{start,end} properties in the declaration when we're resolving
> them during the cascade.  So from that perspective it makes sense to not set
> margin-inline-{start,end}.
>
> On the other hand, it could be like other shorthands where if you don't have
> values specified for some components then they get set to their initial
> values (e.g. like when you leave out some parts of the font shorthand).  So
> we could have them set to 0.
>
> Now, what if you want to clear the shorthand from script?
>
>   <style>
>   div { margin-inline-start: 1px; margin-inline-end: 2px; }
>   </style>
>   <script>
>     document.styleSheets[0].cssRules.style.margin = "";
>   </script>
>
> I almost would expect that to clear the margin-inline-{start,end}
> properties, but that's not possible if they're not longhand components of
> margin.

The current proposal in the spec is that you can insert the keyword
"logical" into the value, and then the shorthand is for the logical
properties instead, like "blockquote { margin: logical 1em 1em 1em 0;
}".

There's an issue in the spec about whether the physical/logical
versions of the shorthands also reset the logical/physical properties.

fantasai says they definitely should be reset by the shorthand.

~TJ
Received on Friday, 19 December 2014 00:47:08 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:49 UTC