08비교 열 강조
비교표에서 마우스를 올린 열만 테두리가 밝아지고 살짝 커져, 지금 보고 있는 플랜이 뚜렷해집니다.
쓰임여러 플랜을 나란히 놓은 비교표, 기능별 대조 테이블
scaleborder-color180ms

<main class="stage">
<div class="ch-table is-demo">
<div class="ch-col">
<span class="ch-col__tag">Basic</span>
<span class="ch-col__price">$9</span>
</div>
<div class="ch-col">
<span class="ch-col__tag">Pro</span>
<span class="ch-col__price">$29</span>
</div>
<div class="ch-col">
<span class="ch-col__tag">Team</span>
<span class="ch-col__price">$79</span>
</div>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
// ── 변수 3개 ──────────────────────────────────────────
$duration: 180ms;
$easing: $ease-out;
$color: $subject-blue;
@include stage($stage-paper);
.ch-table {
width: min(320px, 88vw);
aspect-ratio: 320 / 180;
display: flex;
gap: $sp-2;
}
.ch-col {
flex: 1 1 0;
box-sizing: border-box;
border-radius: $r-sm;
border: 2px solid transparent;
padding: $sp-3;
display: flex;
flex-direction: column;
justify-content: flex-end;
gap: $sp-1;
background: rgba(23, 20, 26, .05);
color: $subject-ink;
font: 600 12px/1 -apple-system, "Segoe UI", sans-serif;
transition: transform $duration $easing, border-color $duration $easing, background $duration $easing;
}
.ch-col__tag { opacity: .7; font-size: 11px; }
.ch-col__price { font-size: 18px; font-weight: 700; }
// 실사용: 마우스를 올린 열만 확대 + 테두리
.ch-col:hover {
transform: scale(1.05);
border-color: $color;
background: rgba(23, 20, 26, .08);
}
// 데모 루프: is-demo 는 열마다 순서대로 같은 강조를 반복 재생 (캡처용)
@keyframes ch-pulse {
0%, 66%, 100% { transform: scale(1); border-color: transparent; }
16% { transform: scale(1.05); border-color: $color; }
}
.ch-table.is-demo .ch-col { animation: ch-pulse $dur-loop * 1.5 $easing infinite; }
.ch-table.is-demo .ch-col:nth-child(2) { animation-delay: #{$dur-loop * 0.5}; }
.ch-table.is-demo .ch-col:nth-child(3) { animation-delay: #{$dur-loop}; }
@media (prefers-reduced-motion: reduce) {
.ch-col:hover,
.ch-table.is-demo .ch-col { animation: none !important; transform: none !important; border-color: transparent !important; }
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: #ffffff;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
.ch-table {
width: min(320px, 88vw);
aspect-ratio: 320/180;
display: flex;
gap: 8px;
}
.ch-col {
flex: 1 1 0;
box-sizing: border-box;
border-radius: 8px;
border: 2px solid transparent;
padding: 12px;
display: flex;
flex-direction: column;
justify-content: flex-end;
gap: 4px;
background: rgba(23, 20, 26, 0.05);
color: #17141a;
font: 600 12px/1 -apple-system, "Segoe UI", sans-serif;
transition: transform 180ms ease-out, border-color 180ms ease-out, background 180ms ease-out;
}
.ch-col__tag {
opacity: 0.7;
font-size: 11px;
}
.ch-col__price {
font-size: 18px;
font-weight: 700;
}
.ch-col:hover {
transform: scale(1.05);
border-color: #2f6df6;
background: rgba(23, 20, 26, 0.08);
}
@keyframes ch-pulse {
0%, 66%, 100% {
transform: scale(1);
border-color: transparent;
}
16% {
transform: scale(1.05);
border-color: #2f6df6;
}
}
.ch-table.is-demo .ch-col {
animation: ch-pulse 3s ease-out infinite;
}
.ch-table.is-demo .ch-col:nth-child(2) {
animation-delay: 1s;
}
.ch-table.is-demo .ch-col:nth-child(3) {
animation-delay: 2s;
}
@media (prefers-reduced-motion: reduce) {
.ch-col:hover,
.ch-table.is-demo .ch-col {
animation: none !important;
transform: none !important;
border-color: transparent !important;
}
}import { CSSProperties } from "react";
import styles from "./CompareColumnHighlight.module.scss";
export interface CompareColumnHighlightProps {
duration?: string;
easing?: string;
color?: string;
}
const COLS = [
{ tag: "Basic", price: "$9" },
{ tag: "Pro", price: "$29" },
{ tag: "Team", price: "$79" },
];
export default function CompareColumnHighlight({
duration = "180ms",
easing = "ease-out",
color = "#2f6df6",
}: CompareColumnHighlightProps) {
const style = { "--duration": duration, "--easing": easing, "--color": color } as CSSProperties;
return (
<div className={styles.table} style={style}>
{COLS.map((c) => (
<div key={c.tag} className={styles.col}>
<span className={styles.tag}>{c.tag}</span>
<span className={styles.price}>{c.price}</span>
</div>
))}
</div>
);
}08 비교 열 강조 — 측정 누적면적 5.153% · 움직인 프레임 23/23GODRICH 원작 · zip 에 SCSS·React 포함 · CSS 가격표 디자인 애니메이션 9종
이 데모가 속한 글
CSS 가격표 디자인 애니메이션 9종가격표 디자인에 마우스를 올렸을 때 카드가 살짝 떠오르거나 가격 숫자가 휙 바뀌는 걸 본 적 있으신가요? 어떤 요금제를 고를지 망설이는 그 짧은 순간, 이런 작은 움직임 하나가 시선을 붙잡아 줍니다. 이 글은 그런 이 글의 데모 전부 보기

