Colour ramp that remains constant in meshes of different sizes
You need to define common scale and coordinates that are independent of the other objects dimensions.
If you add an empty to the scene, you can use it to control the sizing, so that the gradient remains constant regardless of the dimensions of the object.
In this example 3 different cubes of different sizes have the same material.

It doesn't have to be an empty, it can be any object.