W3C home > Mailing lists > Public > www-svg@w3.org > November 2013

Re: 'stroke' shorthand

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 13 Nov 2013 13:50:38 -0800
Message-ID: <CAAWBYDB29_Kpn7Eoeqtp+33AaOFE+Ax5iXQ8EsmR+zZNNe6xGw@mail.gmail.com>
To: "Dr. Olaf Hoffmann" <Dr.O.Hoffmann@gmx.de>
Cc: www-svg <www-svg@w3.org>
On Wed, Nov 13, 2013 at 1:58 AM, Dr. Olaf Hoffmann <Dr.O.Hoffmann@gmx.de> wrote:
> Dirk Schulze:
> ...
>>That also means that in the following example, the shorthand property resets
>>all previously set properties according to the regulations of the CSS WG:
>
>>stroke-width: 2px;
>>stroke-linecap: round;
>>stroke-linejoin: round;
>>stroke-dasharray: 4px 3px;
>>stroke: green;
>
>>stroke-width would be reset to 1px, stroke-linecap to butt stoke-linejoin to
>>miter and stroke-dasharray to none, because stroke (the shorthand) is set
>>after these properties.
>
> Such a behaviour seems to be of limited use and will typically not
> meet what authors want ...

Dirk's code is obviously useless, but the resetting functionality
itself is very useful.  (Not to say it's always what you want, of
course.)  Imagine the "stroke" shorthand was in a different style
block from the group of longhands, written by a separate author.  The
person writing the "stroke: green;" is expecting to get a "default"
stroke, just green-colored.  If it didn't reset, then a bunch of other
properties would bleed through and mess up the styling.

~TJ
Received on Wednesday, 13 November 2013 21:51:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:47 UTC