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

Re: 'stroke' shorthand

From: Dirk Schulze <dschulze@adobe.com>
Date: Thu, 14 Nov 2013 01:32:12 -0800
To: Rik Cabanier <cabanier@gmail.com>
CC: "Tab Atkins Jr." <jackalmage@gmail.com>, "Dr. Olaf Hoffmann" <Dr.O.Hoffmann@gmx.de>, www-svg <www-svg@w3.org>
Message-ID: <9E6EC907-96EF-4CFE-97EF-A25A9F6910B5@adobe.com>

On Nov 14, 2013, at 5:18 PM, Rik Cabanier <cabanier@gmail.com> wrote:

> 
> 
> 
> On Wed, Nov 13, 2013 at 7:20 PM, Dirk Schulze <dschulze@adobe.com> wrote:
> 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.
> 
> I checked Illustrator and it always puts the stroke first:
> <style type="text/css">
> .st{fill:#00FF00;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:12;}
> </style>
> <rect x="246" y="59" class="st" width="374" height="266"/>
> 
> so content from Illustrator should not be affected if we were to make this change.

Did you check grouping where you put stroke information like stroke-width on the whole group but stroke elements individually?

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 09:32:49 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:34 UTC