Transform

Transform utilities move, scale, rotate, center, and adjust the visual origin of elements without writing custom CSS. They are ideal for hover states, floating cards, dropdown animations, centered overlays, decorative badges, and polished interaction details.

Hygular uses the individual CSS properties translate, scale, and rotate. No transform activation class is required. Translation utilities share --translate-x and --translate-y.

All transform utilities are pure CSS and do not require the Hygular runtime.


Quick reference

GroupClassesEffectCommon use
Centering

translate-center, translate-x-center, translate-y-center, is-absolute top-50 start-50 translate-center

translate(...) / absolute centeringModals, loaders, hero content, floating controls.
Scale

scale-0, scale-75, scale-90, scale-95, scale-100, scale-105, scale-110, scale-125

scale(...)Hover lifts, pressed states, cards, icons, badges.
Translate

translate-x-*, -translate-x-*, translate-y-*, -translate-y-*

translateFloating cards, offsets, micro-interactions.
Rotation

rotate-*, -rotate-*

rotate(...)Icons, arrows, badges, decorative UI.
Origin

origin-center, origin-top, origin-right, origin-bottom, origin-left

transform-origin: ...;Dropdowns, popovers, menus, directional animations.

Usage

Scale, rotation, and translation utilities can be combined on the same element.

<div class="scale-105 rotate-3">
  Interactive Card
</div>

How transforms compose

Scale utilities set scale, rotation utilities set rotate, and translation utilities set translate. These are separate CSS properties, so a rotation does not replace a scale.

<div class="scale-110 translate-y-2 rotate-3">Transformed content</div>

Centered element

Use translate-center when an element already has positioning and should be centered through translation.

<div class="translate-center">
  Centered Element
</div>

Absolute center

Combine is-absolute top-50 start-50 translate-center inside a positioned parent to center an overlay.

<div class="is-absolute top-50 start-50 translate-center">
  Modal Content
</div>

Scaled content

Scale utilities resize an element visually while preserving the surrounding document flow.

<div class="scale-105">
  Enlarged Content
</div>

Vertical offset

Use translate utilities for subtle movement, hover lifts, and floating card effects.

<div class="translate-y-4">
  Floating Card
</div>

Horizontal offset

Horizontal translate utilities are useful for decorative offsets, slide-in details, and controlled UI movement.

<div class="translate-x-4">
  Offset Element
</div>

Rotated icon

Rotation utilities work well for icons, arrows, badges, and decorative labels.

<i class="rotate-90">
  →
</i>

Centering utilities

ClassBehaviorRecommended use
translate-centerCenters on both axes.Centered overlays, loader wrappers, positioned content.
translate-x-centerCenters horizontally.Tooltips, floating labels, horizontal alignment.
translate-y-centerCenters vertically.Side controls, vertical icons, rail buttons.
is-absolute top-50 start-50 translate-centerAbsolutely centers the element.Modals, loaders, hero content, empty states, floating controls.

Scale

Scale utilities resize elements visually. Use smaller values for professional interfaces and larger values only for decorative or explicit emphasis.

ClassValueRecommended use
scale-00Hidden or collapsed transform state.
scale-750.75Compact decorative elements.
scale-900.90Small entrance or inactive states.
scale-950.95Pressed buttons, dropdown start states.
scale-1001.00Default or reset scale.
scale-1051.05Hover cards, interactive surfaces.
scale-1101.10Icon emphasis and stronger hover states.
scale-1251.25Decorative emphasis and illustrations.

Translate Y

Vertical translate utilities move elements up or down through the transform system.

ClassOffsetDirection
translate-y-1-0.25remUp
translate-y-2-0.5remUp
translate-y-3-0.75remUp
translate-y-4-1remUp
translate-y-8-2remUp
-translate-y-10.25remDown
-translate-y-20.5remDown
-translate-y-30.75remDown
-translate-y-41remDown
-translate-y-82remDown

Translate X

Horizontal translate utilities move elements left or right through the transform system.

ClassOffsetDirection
translate-x-10.25remRight
translate-x-20.5remRight
translate-x-30.75remRight
translate-x-41remRight
translate-x-82remRight
-translate-x-1-0.25remLeft
-translate-x-2-0.5remLeft
-translate-x-3-0.75remLeft
-translate-x-4-1remLeft
-translate-x-8-2remLeft

Rotation

Rotation utilities are useful for icons, badges, decorative UI, disclosure arrows, and playful visual accents.

Subtle rotation

Use subtle rotations for badges, illustrations, stickers, and decorative UI.

ClassRotationRecommended use
rotate-11degVery subtle visual tilt.
rotate-22degSoft decorative emphasis.
rotate-33degBadges and sticker-like UI.
rotate-1212degStronger decorative labels.
-rotate-1-1degVery subtle reverse tilt.
-rotate-2-2degSoft reverse emphasis.
-rotate-3-3degReverse badge tilt.
-rotate-12-12degStrong reverse decorative labels.
<div class="rotate-3">
  Badge
</div>

Standard rotation

ClassRotationRecommended use
rotate-4545degDirectional indicators and decorative shapes.
rotate-9090degArrows and rotated icons.
rotate-180180degExpanded/collapsed arrow states.
rotate-270270degDirectional UI and icon orientation.
-rotate-45-45degReverse diagonal rotation.
-rotate-90-90degReverse quarter-turn rotation.

Transform origin

Transform origin controls the point around which scaling and rotation happen. It is especially useful for dropdown menus, popovers, tooltips, and directional animations.

ClassOriginRecommended use
origin-centercenterBalanced scale and rotation.
origin-toptopMenus opening downward.
origin-top-righttop rightRight-aligned dropdown menus.
origin-rightrightSide panels and right-edge motion.
origin-bottom-rightbottom rightMenus or labels anchored from the lower right.
origin-bottombottomElements expanding upward.
origin-bottom-leftbottom leftLeft-aligned upward motion.
origin-leftleftSide navigation and left-edge motion.
origin-top-lefttop leftLeft-aligned dropdown menus.

Menu animation

<div
  class="scale-95 origin-top-right"
>
  Dropdown Menu
</div>

Real-world examples

Premium card lift

<div
  class="translate-y-2 scale-105"
>
  Feature Card
</div>

Floating action button

<button
  class="translate-y-4 shadow-large"
>
  +
</button>

Decorative badge

<div
  class="rotate-12"
>
  New
</div>

Centered loader

<div class="is-absolute top-50 start-50 translate-center">
  Loading...
</div>

Rotating icon

<i class="rotate-180">
  ↓
</i>

Combining utilities

Scale + translate

<div
  class="scale-105 translate-y-2"
>
  Card
</div>

Rotate + scale

<div
  class="rotate-3 scale-105"
>
  Sticker
</div>

Translate + rotate

<div
  class="translate-x-4 rotate-12"
>
  Decorative Shape
</div>

Choosing the right transform

Use caseRecommended utility
Subtle hover lifttransform + scale-105 + translate-y-2
Perfectly centered overlayis-absolute top-50 start-50 translate-center
Dropdown opening from a cornerorigin-top-right + scale-95
Rotating arrow indicatortransform + rotate-180
Decorative badgetransform + rotate-12

Usage notes

  • Always use transform when combining transform utilities such as scale, translate, and rotate.
  • Use small scale values for professional interfaces; scale-105 is usually enough for hover emphasis.
  • Reserve large rotations for decorative elements, stickers, badges, and illustrations.
  • Use absolute-center for overlays, modals, loaders, hero content, and empty states.
  • Prefer subtle translations for hover and motion effects so the interface stays calm and premium.
  • Combine transform utilities with shadow, transition-all, hover:, and origin-\* utilities for polished interactive states.

Hygular