본문 바로가기
명함 만들기 캐릭터 모음 16가지 디자인 · PNG / SVG / PDF

스켈레톤

곧 들어올 내용의 모양을 미리 깔아 둬서, 글자가 채워질 때 화면이 튀지 않게 할 때 쓰는 조각.

피드백

실제 미리보기

출처

<div class="dc-skel">
  <p class="dc-sr" role="status">내용을 불러오는 중입니다</p>
  <div class="dc-skel__card" aria-hidden="true">
    <div class="dc-skel__shape dc-skel__media"></div>
    <div class="dc-skel__stack">
      <div class="dc-skel__shape dc-skel__line dc-skel__line--title"></div>
      <div class="dc-skel__shape dc-skel__line"></div>
      <div class="dc-skel__shape dc-skel__line dc-skel__line--short"></div>
    </div>
  </div>
</div>
.dc-skel { max-width: 420px; font-family: var(--dc-font); }
.dc-skel__card {
  display: flex; flex-direction: column; gap: var(--dc-3);
  padding: var(--dc-4);
  border: 1px solid var(--dc-line);
  border-radius: var(--dc-r-md);
  background: var(--dc-surface);
}
.dc-skel__stack { display: flex; flex-direction: column; gap: var(--dc-2); flex: 1 1 auto; min-width: 0; }
.dc-skel__shape {
  position: relative; overflow: hidden;
  background: var(--dc-sunken);
  border-radius: var(--dc-r-xs);
}
.dc-skel__shape::after {
  content: ""; position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--dc-text) 9%, transparent), transparent);
  animation: dc-skel-pass 1400ms ease-in-out infinite;
}
.dc-skel__media { height: 140px; border-radius: var(--dc-r-sm); }
.dc-skel__line { height: 12px; }
.dc-skel__line--title { height: 16px; width: 62%; }
.dc-skel__line--short { width: 40%; }
.dc-skel__avatar { flex: none; width: 44px; height: 44px; border-radius: var(--dc-r-full); }
.dc-skel__list { display: flex; flex-direction: column; gap: var(--dc-4); margin: 0; padding: 0; list-style: none; }
.dc-skel__row { display: flex; align-items: center; gap: var(--dc-3); }
@keyframes dc-skel-pass { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .dc-skel__shape::after { display: none; }
}

이렇게 씁니다

  • 실제 내용과 같은 높이·같은 줄 수로 만든다 — 모양이 다르면 채워질 때 화면이 튄다
  • 처음 불러올 때만 쓴다. 이미 본 목록을 다시 불러올 때는 기존 내용을 두고 스피너만 올린다
  • 칸 한두 개가 아니라 덩어리 전체를 채울 때 쓴다

주의할 점

  • 모양에는 aria-hidden 을 주고, 읽힐 말은 따로 한 줄 남긴다
  • 반짝임을 끝없이 돌리지 마라 — 실패하면 반드시 오류 화면으로 바꾼다

다음에 볼 것