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

Re: 'stroke' shorthand

From: Dirk Schulze <dschulze@adobe.com>
Date: Wed, 13 Nov 2013 19:20:53 -0800
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: "Dr. Olaf Hoffmann" <Dr.O.Hoffmann@gmx.de>, www-svg <www-svg@w3.org>
Message-ID: <44FC4E5C-3AFB-4510-B5CA-76EBA43AEACF@adobe.com>
Hi,

Just a clarification: I do not question the use of shorthands as used by the CSS WG. Once you know the idea behind shorthands they are very convenient. See inline content:

On Nov 14, 2013, at 5:50 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:

> 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.

The code is useless if we would already HAVE the shorthand functionality. I just wanted to point out that turning stroke to a shorthand could potentially break content. As a matter of fact, I was opening some old files I still had, and I found quite a mixture and some examples would look different after turning stroke into a shorthand. I did not check the export of Illustrator and InkScape yet.

Greetings,
Dirk

>  (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 Thursday, 14 November 2013 03:21:29 UTC

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