---
title: "Magic CSS"
description: "Opt-in Magic Animate keyframes as UnoCSS animate-* utilities, with animation-fill-mode both."
canonical_url: "https://vinicunca.dev/unocss-preset/magic-css"
---
# Magic CSS

> Opt-in Magic Animate keyframes as UnoCSS animate-* utilities, with animation-fill-mode both.

Magic CSS is **off** by default. It registers [Magic Animate](https://github.com/miniMAC/magic) keyframes on the UnoCSS animation theme. There is no extra options object — `magicCss` is a boolean.

```ts [uno.config.ts]
import { presetVinicunca } from '@vinicunca/unocss-preset';
import { defineConfig } from 'unocss';

export default defineConfig({
  presets: [
    presetVinicunca({
      magicCss: true
    })
  ]
});
```

Use the Wind4 `animate-*` utilities. Each named animation also sets `animation-fill-mode: both`.

```html
<div class="animate-magic">Magic</div>
<div class="animate-puff-in">Puff in</div>
<div class="animate-vanish-out">Vanish out</div>
```

## Animations

Grouped the same way as the preset's `theme.animation.category` map.

| Category | Classes (`animate-{name}`) |
| --- | --- |
| Bling | `puff-in`, `puff-out`, `vanish-in`, `vanish-out` |
| Boing | `boing-in-up`, `boing-out-down` |
| Bomb | `bomb-left-out`, `bomb-right-out` |
| Magic Effects | `magic`, `swap`, `twister-in-down`, `twister-in-up` |
| Math | `foolish-in`, `foolish-out`, `hole-out`, `swash-in`, `swash-out` |
| Space | `space-in-down`, `space-in-left`, `space-in-right`, `space-in-up`, `space-out-down`, `space-out-left`, `space-out-right`, `space-out-up` |
| Perspective | `perspective-down`, `perspective-down-return`, `perspective-left`, `perspective-left-return`, `perspective-right`, `perspective-right-return`, `perspective-up`, `perspective-up-return` |
| Rotate | `rotate-down`, `rotate-left`, `rotate-right`, `rotate-up` |
| Slide | `slide-down`, `slide-down-return`, `slide-left`, `slide-left-return`, `slide-right`, `slide-right-return`, `slide-up`, `slide-up-return` |
| Static Effects | `open-down-left`, `open-down-left-return`, `open-down-right`, `open-down-right-return`, `open-up-left`, `open-up-left-return`, `open-up-right`, `open-up-right-return` |
| Static Effects Out | `open-down-left-out`, `open-down-right-out`, `open-up-left-out`, `open-up-right-out` |
| Tin | `tin-down-in`, `tin-down-out`, `tin-left-in`, `tin-left-out`, `tin-right-in`, `tin-right-out`, `tin-up-in`, `tin-up-out` |

> [!NOTE]
> 
> These `slide-*` names are Magic Animate keyframes (`animate-slide-down`). They are separate from the default animation preset's `slide-in-top` / `slide-out-left` utilities.

Control duration and easing with Wind4 modifiers:

```html
<div class="animate-swash-in animate-duration-500 animate-ease-in-out">
  Hello
</div>
```


## Sitemap

See the full [sitemap](https://vinicunca.dev/sitemap.md) for all pages.
