xiaohongshu
xiaohongshu
maintaining-design-system
Design system maintenance for the site. Consult when modifying colours, typography, spacing, or themes. Covers token architecture, theme synchronisation, and CSS layers.
Full skill instructions
Design system maintenance for the site. Tokens, themes, typography, and CSS architecture.
British English throughout—code, comments, documentation, content.
Consult this skill when modifying design tokens, adding or updating themes, or changing typography scales. Reference SHIKI.md for syntax highlighting changes. Reference COMPONENT_DESIGN.md when creating new components or establishing component patterns.
The design system pays homage to Swiss Style—clean, grid-locked, typographically precise. Every spatial decision aligns to an 8px grid. This constraint breeds coherence.
Discipline over necessity. The project's scale doesn't demand this rigour; the practice itself is valuable. The source will be public—it should exemplify high-quality design decisions.
Design tokens live in src/styles/tokens/. Each file defines a category of CSS custom properties.
| File | Purpose |
|---|---|
colours.css | Theme colour definitions (semantic: --bg, --fg, --muted, --rule, --highlight, --emphasis) |
typography.css | Font families, size scale, line heights, letter spacing |
spacing.css | Margin/padding scale (8px base) |
sizing.css | Fixed dimensions |
layout.css | Safe area insets for mobile |
z-index.css | Stacking context scale |
transitions.css | Animation timing tokens |
borders.css | Border width scale |
index.css | Barrel import (order matters: colours first) |
Before applying tokens, check the relevant file in src/styles/tokens/ to verify available values and naming conventions. Token naming is not yet fully consistent across categories—some use pixel values, some use multipliers, some use semantic names. Don't assume a pattern; verify what exists.
All spacing, sizing, and line heights must resolve to multiples of 8px. When adding new tokens:
/* Values must align to 8px grid */
--example: 2rem; /* 32px, divisible by 8 ✓ */
--example: 1.875rem; /* 30px, breaks grid ✗ */
Layer order in src/styles/global.css:
@layer reset, tokens, base, components, utilities;
This cascade ensures:
src/styles/prose.css customises rendered MDX content, extending @tailwindcss/typography. It deliberately uses no @layer directive, placing it outside the layer system entirely.
Why: Tailwind utilities have high specificity within their layer. Prose styles need to override both the typography plugin defaults and base styles without fighting !important or specificity hacks. Unlayered styles win over layered styles regardless of specificity, giving prose full control over article typography.
Four themes: steel (default), purple, charcoal, teal. Theme class applied to <html>:
<html class="theme-steel">
Each theme defines six semantic colours using OKLCH colour space in src/styles/tokens/colours.css:
.theme-steel {
--bg: oklch(...);
--fg: oklch(...);
--muted: oklch(...);
--rule: oklch(...);
--highlight: oklch(...);
--emphasis: oklch(...);
}
Theme colours appear in multiple locations. When modifying any theme colour, update all affected files:
| Location | Purpose | Format |
|---|---|---|
src/styles/tokens/colours.css | Primary token definitions | OKLCH |
src/styles/components/shiki.css | Syntax highlighting overrides | OKLCH |
src/lib/theme/palette.ts | OG images, meta theme-color | Hex |
public/sf-[theme].ico | Per-theme favicon | Binary |
public/rss/styles.xsl | RSS feed styling (steel only) | Hex |
The Boids animation reads --rule dynamically at runtime—no manual sync required.
THEME_ORDER and label to THEME_LABELS in src/config/themes.tssrc/styles/tokens/colours.csssrc/styles/components/shiki.css (see SHIKI.md)THEME_COLOURS in src/lib/theme/palette.tspublic/sf-[theme].ico (manual step—requires image editor or favicon generator)Two systems handle typography: components for UI chrome, prose.css for rendered content.
Minor third ratio (1.2) with 8px-aligned line heights. Defined in src/styles/tokens/typography.css.
For UI elements—headers, navigation, metadata, labels. Located in src/components/typography/:
| Component | Purpose | Default Colour |
|---|---|---|
Overline | Uppercase labels, section headers | muted |
Caption | Dates, metadata, supporting text | muted |
Body | Taglines, descriptions | muted |
SheenText | Interactive text with hover animation | fg |
All accept tag, color, and spread attributes.
For rendered MDX content—blog posts, long-form writing. src/styles/prose.css extends @tailwindcss/typography and targets elements within .prose:
Modify prose.css when changing how blog content renders. Changes affect all existing posts.
See COMPONENT_DESIGN.md for component structure, composability principles, spacing philosophy, and accessibility baseline.
Some libraries don't support CSS custom properties, requiring hardcoded values.
src/lib/og/ generates Open Graph images. Satori renders JSX to SVG but doesn't support CSS variables. Colours must be hex values, defined in src/lib/theme/palette.ts:
export const THEME_COLOURS: Record<Theme, ThemeColours> = {
steel: {
bg: oklchToHex(...),
fg: oklchToHex(...),
muted: oklchToHex(...),
rule: oklchToHex(...),
},
// ... other themes
};
The OKLCH values here must match those in colours.css. When theme colours change, update both files.
Per-theme favicons (public/sf-*.ico) are static binary files. No programmatic generation—must be manually created when adding themes or changing brand colours.
public/rss/styles.xsl uses hardcoded hex values for browser rendering. Currently locked to steel theme. Optional to update when steel changes.
src/styles/tokens/*.css filepalette.ts if colour-relatednpm run check to verify no type errorssrc/styles/tokens/colours.csssrc/styles/components/shiki.css if affects syntax tokenssrc/lib/theme/palette.ts with hex equivalents/og/default.pngTHEME_ORDER and THEME_LABELS in src/config/themes.tssrc/styles/tokens/colours.csssrc/styles/components/shiki.csssrc/lib/theme/palette.tspublic/sf-[theme].ico (manual—use favicon generator tool)xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience