In this PhD thesis, we develop a new approach to classical gravity starting from Mach's principles and the idea that the local shape of spatial configurations is fundamental. This new theory, "shape dynamics", is equivalent to general relativity but differs in an important respect: shape dynamics is a theory of dynamic conformal 3-geometry, not a theory of spacetime. Equivalence is achieved by trading foliation invariance for local conformal invariance (up to a global scale). After the trading, what is left is a gauge theory invariant under 3d diffeomorphisms and conformal transformations that preserve the volume of space. The local canonical constraints are linear and the constraint algebra closes with structure constants. Shape dynamics, ...