W3C home > Mailing lists > Public > www-style@w3.org > May 2010

RE: [css3-background] box-shadow spread radius and rounded corners

From: Sylvain Galineau <sylvaing@microsoft.com>
Date: Fri, 7 May 2010 01:03:18 +0000
To: fantasai <fantasai.lists@inkedblade.net>
CC: "www-style@w3.org" <www-style@w3.org>, Brian Manthos <brianman@microsoft.com>, Prabs Chawla <pchawla@microsoft.com>
Message-ID: <045A765940533D4CA4933A4A7E32597E21488DAE@TK5EX14MBXC120.redmond.corp.microsoft.com>
> From: fantasai [mailto:fantasai.lists@inkedblade.net]


> Ok, so here's what I've got so far:
> 
>    | The fourth length is a spread radius. Positive values cause
>    | the shadow shape to expand in all directions by the specified
>    | radius. Negative values cause the shadow shape to contract. For
>    | corners with a zero border-radius, the corner remains sharp.
>    | Otherwise the spread radius outsets the edge of the shadow by
>    | the amount of the spread radius in the direction perpendicular
>    | to the shadow's edge. (Note that for inner shadows, expanding
>    | the shadow means shrinking the shadow's perimeter.) The UA may
>    | approximate the spread shape by outsetting (insetting, for inner
>    | shadows) the shadow's straight edges by the spread radius and
>    | increasing (decreasing, for inner shadows) and flooring at zero
>    | the corner radii by the same amount.
> 
> This preserves a strict geometrical definition of "spread", but allows
> the UA to approximate it with an easy-to-draw shape. I kept the "leave
> corners sharp" option, since it's probably useful, although I do not
> have a strong opinion on it at this point.


This looks good. Only small item not explicitly stated is the question brought 
up by Simon regarding negative spread values larger than one or both of the box 
dimensions, making the shadow disappear. (Conversely for inset, large positive 
spread radii). You already have the 0 flooring for the corner radii but it's 
the same for width and height e.g.

>    | ...................................................The UA may
>    | approximate the spread shape by outsetting (insetting, for inner
>    | shadows) the shadow's straight edges by the spread radius and
>    | increasing (decreasing, for inner shadows) the corner radii by
>    | the same amount. The spread shadow's width, height and corner
>    | radii all floor at zero. A width and/or height of zero result
>    | in no shadow being drawn.
Received on Friday, 7 May 2010 01:03:57 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:27 GMT