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

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

From: Brad Kemper <brad.kemper@gmail.com>
Date: Wed, 28 Apr 2010 17:45:25 -0700
Message-Id: <3A14BD0C-B853-4C91-B399-B6D73514FB1D@gmail.com>
To: Sylvain Galineau <sylvaing@microsoft.com>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, fantasai <fantasai.lists@inkedblade.net>, "www-style@w3.org" <www-style@w3.org>, Brian Manthos <brianman@microsoft.com>, Prabs Chawla <pchawla@microsoft.com>
On Apr 28, 2010, at 3:37 PM, Sylvain Galineau <sylvaing@microsoft.com>  
wrote:

>> From: Brad Kemper [mailto:brad.kemper@gmail.com]
>
>
>>> This is incorrect.
>>
>> No it isn't. The straight parts do not get any longer or shorter no
>> matter how much spread you apply.
> Yes it is ! :)
>
> More seriously, do you mean absolutely or relatively ? A simple  
> testcase
> such as the one I mentioned earlier does show that the proportion of
> the outer shadow edge that is rounded does increase vs. that which is
> straight.

Absolute. The proportions naturally change, but they do anyway, no  
matter what you do with the corners. Spread by definition is a  
thickening up around the edges, which changes the proportions in the  
same way that adding a border does. The important thing about what  
makes it spread is that an even amount is applied, i.e. not more  
around curves than along staight edges. If you apply more thickening  
spread around curves in order to have smaller outer radii, then you  
are applying that thickening disproportionately compared to how it is  
applied elsewhere. Like this:

Http://bradclicks.com/cssplay/icky_thickening_on_Curves.png

> That can't be avoided.

The proportion of the outer radii to the width and height does change,  
just as the proportion of the width to height changes, which also  
cannot be avoided with spread (just as with border, or the effect of  
padding on the proportions of a content box). It's the nature of the  
beast. What's more important for spread is that it is applied evenly,  
and not get arbitrarily thicker when it goes around particular curves.

>> But so what? I can create all kinds of crap by using extreme, huge
>> values in almost any property that includes numbers.
>
> You keep asserting these values are extreme but for some of them,  
> that's
> Intentional i.e. for illustration purposes.

Well, if you really want to use spread for something beyond it's  
normal use and intent, or to exagerate the effect, that's fine with me.

But spread should act like spread, and we should be surprised if  
spread value that are bigger than the box width/height look a little  
odder than the way most people use them. That's not a reasonable  
reason to change the meaning of the word "spread" (or "choke", which  
is essentially negative spread) from what it has always meant, or to  
turn it into some sort of bastardized "scale".

> If I want to create a non-blurred shadow around my rounded-corner box,
> however, it doesn't take much for the shapes of the outer edges of the
> shadow and box to mismatch.

It is mainly the offsets and lack of blur that make you think  
something doesn't match, as you are looking at an outer edge (of the  
spread) near the edge of a smaller box (the border box). If you  
instead think of a drop shadow as being a glow that is offset (in RL,  
it's the opposite of a glow, because you are subtracting light instead  
of adding it), then you can see that without the offsets and with some  
blur, it looks much more natural if the glow (spread or not) follows  
the curve correctly. Offset it and change the color, and it's now a  
shadow.


> As long as more people understand this is by design than the  
> converse -
> and thus that this is the wrong feature for the job - I'm happy. I  
> don't
> really have a way of verifying it though so I'll have to trust you :)

You can find plenty of online tutorials and help on how to use  
PhotoShop's layer effects to get a drop shadow with spread (or inner  
shadow with choke). And in terms if the usage of the word, you can  
look up "choke" and "spread" together and discover a lot about how  
these terms were used for trapping inks in desktop publishing  
software, before they were ever used for a different purpose (but  
equivelent effect) for shadows in PhotoShop. The terms predate the  
digital age, and were used extensively for color trapping using an  
optical technique that created the same sort of effect. That info  
should be findable online too.

>> That's not the purpose of it. <snip> It is an artistic effect
>> that is important for the artist to get just the shadow he wants.
>
> Right. I don't have that expertise and I don't expect the spec to
> impart that knowledge to me either. Thus the spec should be precise
> so that the rest of us idiots don't get 'hung up' on the wrong plain
> English sentence.

Sure, I agree with that. From my first message about this today I  
agreed that the sentence could be improved. 
Received on Thursday, 29 April 2010 00:46:13 GMT

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