transform-origin property to me is like hanging the object on a point and then using that point as a center to move the object.
The transform-origin property let us change the position of elements with transform property set.
If we have elements with 2D transformations set then we can pin the transform-origin point to move those elements in x- and y-axis. We can also do that for z-axis if we have 3D transformations set for an element.
transform-origin property has a default values of 50% 50% 0
That value is always set unless we define something else to be set.
As we can see that by default it pins the elements in the center of the element so when we ONLY specify the transform property, it will adjust according to that default pin set.
And if we move that pin using transform-origin property then it will use that new pin point to adjust the elements on x or y or z axis depending on the transform-origin property value.
All major browsers support it so feel free to use it.
Syntax
transform-origin: x-axis y-axis z-axis|initial|inherit;
x-axis and y-axis possible values are left, center, right, length and % but for z-axis only one possible value is length.
Examples
transform-origin: center
transform-origin: top left
transform-origin: 25% 25%
transform-origin: top left, transform: skewX(50deg)
Source: w3.org
examples property style transform transform-origin