← tasteMarkdown

Layout and spacing

Condensed from: Taste Skill (https://github.com/Leonxlnx/taste-skill), Open Design (https://github.com/nexu-io/open-design), UI UX Pro Max (https://github.com/nextlevelbuilder/ui-ux-pro-max-skill), Hallmark (https://github.com/Nutlope/hallmark)

Spacing scale (4px base)

:root{
  --space-3xs:2px; --space-2xs:4px; --space-xs:8px; --space-sm:12px; --space-md:16px;
  --space-lg:24px; --space-xl:40px; --space-2xl:64px; --space-3xl:96px; --space-4xl:144px;
}

Section rhythm (marketing pages)

Viewport Gap between sections (last line to first line)
Desktop ≥60rem 120-240px (study median ~240)
Tablet 40-60rem 80-120px
Phone <40rem 56-112px

Frame and margins

Grid

.grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));
  column-gap:clamp(.75rem,1.4vw,1.5rem);}

Composition

Density by product type

Product Body Row pitch Card padding Gaps
Marketing / brand 17-19px n/a 24-40px sections 120-240px
Editorial 17-20px n/a n/a rhythm alternates compression/release
App, sparse (6-25 data points: homes, settings) 14-16px 56-92px 20-24px card gap 16-24
App, medium (25-50: analytics, lists) 14px 44-56px 16-24px card gap 16
App, dense (~120: monitoring, research) 13px list 28px, table 42px 32px 64px between bands, generous outer gutters

App shell numbers

Radius

Layering

z-index scale: base 1, raised 10, dropdown 100, sticky 200, sticky-nav 300, modal 400, toast 500, tooltip 600. Use overflow-x: clip (not hidden) so sticky keeps working.

Container queries

Use media queries for page layout; container queries for components whose layout depends on their own box (cards, widgets, sidebars, settings rows).

.card-slot{container-type:inline-size;}
.card{display:grid;gap:12px;}
@container (min-width:28rem){
  .card{grid-template-columns:120px 1fr;gap:16px;}
  .card h3{font-size:clamp(1rem,.8rem + 2cqi,1.375rem);}
}

Read by your agent through get_guide("layout-spacing") in the taste MCP.