Skip to content

Style Guide

This guide defines Birdpaper UI’s style tokens—typography, size, radius, shadow, spacing, motion, and more—so components stay visually consistent. Every token is exposed as a CSS variable and works with theme customization and dark mode.


Typography

Font Family

css
font-family: Inter, -apple-system, BlinkMacSystemFont, PingFang SC,
  Hiragino Sans GB, Noto Sans, Microsoft YaHei,
  Helvetica Neue, Helvetica, Arial, sans-serif;

Prefer the system font stack for the best rendering and load performance on each platform. Latin text prefers Inter; Chinese falls back to native platform fonts (PingFang SC / Noto Sans / Microsoft YaHei).

Font Size

The type scale has four levels, from helper text to page titles.

Helper text12px1.4Notes, timestamps, tags
Body / form14px1.6Paragraphs, forms, table content
Subtitle16px1.5Card titles, section headings
Title20px1.4Page titles, modal titles

Tip: Keep body text at 14px. Avoid mixing too many size levels on the same page.

Font Weight

Regular400Body and descriptive text
Medium500Headings and emphasis
Semibold600Page titles and critical information

Tip: Regular (400) is the default. Use Medium (500) for subtitles and emphasis, and Semibold (600) only for page-level titles and critical information—avoid overusing it.


Size

Components use a four-level size system that controls height, font size, horizontal padding, and radius. Form controls such as Button, Input, and Select all follow this scale.

Mini--bp-size-height-mini22px12px10px3px
Small--bp-size-height-small28px13px14px4px
Default--bp-size-height-default32px14px20px6px
Large--bp-size-height-large36px14px26px8px

Guideline: Use one size within a form region. Mini works well for compact table action columns; Large suits standalone primary actions.


Radius

Radius tokens track the size system so components of different sizes keep a consistent visual rhythm.

Small3pxMini-sized components
Default6pxDefault-sized components
Large8pxLarge components, cards, overlays
Full40pxPill buttons, capsule tags

Guideline: Use 8px for cards and overlays; use 40px for pill-shaped elements such as capsule tags. Don’t mix many radius values on the same page.


Shadow

A layered shadow scale expresses spatial elevation.

Light0 2px 8px rgba(0, 0, 0, 0.06)Card hover state
Default0 4px 12px rgba(0, 0, 0, 0.1)Popovers, tooltips
Deep0 4px 16px rgba(0, 0, 0, 0.15)Floating layers, dropdowns

Guideline: Use light shadows for hover, default for popovers, and deep for floating layers. Shadow depth should track z-index—higher layers get deeper shadows.


Spacing

Spacing follows a 4px grid so gaps stay predictable and reusable.

Tight4pxGap between icon and text
Small8pxInside form fields
Medium12pxList item spacing
Default16pxSection spacing
Large24pxPage region spacing

Guideline: Prefer preset spacing tokens over ad-hoc values. Tight (4px) is only for adjacent elements such as icon and text; use Large (24px) between page regions.


Border

Shared border rules keep inputs, dividers, and state feedback visually consistent.

Inputs, dividers1px solid var(--bp-gray-2)
Focus1px solid var(--bp-primary-6)
Error1px solid var(--bp-danger-6)
Disabled1px solid var(--bp-gray-3)

Guideline: Use semantic CSS variables for border color so dark mode adapts automatically. Focus borders match the brand color; use the danger border only when form validation fails.


Layering (z-index)

Manage stacking with CSS variables instead of hard-coded values to avoid z-index conflicts.

--z-index-base2000Trigger, Tooltip
--z-index-modal2000Modal dialogs
--z-index-drawer2001Drawer panels
--z-index-message2003Message toasts

Guideline: If your app needs a custom layer, offset from --z-index-base (for example calc(var(--z-index-base) + 10)) instead of using magic numbers.


Motion

Shared durations and easing curves keep interaction feedback feeling consistent.

Color / opacity0.2sease
Open / close0.25sease-in-out
Layout change0.3sease
Loading spin1.2slinear (infinite)

Guideline: Use ease-in-out for open/close motions and ease for fade-outs. Keep transitions at or under 0.3s so the UI stays responsive.