Skip to content

Translate

Below, utility classes to apply transform property.

for $value from 0 through 64

ClassProperties
.translate-x-<value>transform: translateX(#{$value * 0.25}rem);
.translate-y-<value>transform: translateY(#{$value * 0.25}rem);
.translate-x-1/1transform: translateX(100%);
.translate-y-1/1transform: translateY(100%);
.translate-x-1/2transform: translateX(50%);
.translate-y-1/2transform: translateY(50%);
.translate-x-1/3transform: translateX(33.333%);
.translate-y-1/3transform: translateY(33.333%);
.translate-x-2/3transform: translateX(66.667%);
.translate-y-2/3transform: translateY(66.667%);
.translate-x-1/4transform: translateX(25%);
.translate-y-1/4transform: translateY(25%);
.translate-x-2/4transform: translateX(50%);
.translate-y-2/4transform: translateY(50%);
.translate-x-3/4transform: translateX(75%);
.translate-y-3/4transform: translateY(75%);
.translate-x-1/5transform: translateX(20%);
.translate-y-1/5transform: translateY(20%);
.translate-x-2/5transform: translateX(40%);
.translate-y-2/5transform: translateY(40%);
.translate-x-3/5transform: translateX(60%);
.translate-y-3/5transform: translateY(60%);
.translate-x-4/5transform: translateX(80%);
.translate-y-4/5transform: translateY(80%);
.translate-x-1/6transform: translateX(16.667%);
.translate-y-1/6transform: translateY(16.667%);
.translate-x-2/6transform: translateX(33.333%);
.translate-y-2/6transform: translateY(33.333%);
.translate-x-3/6transform: translateX(50%);
.translate-y-3/6transform: translateY(50%);
.translate-x-4/6transform: translateX(66.667%);
.translate-y-4/6transform: translateY(66.667%);
.translate-x-5/6transform: translateX(83.333%);
.translate-y-5/6transform: translateY(83.333%);

Released under the Beerware 🍺 License.