Re: [css-shapes] Functional Notation

On 10/3/13 2:03 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:
>
>> And given that border-radius has
>> additional functionality we haven't yet allowed for shapes, I think we'd
>> need to do something like this to be consistent:
>>
>> rectangle( <size>? [ at <position> ]? [ radii <radius>{1,4} [/
>> <radius>{1,4} ]?] )
>
>Hm, there's a conflict here between hewing close to SVG and matching
>up with CSS.  I'm not sure which way makes more sense.

I think this is the best summation of the choice between the two options
we're considering. Do we want SVG-similarity for <basic-shape>, or
CSS-similarity?

>
>> I'm liking the simpler rectangle() syntax more, the more I look at
>>this. I
>> agree that the above gives more expressive power, but I'd rather define
>>a
>> path() function to allow defining more complex shapes directly than
>> bashing a rounded-corner rectangle into shape.
>
>Well, that would just give us SVG's path syntax, right?  That would
>provide different functionality.

My point is that the complex rounded corners in CSS are used (or abused)
to create non-rectangular shapes. In SVG, it makes sense to have only
basic rounded corners for rectangles, because you can use more appropriate
methods to create those non-rectangular shapes. Since I expect we'll
eventually add path() to the <basic-shape> roster, I'm not sure it's worth
the effort to synchronize rectangle() with what's possible with
border-radius.

>
>(I haven't decided on my own opinion yet.)

I'm leaning towards SVG-similarity because it already has a track record
for defining all of these shapes in a consistent, usable way.

The CSS-similarity we're considering started with just the circle syntax
because there was a relatively direct correlation with radial gradients.
To extend CSS-similarity to rectangles we're getting into combining syntax
from both both backgrounds and borders, since backgrounds don't have
rounded corners and borders don't have positioning. And so far polygon()
is unaffected by the change - do we end up with CSS-similarity for some
<basic-shape>s and not others? I'm not convinced the end result of
CSS-similarity will be significantly better than SVG-similarity.

Thanks,

Alan

Received on Thursday, 3 October 2013 21:22:09 UTC