transform-snap propery

Hi CSS working group,

I'd like to propose a new CSS property; transform-snap.

I use the transform property frequently for experiments and practical
solutions as well. A common approach to vertical align an element is to set
a top offset of 50%, then translate -50%. This often causes pixel
misalignment in Webkit. Text becomes much harder to read. But Gecko handles
this nicely.

The inconcistency of implementation has left me wanting for a solution.
There are three:

- The spec is refined to make all implementations act the same
- A property is introduced to toggle pixel snapping for translates
- A property is introduced to define all kinds of snapping

That last option seems most of interest to me. Not only can you use it
prevent subpixels, you can also apply it to the other functios, like
rotation whilst keeping the syntax familiar.

A few examples:
/* prevent subpixels by forcing it in a 1x1 pixel grid */
transform-snap: translate(1px, 1px);

/* snap rotation */
transform-snap: rotate(45deg);

This could be useful together with transitions and animations.

Please consider putting this proposal or a similar solution into a draft.

Yours sincerely,
Tim Severien

Received on Wednesday, 23 July 2014 14:23:05 UTC