Re: [css-shapes] Animating <basic-shape>s updated

Hi All,

Thought I would chime in with my two cents.

>
>Actually, it's not clear what happens with
>   bottom calc(30%+20px) right calc(30%+20px)
>
>I.e. I could interpret that sentence as wanting either
>   calc(70%-20px) calc(70%-20px)
>or
>   bottom calc(30%+20px) right calc(30%+20px)
>It should be clear that we'd end up as the first.

I would argue that positions should be treated as a length + percentage
offset from top/left for serialization, the same way they are for computed
values. This at least gives a single model of what you are serializing.

Also, I don't think the style system should unwrap calc values, as the
above example could become more complicated:
calc(20% + calc(12vw / 1.6) + 6px + 1em)
Rather than trying to determine if a calc is simple enough to unwrap, it
should just be treated as the length portion of the position offset.


In this case, the two offsets would be horizontal: 100% - calc(30% +
20px), vertical: 100% - calc(30% + 20px), which would then serialize back
to:
right calc(30% + 20px) bottom calc(30% + 20px)
Using the horizontal-first, 4-value syntax.

I do think it is possible to combine percentage values in the syntax,
however.
Eg:
bottom 10% right 20%
Could serialize to 80% 90%.

So perhaps the wording should be that serialization avoids creating new
calc values where possible, instead of the implication that it would
simplify or combine with existing ones.

-Bear

Received on Wednesday, 5 February 2014 21:44:25 UTC