09Squishy buttons & inputs
The button squishes down on press while its pink shadow flattens with it, and the input grows a soft mint ring on focus. This one item bundles the whole kit's tactile feel.
Best forForm submit buttons, newsletter inputs
눌림·그림자 동시 감소focus 링 확산radius 12

<main class="stage">
<div class="ctrlcandy">
<button class="ctrlcandy__btn" type="button">Save</button>
<label class="ctrlcandy__field">
<span class="ctrlcandy__label">Email</span>
<input class="ctrlcandy__input" type="email" placeholder="Type your email">
</label>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
$duration: $dur-loop; // 버튼이 눌렸다 돌아오는 주기
$easing: $ease-spring;
$color: $stage-ink; // 글자 기본(토큰) — 베리 잉크로 덮는다
// 캔디 팔레트 — 값은 tailwind.config.js · tokens.css 와 같다
$candy-cream: #fff6f0;
$candy-bubble: #ffb9cf;
$candy-mint: #b5e8d2;
$candy-lavender: #cdbcf2;
$candy-berry: #55395e;
// 무대 — 민트 물색
@include stage(mix($candy-mint, $stage-paper, 28%));
.ctrlcandy {
box-sizing: border-box;
width: clamp(260px, 84vw, 340px);
display: flex;
flex-direction: column;
gap: $sp-4;
}
.ctrlcandy__btn {
align-self: flex-start;
border: 0;
border-radius: $r-control;
background: $stage-paper;
color: $candy-berry;
padding: $sp-3 $sp-6;
font-weight: 700; font-size: clamp(12px, 3vw, 14px); line-height: 1;
box-shadow: 0 8px 18px rgba($candy-bubble, .65);
// 데모에서는 눌림을 보여주기 위해 is-demo 로 루프를 건다
animation: candyPress $duration $easing infinite;
}
.ctrlcandy__btn:focus-visible {
outline: 3px solid $candy-berry;
outline-offset: 2px;
}
.ctrlcandy__field {
display: flex;
flex-direction: column;
gap: $sp-1;
}
.ctrlcandy__label {
color: rgba($candy-berry, .78);
font-weight: 600; font-size: clamp(10px, 2.6vw, 12px); line-height: 1;
}
.ctrlcandy__input {
box-sizing: border-box;
width: 100%;
border: 0;
border-radius: $r-control;
background: $stage-paper;
color: $candy-berry;
padding: $sp-3 $sp-4;
font-weight: 500; font-size: clamp(12px, 3vw, 14px); line-height: 1;
box-shadow: 0 6px 14px rgba($candy-mint, .8);
// 데모: 포커스를 받은 것처럼 민트 링이 부드럽게 퍼졌다 줄어들기를 반복
animation: ringPulse $duration $easing infinite;
}
.ctrlcandy__input::placeholder {
color: rgba($candy-berry, .45);
}
// 데모: 버튼은 몸과 그림자가 함께 눌렸다 튕기고, 입력창은 민트 링이 숨쉰다
@keyframes candyPress {
0%, 55%, 100% { transform: translateY(0) scaleY(1); box-shadow: 0 8px 18px rgba($candy-bubble, .65); }
65% { transform: translateY(4px) scaleY(.95); box-shadow: 0 2px 6px rgba($candy-bubble, .5); }
82% { transform: translateY(-3px); box-shadow: 0 12px 24px rgba($candy-bubble, .7); }
}
@keyframes ringPulse {
0%, 100% { box-shadow: 0 6px 14px rgba($candy-mint, .8); }
50% { box-shadow: 0 6px 14px rgba($candy-mint, .8), 0 0 0 5px rgba($candy-mint, .55); }
}
@media (prefers-reduced-motion: reduce) {
.ctrlcandy__btn, .ctrlcandy__input { animation: none !important; transform: none; }
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: rgb(91.8745098039%, 97.4745098039%, 95.0588235294%);
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
.ctrlcandy {
box-sizing: border-box;
width: clamp(260px, 84vw, 340px);
display: flex;
flex-direction: column;
gap: 16px;
}
.ctrlcandy__btn {
align-self: flex-start;
border: 0;
border-radius: 12px;
background: #ffffff;
color: #55395e;
padding: 12px 24px;
font-weight: 700;
font-size: clamp(12px, 3vw, 14px);
line-height: 1;
box-shadow: 0 8px 18px rgba(255, 185, 207, 0.65);
animation: candyPress 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}
.ctrlcandy__btn:focus-visible {
outline: 3px solid #55395e;
outline-offset: 2px;
}
.ctrlcandy__field {
display: flex;
flex-direction: column;
gap: 4px;
}
.ctrlcandy__label {
color: rgba(85, 57, 94, 0.78);
font-weight: 600;
font-size: clamp(10px, 2.6vw, 12px);
line-height: 1;
}
.ctrlcandy__input {
box-sizing: border-box;
width: 100%;
border: 0;
border-radius: 12px;
background: #ffffff;
color: #55395e;
padding: 12px 16px;
font-weight: 500;
font-size: clamp(12px, 3vw, 14px);
line-height: 1;
box-shadow: 0 6px 14px rgba(181, 232, 210, 0.8);
animation: ringPulse 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}
.ctrlcandy__input::placeholder {
color: rgba(85, 57, 94, 0.45);
}
@keyframes candyPress {
0%, 55%, 100% {
transform: translateY(0) scaleY(1);
box-shadow: 0 8px 18px rgba(255, 185, 207, 0.65);
}
65% {
transform: translateY(4px) scaleY(0.95);
box-shadow: 0 2px 6px rgba(255, 185, 207, 0.5);
}
82% {
transform: translateY(-3px);
box-shadow: 0 12px 24px rgba(255, 185, 207, 0.7);
}
}
@keyframes ringPulse {
0%, 100% {
box-shadow: 0 6px 14px rgba(181, 232, 210, 0.8);
}
50% {
box-shadow: 0 6px 14px rgba(181, 232, 210, 0.8), 0 0 0 5px rgba(181, 232, 210, 0.55);
}
}
@media (prefers-reduced-motion: reduce) {
.ctrlcandy__btn, .ctrlcandy__input {
animation: none !important;
transform: none;
}
}import type { CSSProperties } from "react";
import styles from "./ButtonsInputsCandy.module.scss";
export type ButtonsInputsCandyProps = {
buttonLabel?: string;
inputLabel?: string;
placeholder?: string;
/** 한 주기(기본 2000ms) */
duration?: number;
easing?: string;
color?: string;
};
type Vars = CSSProperties & { "--duration"?: string; "--easing"?: string; "--color"?: string };
export default function ButtonsInputsCandy({
buttonLabel = "저장하기",
inputLabel = "이메일",
placeholder = "이메일을 적어보세요",
duration = 2000,
easing = "cubic-bezier(.2,.8,.2,1)",
color = "#ffb9cf",
}: ButtonsInputsCandyProps) {
const vars: Vars = { "--duration": `${duration}ms`, "--easing": easing, "--color": color };
return (
<div className={styles.ctrlcandy} style={vars}>
<button type="button" className={styles.btn}>{buttonLabel}</button>
<label className={styles.field}>
<span className={styles.label}>{inputLabel}</span>
<input className={styles.input} type="email" placeholder={placeholder} />
</label>
</div>
);
}09 Squishy buttons & inputs — Measured area 4.149% · moving frames 14/23Original by GODRICH · SCSS and React ship in the zip · Pastel Website Design Kit: 9 Candy-Soft Sections
The post this demo lives in
Pastel Website Design Kit: 9 Candy-Soft SectionsPastel website design paints bubblegum pink, peach, lemon, mint, and lavender over cream — with candy-colored shadows in See all demos in this post


