Design Tokens - Trystpilot.xyz
Design Tokens — Trystpilot.xyz
Status: Awaiting
PENPOT_ACCESS_TOKENsecret Tool:@zcubekr/penpot-mcp-server(76+ tools) Approach: Token-first — no hard-coded CSS values in components Last updated: 2026-02-28
Philosophy
All CSS values in Trystpilot components must reference design tokens. Hard-coded
values (e.g. color: #00b67a, padding: 16px) are only permitted:
- As the token definition itself in the token file
- In inline styles when scoped to a single dynamic value that cannot be expressed as a token (e.g. a user-provided avatar color)
- Never in component-level Tailwind classes (use token-backed Tailwind config)
Token Architecture (Planned)
Tier 1 — Primitive Tokens
Raw values. Never used directly in components.
color.green.50 → #f0fdf4color.green.100 → #dcfce7...color.green.500 → #00b67a ← brand primarycolor.green.600 → #00a36ccolor.green.700 → #008f5e
color.neutral.0 → #ffffffcolor.neutral.50 → #f9fafbcolor.neutral.100 → #f3f4f6...color.neutral.900 → #111827
color.red.500 → #ef4444color.amber.500 → #f59e0bcolor.blue.500 → #3b82f6
space.1 → 4pxspace.2 → 8pxspace.3 → 12pxspace.4 → 16pxspace.5 → 20pxspace.6 → 24pxspace.8 → 32pxspace.10 → 40pxspace.12 → 48pxspace.16 → 64px
radius.sm → 4pxradius.md → 8pxradius.lg → 12pxradius.xl → 16pxradius.2xl → 24pxradius.full → 9999px
font.size.xs → 12pxfont.size.sm → 14pxfont.size.base → 16pxfont.size.lg → 18pxfont.size.xl → 20pxfont.size.2xl → 24pxfont.size.3xl → 30pxfont.size.4xl → 36px
font.weight.regular → 400font.weight.medium → 500font.weight.semibold → 600font.weight.bold → 700font.weight.extrabold → 800
line.height.tight → 1.25line.height.snug → 1.375line.height.normal → 1.5line.height.relaxed → 1.625
duration.fast → 150msduration.normal → 300msduration.slow → 500msduration.slower → 1000ms
easing.standard → cubic-bezier(0.4, 0, 0.2, 1)easing.decelerate → cubic-bezier(0, 0, 0.2, 1)easing.accelerate → cubic-bezier(0.4, 0, 1, 1)easing.spring → cubic-bezier(0.34, 1.56, 0.64, 1)
shadow.sm → 0 1px 2px rgba(0,0,0,0.05)shadow.md → 0 4px 6px rgba(0,0,0,0.07)shadow.lg → 0 10px 15px rgba(0,0,0,0.10)shadow.xl → 0 20px 25px rgba(0,0,0,0.10)
z.base → 0z.raised → 10z.dropdown → 100z.sticky → 200z.overlay → 300z.modal → 400z.toast → 500z.tooltip → 600Tier 2 — Semantic Tokens
Named by intent. Used in components.
color.brand.primary → color.green.500color.brand.primary.hover → color.green.600color.brand.primary.active → color.green.700
color.background.default → color.neutral.0color.background.subtle → color.neutral.50color.background.muted → color.neutral.100
color.text.primary → color.neutral.900color.text.secondary → color.neutral.600color.text.muted → color.neutral.400color.text.inverse → color.neutral.0color.text.brand → color.green.500
color.border.default → color.neutral.200color.border.focus → color.green.500color.border.error → color.red.500
color.rating.excellent → color.green.500 (4.5–5.0)color.rating.great → color.green.400 (4.0–4.4)color.rating.average → color.amber.400 (3.0–3.9)color.rating.poor → color.amber.500 (2.0–2.9)color.rating.bad → color.red.500 (1.0–1.9)
color.status.pending → color.amber.500color.status.approved → color.green.500color.status.rejected → color.red.500color.status.quarantine → #7c3aed (purple)color.status.suspended → color.red.600color.status.claimed → color.blue.500
space.component.xs → space.2 (8px)space.component.sm → space.3 (12px)space.component.md → space.4 (16px)space.component.lg → space.6 (24px)space.component.xl → space.8 (32px)
space.layout.sm → space.4 (16px)space.layout.md → space.8 (32px)space.layout.lg → space.12 (48px)space.layout.xl → space.16 (64px)
radius.button → radius.fullradius.card → radius.xlradius.input → radius.mdradius.badge → radius.fullradius.modal → radius.2xl
shadow.card → shadow.smshadow.card.hover → shadow.mdshadow.modal → shadow.xlshadow.dropdown → shadow.lgTier 3 — Component Tokens
Scoped to a specific component.
button.primary.background → color.brand.primarybutton.primary.background.hover → color.brand.primary.hoverbutton.primary.text → color.text.inversebutton.primary.radius → radius.buttonbutton.primary.padding.x → space.component.lgbutton.primary.padding.y → space.component.smbutton.primary.font.weight → font.weight.semiboldbutton.primary.font.size → font.size.sm
button.secondary.background → color.background.defaultbutton.secondary.border → color.border.defaultbutton.secondary.text → color.text.primary
input.background → color.background.defaultinput.border → color.border.defaultinput.border.focus → color.border.focusinput.border.error → color.border.errorinput.radius → radius.inputinput.padding.x → space.component.mdinput.padding.y → space.component.sminput.font.size → font.size.sminput.text → color.text.primaryinput.placeholder → color.text.muted
card.background → color.background.defaultcard.border → color.border.defaultcard.radius → radius.cardcard.shadow → shadow.cardcard.shadow.hover → shadow.card.hovercard.padding → space.component.lg
star.filled → color.brand.primarystar.empty → color.neutral.200star.size.sm → 16pxstar.size.md → 20pxstar.size.lg → 28pxstar.size.xl → 40px
rating.bar.fill → color.brand.primaryrating.bar.track → color.neutral.100rating.bar.height → 8pxrating.bar.radius → radius.full
header.background → #1C1B1Bheader.text → color.text.inverseheader.height → 64px
footer.background → #1C1B1Bfooter.text → color.neutral.300
badge.padding.x → space.component.smbadge.padding.y → space.1badge.font.size → font.size.xsbadge.font.weight → font.weight.semiboldbadge.radius → radius.badge
toast.background → color.neutral.900toast.text → color.text.inversetoast.radius → radius.lgtoast.shadow → shadow.xl
modal.overlay → rgba(0, 0, 0, 0.5)modal.background → color.background.defaultmodal.radius → radius.modalmodal.shadow → shadow.xlmodal.padding → space.component.xlPenpot Integration
When ready:
# Install headless MCP server (REST API, no browser needed)npm install -g @zcubekr/penpot-mcp-server
# Start with your tokenPENPOT_ACCESS_TOKEN=<your-token> npx @zcubekr/penpot-mcp-server
# Add to Claude Code MCPclaude mcp add penpot-mcp -t http http://localhost:3000/mcpTools to call once connected:
create_project— “Trystpilot Design System”create_file— “Design Tokens”- Create color/typography/spacing token libraries
- Create component frames for each of the 70 components
- Export tokens as CSS custom properties
Secret needed:
- Name:
PENPOT_ACCESS_TOKEN - Source: Penpot → Settings → Access Tokens → Generate new token
- Optional:
PENPOT_API_URL(only if self-hosted, defaults tohttps://design.penpot.app)
CSS Custom Properties Output (Target)
Once Penpot tokens are generated, the output CSS should be:
/* Primitive tokens — :root */:root { /* Colors */ --color-green-500: #00b67a; --color-green-600: #00a36c; --color-neutral-0: #ffffff; --color-neutral-900: #111827; /* ... */
/* Semantic tokens */ --color-brand-primary: var(--color-green-500); --color-background-default: var(--color-neutral-0); --color-text-primary: var(--color-neutral-900); /* ... */
/* Spacing */ --space-1: 4px; --space-2: 8px; --space-4: 16px; /* ... */
/* Typography */ --font-size-sm: 14px; --font-size-base: 16px; --font-weight-semibold: 600; /* ... */
/* Component tokens */ --button-primary-bg: var(--color-brand-primary); --card-radius: var(--radius-xl); --star-filled: var(--color-brand-primary); /* ... */}No component should contain a hard-coded hex value, pixel value, or font size that is not referenced through this cascade.