Tailwind CSS Academy · 강의

지속 시간과 이징

duration-75부터 duration-1000까지 사용해 전환에 걸리는 시간을 조절하고, ease-in, ease-out, ease-in-out으로 타이밍 함수를 설정합니다.

레슨 2/413개 단계

지속 시간과 이징은(는) CoddyKit의 무료 Tailwind CSS Academy 강의입니다. 이것은 4개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Tailwind CSS Academy 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Tailwind CSS Academy 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

Duration and Timing in Motion Design

Two properties control how a CSS transition feels: duration (how long the animation takes) and timing function (how the animation accelerates and decelerates over that time). Getting these right is the difference between animations that feel snappy and intentional versus those that feel sluggish or mechanical. Tailwind provides utilities for both, making it easy to tune motion feel without custom CSS.

Duration Utilities

Tailwind's duration-* utilities set the CSS transition-duration property. Values range from duration-75 (75ms, very snappy) to duration-1000 (1000ms, one full second). The default duration when you use transition without a duration-* class is 150ms. Most UI interactions should be under 300ms to feel responsive — longer durations are suitable only for dramatic page-level animations.

<!-- Available duration utilities -->
duration-75    →  75ms
duration-100   → 100ms
duration-150   → 150ms  (default)
duration-200   → 200ms
duration-300   → 300ms
duration-500   → 500ms
duration-700   → 700ms
duration-1000  → 1000ms

<!-- Example: fast button color change -->
<button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg transition-colors duration-150">
  Snappy button
</button>

Choosing the Right Duration

Duration should match the perceived size of the change. Small interactions like button hover, focus rings, and link color changes look best at 100–200ms. Medium transitions like dropdown appearing, card expanding, or tooltip fading work well at 200–300ms. Large motions like sidebar sliding in, modal appearing, or page transitions can go up to 300–500ms. Never exceed 500ms for UI transitions — users should never feel like they are waiting for an animation.

<!-- 150ms: button hover (small interaction) -->
<button class="transition-colors duration-150 hover:bg-blue-700">Button</button>

<!-- 200ms: card shadow depth change (medium) -->
<div class="transition-shadow duration-200 hover:shadow-lg">Card</div>

<!-- 300ms: dropdown fade in (larger change) -->
<div class="transition-opacity duration-300 opacity-0 data-open:opacity-100">Dropdown</div>

<!-- 500ms: modal entrance (dramatic) -->
<div class="transition-all duration-500 scale-95 data-open:scale-100">Modal</div>

Timing Functions (Easing)

The timing function (or easing function) controls how the animation progress distributes over time. A linear animation moves at constant speed. An ease-in starts slow and accelerates. An ease-out starts fast and decelerates. An ease-in-out starts and ends slow with fast middle. Different interactions feel most natural with different easings — choosing well is a subtle but important detail in polished UI design.

/* Tailwind easing utilities */
ease-linear   → cubic-bezier(0, 0, 1, 1)      /* constant speed */
ease-in       → cubic-bezier(0.4, 0, 1, 1)    /* slow start, fast end */
ease-out      → cubic-bezier(0, 0, 0.2, 1)    /* fast start, slow end */
ease-in-out   → cubic-bezier(0.4, 0, 0.2, 1)  /* slow start AND end */

Using ease-in vs ease-out

The choice between ease-in and ease-out has intuitive meaning: ease-in builds momentum (good for elements that are leaving the screen or collapsing) because they start slow and speed up as they exit. ease-out decelerates (good for elements entering the screen) because they arrive quickly and settle into place smoothly. This mirrors real-world physics — things that stop tend to decelerate, things that start tend to accelerate.

<!-- ease-out: element slides INTO view (decelerates on arrival) -->
<div class="-translate-x-full hover:translate-x-0 transition-transform duration-300 ease-out">
  Slides in from left, decelerates to stop
</div>

<!-- ease-in: element exits screen (accelerates on departure) -->
<div class="translate-x-0 hover:translate-x-full transition-transform duration-300 ease-in">
  Slides out to right, accelerating as it exits
</div>

The ease-in-out Pattern

ease-in-out creates the most natural-feeling motion for most UI animations. It mirrors how physical objects move: starting from rest, building to peak speed, then decelerating back to rest. Use it as your default for any animation that involves elements moving between positions — sidebar slides, modal entrances, card expansions, and accordion toggles all feel most natural with ease-in-out.

<!-- ease-in-out: sidebar slide-in (feels most natural) -->
<aside class="-translate-x-full group-open:translate-x-0
               transition-transform duration-300 ease-in-out
               fixed left-0 top-0 h-full w-64 bg-white shadow-xl">
  Sidebar content
</aside>

<!-- Accordion expand: ease-in-out for natural feel -->
<div class="max-h-0 overflow-hidden group-open:max-h-96
             transition-all duration-300 ease-in-out">
  Accordion content
</div>

Delay Utilities

The delay-* utilities add a pause before the transition begins using the CSS transition-delay property. Delays are useful for staggered animations — making a series of elements appear one after another creates a cascading effect that feels polished. Tailwind provides delays from delay-75 (75ms) to delay-1000 (1000ms). Use delays sparingly on hover interactions — delays that trigger only on hover feel unresponsive to users.

<!-- Staggered card entrance animations -->
<div class="opacity-0 translate-y-4 animate-show" style="animation-delay: 0ms">Card 1</div>
<div class="opacity-0 translate-y-4 animate-show" style="animation-delay: 100ms">Card 2</div>
<div class="opacity-0 translate-y-4 animate-show" style="animation-delay: 200ms">Card 3</div>

<!-- Or with Tailwind delay utilities -->
<div class="... transition delay-0">First item</div>
<div class="... transition delay-100">Second item</div>
<div class="... transition delay-200">Third item</div>

Custom Duration and Easing in Config

If your design system requires specific timing values not in Tailwind's defaults — like a duration-250 or a custom cubic-bezier easing — add them in tailwind.config.js. Extend transitionDuration for new duration values and transitionTimingFunction for new easing curves. Custom easing can encode your brand's motion personality, making animations feel recognizably yours.

// tailwind.config.js
module.exports = {
  theme: {
    extend: {
      transitionDuration: {
        '250': '250ms',
        '400': '400ms',
        '2000': '2000ms',
      },
      transitionTimingFunction: {
        'spring': 'cubic-bezier(0.34, 1.56, 0.64, 1)',     // overshoots then settles
        'smooth': 'cubic-bezier(0.4, 0.0, 0.2, 1)',        // material design standard
        'sharp':  'cubic-bezier(0.4, 0.0, 0.6, 1)',        // sharp accelerate/decelerate
      },
    },
  },
};

Transition Timing for Hover Interactions

A useful technique for hover interactions is to have different enter and exit timings. You can achieve this by applying different durations with responsive or state prefixes. Most commonly, hover-in transitions are slightly faster than hover-out transitions — the enter feels snappy and the exit fades more gently. This requires a small amount of custom CSS or JavaScript class manipulation, as Tailwind does not have an 'un-hover' variant built in.

/* CSS: different timing for enter vs exit */
.hover-item {
  @apply transition-all duration-300 ease-out;  /* exit timing */
}
.hover-item:hover {
  @apply duration-150;  /* shorter on enter (faster response) */
  /* Note: Tailwind generates .hover\:duration-150 for this */
}

<!-- Alternative: use hover:duration-* directly in HTML -->
<div class="transition-colors duration-300 hover:duration-150
             bg-gray-100 hover:bg-blue-100">
  Fast enter, slow exit
</div>

Performance: will-change and transform

For elements that animate frequently, you can hint to the browser to promote them to their own compositor layer using will-change. Tailwind does not have a built-in will-change utility in its core, but you can add one via arbitrary values or a custom utility. However, use will-change: transform sparingly — promoting too many elements wastes memory and can actually slow things down.

@layer utilities {
  .will-change-transform {
    will-change: transform;
  }
  .will-change-opacity {
    will-change: opacity;
  }
}

<!-- Apply to elements that animate very frequently -->
<div class="transition-transform duration-300 will-change-transform
             hover:scale-105">
  Frequently animated card (promoted layer)
</div>

Debugging Transitions in DevTools

Chrome DevTools has excellent transition debugging tools. Open the Animations panel (More tools → Animations) to see all running animations and transitions. You can scrub through the timeline, replay animations at slower speeds (0.25x, 0.5x), and inspect the computed timing function curve. This makes it easy to verify that your duration and easing choices look exactly as intended without needing to hover quickly to catch fast animations.

Quick Check

Test your understanding of transition duration and easing in Tailwind CSS.

Lesson Recap

In this lesson you learned: duration utilities from duration-75 to duration-1000 control how long transitions take, ease-out is best for elements entering the screen and ease-in for elements leaving, and delay-* utilities add pauses before transitions begin, enabling staggered animation effects. Next up we explore Tailwind's built-in keyframe animations for loading and attention patterns.

무료로 시작

AI 튜터와 함께 HTML을(를) 배우세요 — 무료

브라우저에서 실제 코드를 작성하고 실행하며, 24/7 AI 튜터로부터 즉각적인 도움을 받고, 웹이나 앱에서 중단한 부분부터 계속 학습하세요.

코스
30
레슨
120

자주 묻는 질문

“지속 시간과 이징” 강의는 무료인가요?

네 — “지속 시간과 이징” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Tailwind CSS Academy 강의 전체를 잠금 해제할 수 있습니다. Tailwind CSS Academy 강의에는 총 4개의 강의가 포함되어 있습니다.

“지속 시간과 이징”에서 뭘 배우나요?

duration-75부터 duration-1000까지 사용해 전환에 걸리는 시간을 조절하고, ease-in, ease-out, ease-in-out으로 타이밍 함수를 설정합니다. 브라우저에서 직접 실행하는 실습 코드로 Tailwind CSS Academy을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Tailwind CSS Academy을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Tailwind CSS Academy은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 2번째 강의입니다.

“지속 시간과 이징” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Tailwind CSS Academy 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Tailwind CSS Academy 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. 전환 유틸리티
  2. 지속 시간과 이징
  3. 내장 키프레임 애니메이션
  4. 구성 파일의 사용자 지정 애니메이션
← Tailwind CSS Academy(으)로 돌아가기