Re: 'stroke' shorthand

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