Re: [css-transforms] Making 'transform' match author expectations better with specialized 'rotate'/etc shorthands

> On Jul 13, 2014, at 11:04 AM, Lea Verou <lea@verou.me> wrote:
> 
> On Jul 13, 2014, at 17:04, Dirk Schulze <dschulze@adobe.com> wrote:
>> 
>> If we must have new properties to handle author mistakes (not speaking about the current limitations from above that we need to fix anyway) then:
>> 
>> 1) Have a default order for applying transformations. Do not introduce short-/ or longhands.
>> 2) Add a property to influence the order of the transformation
>> 
>> 	transformation-order: rotate || translate || scale || transform
>> 
>> 3) Just expose the most common used transformations as properties:
>> 
>> 	scale: <number>{1,3}
>> 	translate: <length>{1,3}
>> 	rotate: <angle>
>> 	transform: <transform-list> 
>> 
>> However, this does not explain how to apply an individual transform-origin for each of the transformation properties. Scale and rotate depend on influencing the transform-origin. This is especially true if you can not use translate(offset, offset) scale(factor) translate(-offset, -offset).
>> 
>> I can just repeat that author mistakes like rotate: 45deg; can easily be detected by authors themselves and therefore don’t require us adding more complexity to the platform.
>> 
>> Greetings,
>> Dirk
> 
> These transform properties are to address really common SIMPLE cases like the ones Tab mentioned. They don’t need to do everything (for more low-level control, there’s always transform-list), so they don’t need that kind of complexity. They don’t need to be able to accomplish everything transform does today, or even a large percentage of it.

It seems like Dirk’s limitation #3 would be compatible with this view (maybe a few more functions, but if you’re using the skewX() or matrix3d() transform functions, you are probably no longer doing something simple. To me, it makes sense to handle common simple functions, but adding all 21 seems like overkill if the use case is ease of authoring for simple cases.

If we accept Dirk’s #3 above, then doing #1 and #2 (as opposed to solely a predefined order) would not be hard. I don’t know enough to know for sure if it would actually be useful. I know that for rotate vs translate, it makes a huge difference which you do first. Though it seems (I have not double-checked the math) that you could always achieve the other effect by rotating the translation vector. So for the simple transform property subset, you probably don’t need control over the order.

Regards,
Maciej

Received on Sunday, 13 July 2014 22:29:58 UTC