Files
2nd/10_Wiki/Topics/Frontend/모바일 퍼스트(Mobile-First).md
T
koriweb d8a80f6272 chore(wiki): dangling 링크 canonical 정규화 (768파일/1200건)
이름만 다른(표기 변형) [[위키링크]]를 대상 문서의 canonical 제목으로 치환해
끊겼던 1,200개 링크를 연결. 제목/파일명 정규화 일치만 적용하고 별칭 매칭은
과병합 위험으로 제외(애매성 가드). 원본은 _link_reconcile_backup/ 에 백업.
도구: Datacollect/scripts/link_reconcile_apply.mjs

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 12:24:15 +09:00

5.3 KiB
Raw Blame History

id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
id title category status canonical_id aliases duplicate_of source_trust_level confidence_score verification_status tags raw_sources last_reinforced github_commit tech_stack
wiki-2026-0508-모바일-퍼스트-mobile-first 모바일 퍼스트(Mobile-First) 10_Wiki/Topics verified self
Mobile-First
모바일 우선
Mobile First Design
모바일 우선주의
none A 0.9 applied
frontend
responsive
css
mobile
design
2026-05-10 pending
language framework
css tailwind

모바일 퍼스트(Mobile-First)

매 한 줄

"매 작은 화면부터 design — 큰 화면 의 progressive enhancement". Luke Wroblewski (2009)가 제창, smallest viewport 기준 baseline CSS, larger breakpoint 의 min-width media query 의 progressive enhancement. 매 2026 의 mobile traffic 60%+ 환경의 default approach.

매 핵심

매 vs Desktop-first

Mobile-first Desktop-first
Baseline smallest viewport largest viewport
Media query min-width (up) max-width (down)
Mindset progressive enhancement graceful degradation
Default 2026 (legacy)

매 3원칙 (Wroblewski)

  1. Constraints force focus — small screen 매 essential content prioritize.
  2. Capabilities expand — touch, GPS, camera 의 leverage.
  3. Progressive enhancement — base 의 small + add 의 large.

매 응용

  1. Performance budget — mobile network slow → minimal payload first.
  2. Touch-first UX — 44×44px tap target (Apple HIG), 48×48dp (Material).
  3. Content hierarchy — most important top, fold concept abandoned.

💻 패턴

1. CSS mobile-first media query

/* base — mobile (< 640px implicit) */
.container {
  padding: 1rem;
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* tablet ≥ 640px */
@media (min-width: 640px) {
  .container { padding: 2rem; font-size: 16px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}

/* desktop ≥ 1024px */
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
}

2. Tailwind mobile-first utilities

// base 의 mobile, sm:/md:/lg: 의 enhancement
export function Card() {
  return (
    <div className="p-4 sm:p-6 lg:p-8">
      <h2 className="text-xl sm:text-2xl lg:text-3xl">Title</h2>
      <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
        <Item />
        <Item />
        <Item />
      </div>
    </div>
  );
}

3. Container queries (modern 2026)

.card-container {
  container-type: inline-size;
  container-name: card;
}

.card { display: flex; flex-direction: column; }

@container card (min-width: 400px) {
  .card { flex-direction: row; }
}

4. Responsive image (srcset)

<img
  src="hero-mobile.webp"
  srcset="hero-mobile.webp 480w, hero-tablet.webp 1024w, hero-desktop.webp 1920w"
  sizes="(min-width: 1024px) 1920px, (min-width: 640px) 1024px, 100vw"
  alt="Hero"
  loading="lazy"
/>

5. Viewport meta + safe area

<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
.app {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

6. Touch-friendly tap targets

button, a {
  min-width: 44px;
  min-height: 44px;
  padding: 0.75rem 1rem;
  /* Apple HIG: 44×44pt minimum */
}

7. Performance: critical CSS inline

<head>
  <style>/* critical above-fold CSS, < 14KB */</style>
  <link rel="preload" href="main.css" as="style" onload="this.rel='stylesheet'">
</head>

매 결정 기준

상황 Approach
New project 2026 mobile-first default.
Legacy desktop site gradual migration via container queries.
Internal tool (desktop only) desktop-first 도 OK 매 — but mobile-first 매 future-proof.
Component library container queries > viewport media queries (component reusability).

기본값: Tailwind mobile-first utilities + container queries 매 component-level.

🔗 Graph

🤖 LLM 활용

언제: 새 web project, e-commerce, content site, public-facing app, PWA. 언제 X: desktop-only enterprise tool 의 absolute desktop-first 가 효율적인 case (rare).

안티패턴

  • max-width 만 의 의존: 매 reverse mobile-first defeats purpose.
  • 고정 px 의 layout: rem/em/% 의 use.
  • Hover-only interactions: touch 의 hover 없음 — tap fallback 필수.
  • Fold obsession: 매 mobile 의 scrolling natural — fold 없음.
  • Tap target < 44px: thumb miss-tap.

🧪 검증 / 중복

🕓 Changelog

날짜 변경
2026-05-08 Phase 1
2026-05-10 Manual cleanup — canonical full content + 7 patterns (CSS, Tailwind, container queries)