Skip to main content
Internal engineering reference. For the user-facing style guide, see the Documentation Style Guide.

Pipeline Architecture

The styles governance system follows the repo’s standard pipeline pattern: Config → Script → Data → Display → Enforcement.

Scripts Reference

Audit Validator

Path: tools/scripts/validators/styles/audit-styles.js Purpose: Scans MDX and JSX files for 6 categories of style violations. Usage:
Categories: Context awareness: Skips code blocks, inline code, frontmatter, and mermaid blocks. Uses relative paths for exclude matching (safe in worktrees). Report output: workspace/reports/styles/styles-audit-report.json

Remediator

Path: tools/scripts/remediators/styles/remediate-styles.js Purpose: Safe, deterministic auto-fixes for style violations. Idempotent (running twice produces zero changes). Usage:
What it fixes (14 capabilities): Verification (--verify flag):
When --verify is passed with --write:
  1. After applying fixes, re-runs audit on modified files only
  2. Checks MDX files for parse issues (conflict markers, missing import blank lines)
  3. If any check fails, reverts ALL changes and exits non-zero
Safety:
  • Reverse-offset replacement (processes matches from end to start)
  • Never modifies code blocks, inline code, JSX comments, frontmatter
  • Skips exempt files (MermaidColours.jsx, style.css)
  • Skips non-layout properties for spacing (fontSize, borderRadius, width, height, etc.)
  • Standard mermaid signature check prevents re-processing compliant inits
  • Component migration finds matching closing tags via depth-aware parser
  • Dynamic replacement extracts icon names and text content from regex captures
Self-documenting: Run node tools/scripts/generators/styles/generate-styles-docs.js --check to verify documentation matches source code.

Data Pipelines

CoinGecko Exchanges

Script: operations/scripts/integrators/maintenance/data-feeds/fetch-exchanges-data.js Workflow: .github/workflows/update-exchanges-data.yml Output: snippets/data/exchanges/exchangesData.jsx Schedule: Weekly Monday 03:00 UTC API: CoinGecko /coins/livepeer/tickers (no API key required for free tier)

go-livepeer Configuration Flags

Script: operations/scripts/integrators/maintenance/data-feeds/fetch-config-flags.js Workflow: .github/workflows/update-config-flags.yml Output: snippets/data/gateways/configFlagsData.jsx Schedule: Weekly Monday 04:00 UTC Source: Parses cmd/livepeer/starter/flags.go from GitHub raw content Both scripts support --dry-run mode.

Component Authoring Checklist (Styles)

When creating or modifying components, verify:
  • Uses var(--lp-color-*) tokens, not legacy aliases or hardcoded hex
  • Accepts style={} and className="" props with merge pattern ({...defaultStyle, ...style})
  • Uses var(--lp-spacing-*) tokens for standard spacing (0.25rem–2rem)
  • No outline: none — use :focus-visible in a scoped <style> block if custom focus needed
  • Dark mode works via CSS variables (no JS theme detection)
  • data-docs-* attribute if style.css needs to target the component
  • Responsive: uses Tailwind responsive classes or <style> media queries
  • Tested at 375px, 768px, and 1024px viewports

Mintlify CLI Tools

Baseline Metrics

Remaining 74: 5 irreducible inline styles (single-prop CSS vars in composable files without import scope) + 69 mermaid variant colour schemes (non-standard palettes, deferred for individual review).
Last modified on May 22, 2026