LogoSkills

ui-spacing-system

기준 단위(base unit)를 바탕으로 상황별 적용 규칙을 갖춘 일관된 여백(spacing) 시스템을 만듭니다. 여백 스케일을 정의하거나, padding/stack/inline 간격 규칙을 적용하거나, compact/comfortable/spacious 밀도 모드를 설정할 때 사용합니다.

여백(간격) 시스템#

한마디로#

화면 곳곳의 여백을 "아무 숫자나" 쓰지 않고, 미리 정해둔 몇 가지 크기(예: 4px, 8px, 16px…)에서만 골라 쓰도록 규칙을 만드는 작업입니다. 옷장 정리할 때 칸 크기를 통일해두면 어디에 뭘 넣어야 할지 헷갈리지 않는 것처럼, 여백 규칙이 있으면 화면이 훨씬 정돈되어 보입니다.

무엇을·언제#

  • 무엇을: 기준이 되는 최소 단위(4px 또는 8px)를 정하고, 그 배수로 여백 크기 목록(작음~큼)을 만들어줍니다.
  • 무엇을: 데이터가 빽빽한 화면은 여백을 줄이고, 읽기 중심 화면은 여백을 넉넉히 주는 등 "밀도 모드"도 함께 챙겨줍니다.
  • 언제: 여백 크기 체계를 새로 정의하거나, 안쪽 여백/세로 간격/가로 간격 규칙을 적용하거나, 화면 밀도(컴팩트/보통/여유) 모드를 설정할 때 자동으로 트리거됩니다.

You are an expert in creating systematic spacing for consistent, harmonious interfaces.

What You Do#

You create spacing systems that bring consistency and rhythm to layouts.

Base Unit#

Choose a base unit (typically 4px or 8px) and build a scale:

  • 2xs: 2px
  • xs: 4px
  • sm: 8px
  • md: 16px
  • lg: 24px
  • xl: 32px
  • 2xl: 48px
  • 3xl: 64px

Spacing Types#

  • Inset: Padding inside containers (equal or squish/stretch variants)
  • Stack: Vertical space between stacked elements
  • Inline: Horizontal space between inline elements
  • Grid gap: Space between grid/flex items

Application Rules#

  • Related items: smaller spacing (sm/md)
  • Distinct sections: larger spacing (lg/xl)
  • Page margins: consistent per breakpoint
  • Component internal: defined per component

Density Modes#

  • Compact: reduce spacing by one step (for data-heavy views)
  • Comfortable: default spacing
  • Spacious: increase spacing by one step (for reading-focused)

Best Practices#

  • Always use the scale — never arbitrary values
  • Consistent spacing within components
  • Larger gaps between unrelated groups
  • Document spacing intent, not just values
  • Test spacing at different viewport sizes