02Shine sweep button
A tilted white band (::after) crosses inside overflow: hidden by translateX, leaving a highlight like light glancing across glass.
Best forCheckout and buy buttons, the one button a promo banner wants pressed
translateX(±150%)skewX(-20deg)overflow: hidden

<main class="stage is-demo">
<button class="btn" type="button"><span class="btn__label">Buy now</span></button>
</main>@use "../../../../site/static/demo-tokens" as *;
// ── 변수 3개 ──────────────────────────────────────────
$duration: $dur-loop; // 2s — 스윕 한 주기
$easing: $ease-out;
$color: $subject-ink; // 버튼 바탕
@include stage($stage-yellow);
.btn {
box-sizing: border-box;
position: relative;
width: 240px;
height: 64px;
border: none;
border-radius: $r-control;
background: $color;
color: $subject-cream;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
font-weight: 700;
font-size: 17px;
cursor: pointer;
overflow: hidden; // 빛 띠가 밖으로 새지 않게
box-shadow: $shadow-raised;
}
.btn__label { position: relative; z-index: 1; }
// 기울어진 흰 빛 띠 — transform 만으로 통과시킨다
.btn::after {
content: "";
position: absolute;
top: 0; bottom: 0;
left: -60%;
width: 60%;
background: linear-gradient(115deg,
transparent 0%, rgba(255, 255, 255, .85) 50%, transparent 100%);
transform: skewX(-20deg) translateX(-10%);
}
// 실사용: 올릴 때마다 한 번 쓸고 지나감
.btn:hover::after { animation: sweep $dur-enter $easing 1; }
.btn:focus-visible { outline: 3px solid $subject-ink; outline-offset: 4px; }
// 격자 미리보기: 2초 루프로 강제 발동
.stage.is-demo .btn::after { animation: sweep $duration $easing infinite; }
@keyframes sweep {
0%, 10% { transform: skewX(-20deg) translateX(-10%); }
55% { transform: skewX(-20deg) translateX(310%); }
100% { transform: skewX(-20deg) translateX(310%); }
}
@media (prefers-reduced-motion: reduce) {
.btn:hover::after, .stage.is-demo .btn::after { animation: none; transform: skewX(-20deg) translateX(-10%); }
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: #ffd23f;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
.btn {
box-sizing: border-box;
position: relative;
width: 240px;
height: 64px;
border: none;
border-radius: 12px;
background: #17141a;
color: #fff7e6;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
font-weight: 700;
font-size: 17px;
cursor: pointer;
overflow: hidden;
box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}
.btn__label {
position: relative;
z-index: 1;
}
.btn::after {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: -60%;
width: 60%;
background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.85) 50%, transparent 100%);
transform: skewX(-20deg) translateX(-10%);
}
.btn:hover::after {
animation: sweep 600ms ease-out 1;
}
.btn:focus-visible {
outline: 3px solid #17141a;
outline-offset: 4px;
}
.stage.is-demo .btn::after {
animation: sweep 2s ease-out infinite;
}
@keyframes sweep {
0%, 10% {
transform: skewX(-20deg) translateX(-10%);
}
55% {
transform: skewX(-20deg) translateX(310%);
}
100% {
transform: skewX(-20deg) translateX(310%);
}
}
@media (prefers-reduced-motion: reduce) {
.btn:hover::after, .stage.is-demo .btn::after {
animation: none;
transform: skewX(-20deg) translateX(-10%);
}
}import type { CSSProperties, ReactNode } from "react";
import styles from "./ShineSweepButton.module.scss";
export type ShineSweepButtonProps = {
duration?: number;
easing?: string;
color?: string;
children?: ReactNode;
};
export default function ShineSweepButton({
duration = 600,
easing = "ease-out",
color = "#17141a",
children = "지금 구매하기",
}: ShineSweepButtonProps) {
const vars: CSSProperties = { "--duration": `${duration}ms`, "--easing": easing, "--color": color } as CSSProperties;
return (
<button className={styles.btn} style={vars} type="button">
<span className={styles.label}>{children}</span>
</button>
);
}02 Shine sweep button — Measured area 10.349% · moving frames 9/23Original by GODRICH · SCSS and React ship in the zip · 9 css button design ideas — candy, push, loading
The post this demo lives in
9 css button design ideas — candy, push, loadingcss button design means deciding a button's colors, shape, and mouse reaction in a few lines of code. Want that candy-gr See all demos in this post
If you like this effect - similar demos
Buttons02 Button Highlight a Light-angle Value Sweeps Across9 CSS 3D Button Effects — Copy-paste Ready
Buttons06 A Button With a Gloss Band While Sending and a Highlight That Follows the Pointer TiltSend Button Animation CSS: 9 Fold-and-Fly Buttons
Buttons09 Loading morph: button to spinner to check9 button hover effects css that award sites reuse