Page is under construction.
Check the github issues for ways to contribute! Or provide your feedback in this quick form
Check the github issues for ways to contribute! Or provide your feedback in this quick form
Documentation Style Guide
This guide covers styling conventions, Mintlify-specific gotchas, and best practices for contributing to the Livepeer documentation.Production-Grade Styling for Mintlify
Framework: CSS Custom Properties (CSS Variables)
Mintlify uses CSS Custom Properties (CSS Variables) as the production-grade styling framework. This is the official, supported approach for theming in Mintlify documentation.Theme Architecture
The documentation uses CSS Custom Properties defined instyle.css at the repository root. This is the ONLY production-grade approach for styling Mintlify documentation.
DO NOT USE:
- ❌ JavaScript theme objects (ThemeData, themeStyles.jsx) - DEPRECATED
- ❌ Inline style objects with hardcoded colors
- ❌ JavaScript-based theme switching
- ✅ CSS Custom Properties (
--variable-name) - ✅ Global CSS variables in
style.css - ✅ Mintlify theme configuration in
docs.json
Color System
All theme colors are defined as CSS Custom Properties instyle.css:
| Variable | Light Mode | Dark Mode | Usage |
|---|---|---|---|
--accent | #3CB540 (Jade Green) | #2b9a66 (Dark Jade) | Highlights, icons, links |
--accent-dark | #18794E | #18794E | Step icons, emphasis |
--hero-text | #181C18 | #E0E4E0 | Headings, titles |
--text | #717571 | #A0A4A0 | Body text |
--muted-text | #9ca3af | #6b7280 | Secondary text |
--background | #ffffff | #0d0d0d | Page background |
--card-background | #f9fafb | #1a1a1a | Cards, containers |
--border | #e5e7eb | #333333 | Borders, dividers |
--button-text | #ffffff | #ffffff | Button text |
Using CSS Custom Properties
Inline Styles (Recommended)
Component-Level CSS
Global CSS in style.css
How Theme Switching Works
Mintlify automatically adds a.dark class to the <html> element when dark mode is active. CSS variables automatically switch based on the theme:
Color Rules
| Use Case | Approach |
|---|---|
| Brand colors (green) | Use --accent or --accent-dark |
| Headings | Use --hero-text |
| Body text | Use --text |
| Secondary text | Use --muted-text |
| Backgrounds | Use --background or --card-background |
| Borders | Use --border |
| Semantic colors (error, warning, success) | Keep fixed (don’t theme) |
| White text on green headers | Keep fixed as #fff |
Deprecated Approaches
DO NOT USE THESE:-
ThemeData Object -
snippets/styles/themeStyles.jsxis DEPRECATED -
Hardcoded Colors - Never hardcode hex values that should adapt to theme
- JavaScript Theme Switching - Not needed, CSS handles this automatically
What NOT to Do
- ❌ Don’t import or use
ThemeDatafromthemeStyles.jsx - ❌ Don’t hardcode hex colors that should adapt to theme
- ❌ Don’t use generic grays without checking theme compatibility
- ❌ Don’t make semantic colors (trust scores, error states) theme-dependent
- ❌ Don’t override white text on intentionally colored backgrounds
- ❌ Don’t create custom JavaScript theme objects
Styling Framework Architecture
The Livepeer documentation uses a three-layer styling framework designed to work within Mintlify’s constraints while maintaining consistency and maintainability.Framework Layers
Layer 1: Global CSS (style.css)
Purpose: Theme variables and framework-level overrides only
What belongs here:
- ✅ CSS Custom Properties (theme variables)
- ✅ Mintlify component overrides (navigation, footer, etc.)
- ✅ Frame mode container classes
- ✅ Utility classes for patterns used 5+ times across pages
- ❌ Page-specific styles
- ❌ Component-specific styles (belong in JSX)
- ❌ One-off styling needs
Layer 2: JSX Components (snippets/components/**/*.jsx)
Purpose: Self-contained components with internal styling
Rules:
- ✅ Use CSS Custom Properties (
var(--accent),var(--text), etc.) - ✅ Styles must be within the component file
- ✅ Use
<style>tags for complex styling (pseudo-classes, media queries) - ✅ Use inline style objects for simple styling
- ❌ Import external CSS files
- ❌ Hardcode theme colors (use CSS variables)
- ❌ Use
classNamewithout corresponding<style>tag
Layer 3: MDX Files (v2/pages/**/*.mdx)
Purpose: Content only - ZERO inline styles
Rules:
- ✅ Use component primitives for all styling needs
- ✅ Use Mintlify global components (
Card,Tabs,Steps, etc.) - ✅ Import custom components from
/snippets/components/ - ❌ NO inline
style={{}}attributes - ❌ NO hardcoded colors
- ❌ NO custom
classNameattributes
Decision Tree: Where Does This Style Go?
- Is it a theme color? → Add to
style.cssas CSS Custom Property - Is it used in a component? → Put in JSX component file (inline or
<style>tag) - Is it needed in MDX? → Create/use a component primitive
- Is it used 5+ times globally? → Add utility class to
style.css - Is it page-specific? → Create a component primitive (don’t put in
style.css)
Component Primitives Library
For common styling needs in MDX files, use component primitives from/snippets/components/primitives/:
- Layout:
FlexContainer,GridContainer,Spacer - Tables:
StyledTable,TableRow,TableCell - Containers:
BorderedBox,CenteredContainer,FullWidthContainer
Typography
Headings
Use standard Markdown headings (#, ##, ###, etc.) for most content. Mintlify automatically styles these.
For frame mode pages, use custom heading components:
Text Styling
- Use bold (
**text**) for emphasis - Use italic (
*text*) sparingly - Use
code(backticks) for inline code - Use code blocks for multi-line code
Spacing & Layout
Consistent Spacing
- Use consistent spacing between sections
- Group related content together
- Use dividers (
<CustomDivider />) to separate major sections
Page Layouts
- Portals - Use CardGroups for key entry points
- Guides - Use Steps for sequential instructions
- References - Use Tables or Accordions for organized data
- Quickstarts - Use Tabs for different paths (OS, on-chain/off-chain)
Component Usage
When to Use Components
- Tabs - Separate content by context (OS, workflow type, user type)
- Views - Show different content based on operating system or user path
- Steps - Sequential instructions for processes
- Card Groups - Visual groupings for portals, hubs, and related content
- Accordions - Expandable sections for detailed information
- Callouts - Important notes, tips, warnings, and information boxes
Callout Types
<Info>- General information and tips<Tip>- Helpful suggestions<Warning>- Important cautions<Danger>- Critical warnings<Note>- Additional context
Prefer Custom Components for Links and Navigation
Preference: Use custom components for links, cards, quotes, and other visually appealing elements instead of plain Mintlify links. Why: Custom components provide better visual design, consistent theming, enhanced user experience, and better integration with the Livepeer documentation design system. Custom Components to Use:- Links: Use
<GotoLink>and<GotoCard>instead of plain markdown links or Mintlify<Card>withhref - Quotes: Use
<Quote>and<FrameQuote>instead of plain blockquotes - Cards: Use
<GotoCard>for navigation cards with better styling - Callouts: Use
<CustomCallout>and<TipWithArrow>for enhanced visual callouts - External Links: Use
<DoubleIconLink>for external links (GitHub, etc.)
- Inline links within paragraphs (markdown links are fine)
- Links in code examples or technical references
- Links that don’t need visual emphasis
Mintlify Overrides & Best Practices
Our styling framework intentionally overrides some Mintlify default recommendations to work better within Mintlify’s constraints and maintain consistency.Override: “Use Tailwind classes”
Mintlify suggests: Use Tailwind utility classesOur approach: ❌ Don’t use Tailwind - use component primitives
Reason: Tailwind classes in MDX create maintenance burden and reduce semantic meaning. Component primitives are more maintainable and self-documenting. Example:
Override: “Inline styles are fine for quick fixes”
Mintlify suggests: Inline styles acceptable in MDXOur approach: ❌ No inline styles in MDX, only in JSX components
Reason: Consistency and maintainability. Inline styles in MDX make it harder to maintain theme consistency and create visual inconsistencies. Example:
Override: “Use global CSS for everything”
Mintlify suggests: Put all styles instyle.cssOur approach: ✅ Only theme variables and framework overrides in
style.cssReason: Mintlify only allows one global CSS file. Putting everything there makes it unmaintainable. Component-specific styles belong in JSX components. What goes in
style.css:
- ✅ Theme variables (CSS Custom Properties)
- ✅ Mintlify component overrides (nav, footer)
- ✅ Frame mode container classes
- ✅ Utility classes used 5+ times globally
style.css:
- ❌ Component-specific styles (put in JSX)
- ❌ Page-specific styles (create component primitives)
- ❌ One-off styling needs (create component primitives)
Override: “Component styles can be external”
Mintlify suggests: External CSS files for componentsOur approach: ❌ Styles must be within JSX component files
Reason: Mintlify doesn’t support CSS imports in components reliably. Inline styles and
<style> tags within components work consistently.
Pattern:
Mintlify Gotchas & Limitations
Critical Limitations
1. Import Paths Must Be Absolute
2. File Extensions Required
3. Cannot Import into Component Files
You CANNOT import data or other components into a JSX component file:4. JSX Files Cannot Import Other JSX Files
Mintlify does not allow JSX files to import other JSX files. This is why we use MDX-in-MDX patterns instead.5. MDX Scope Inheritance
When importing MDX files into other MDX files:- ✅ Child MDX inherits parent scope for props - Parent’s imports work when used as component props
- ❌ Child MDX may NOT inherit parent scope for direct JSX interpolation - Variables used as
{variable}may need re-import - ✅ Child can import its own variables - If the child needs something the parent doesn’t import
6. React Hooks Are Global
Mintlify provides React hooks globally - no imports needed:7. Icon Component Behavior
CRITICAL: Mintlify’s<Icon> component renders custom icons as <img> elements, NOT inline SVG.
8. Mintlify Global Components
These components are available globally - do not import them:React,Frame,Card,Icon,Steps,Step,Tabs,TabNote,Warning,Info,Tip,DangerAccordion,Columns,CardGroup,CodeBlock,Expandable,Badge,Tooltip
9. JSX Comments Don’t Prevent MDX Parsing
CRITICAL: JSX comments ({/* */}) in MDX files do NOT prevent MDX from parsing the content inside them. MDX will still try to evaluate JSX components and expressions within comments.
- Remove the entire section from the MDX file
- Add a comment explaining why it was removed
- Document in
docs/PLAN/errors/component-bugs.mdif it’s a component bug - Do NOT use JSX comments to “comment out” component usage
9. Frame Mode Limitations
Frame mode (mode: frame in frontmatter) removes all default Mintlify styling. When using frame mode:
- Default markdown headings may not render correctly
- Use custom heading components from
frameMode.jsx - All styling must be custom
- Mintlify components still work but lose default styles
- Keep responsive layout primitives in
style.css(.frame-mode-container,.frame-mode-hero-full, frame pagination) - Keep portal/page-specific structure in shared JSX components (for example
/snippets/components/domain/SHARED/Portals.jsx) - Do not use fixed breakout constants directly in component styles (for example hardcoded
96px,20px, or fixed%widths) - Prefer CSS variables + breakpoints for frame mode layout, and CSS custom properties (
var(--...)) for theming
Import Patterns
Correct Pattern: Import in MDX, Use in Component
Git Workflow
Branch Management
ALWAYS create a new branch fromdocs-v2-preview:
docs-v2-preview(default source of truth)mainormaster- Any branch another agent is using
docs-plan/XX-task-name where XX is the task number.
Best Practices
Code Organization
-
Keep components in
/snippets/components/organized by purpose:primitives/- Basic UI elementslayout/- Layout componentsdisplay/- Media and embedscontent/- Content displayintegrations/- External servicesdomain/- Domain-specific components
-
Keep data in
/snippets/data/for reusable code strings and variables -
Use
/snippets/pages/for modular MDX content that’s imported into main pages
Writing Style
- Be Clear and Concise - Write for users with varying technical backgrounds
- Use Examples - Include code examples and real-world scenarios
- Provide Context - Explain why, not just how
- Link Related Content - Help users discover related information
- Test Both Themes - Verify content looks good in both light and dark modes
Component Guidelines
- Use CSS Custom Properties ONLY - Never use ThemeData or hardcode colors
- Reference Variables from style.css - All theme colors are in
style.cssas CSS variables - Test Components - Ensure components render correctly
- Handle Children Properly - Always handle children as arrays when mapping
- Document Props - Include JSDoc comments for component props
- Provide Examples - Add examples in the
examples/folder for each component
Component Immutability
CRITICAL RULE: Components insnippets/components/ are IMMUTABLE
NEVER modify files in snippets/components/ - These components are used across many pages. Any changes could break existing functionality.
Allowed:
- Creating new components
- Modifying MDX files that use components
- Fixing MDX imports and usage
- Modifying existing component files
- Changing component function signatures
- Adding/removing component exports
- Changing component logic
- Comment out the component section in the MDX file where it’s used
- Verify the page renders without that section
- If page renders correctly → Component is the issue
- Document the error in
docs/PLAN/errors/component-bugs.mdwith:- Component name and file path
- Error message from console
- Page where error occurs
- Verification that commenting out fixes the page
- Recommendation for component fix (but do not implement)
File Naming
- Use kebab-case for file names:
my-component.mdx - Use PascalCase for component names:
MyComponent - Use descriptive names that indicate purpose
Testing Checklist
Before submitting documentation:- Content renders correctly in dark mode (default)
- Content renders correctly in light mode
- All links work and point to correct pages
- Code examples are accurate and tested
- Images load and have appropriate alt text
- Components use theme-aware colors
- No hardcoded colors that should adapt to theme
- Components render correctly
- No console errors in browser dev tools
- MDX syntax errors checked and fixed
- All pages verified in headless browser (see Verification Requirements below)
Verification Requirements
MDX Syntax Checking
Before declaring work complete, check MDX files:- Use linting tools to check all modified MDX files
- Check for:
- Unclosed JSX tags
- Invalid import syntax
- Missing frontmatter
- Syntax errors
- Fix any MDX errors before considering work complete
Headless Browser Verification
Before declaring work complete, verify each page in a headless browser:- Use Puppeteer or similar tool to load each page
- Wait for network idle
- Check for console errors (filtering out test script artifacts)
- Verify content length > 500 chars
- Verify H1 element exists
- Check for 404 errors
- Ignore “require is not defined” from test scripts
- Ignore “puppeteer” related errors
- Ignore “fs has already been declared” errors
- Focus on real component errors
- Page URL
- Content length
- H1 text
- List of real console errors (if any)
- Status: ✅ OK or ❌ ERRORS
URL Structure Verification
Mintlify pages use full path structure:- Page path in
docs.json:v2/pages/07_resources/documentation-guide/component-library/primitives - URL:
/v2/pages/07_resources/documentation-guide/component-library/primitives
Mintlify Theme Configuration
Mintlify also supports theme configuration indocs.json:
style.css.
Pre-Commit Hooks
This repository uses Git pre-commit hooks to automatically enforce the style guide rules. These hooks are mandatory and will block commits that violate the style guide.What Gets Checked
The pre-commit hooks automatically check for:- Deprecated
ThemeDataUsage - Blocks imports ofThemeDatafromsnippets/styles/themeStyles.jsx - Hardcoded Theme Colors - Warns about direct hex color codes that should use CSS Custom Properties
- Relative Snippets Imports - Flags imports from
snippets/that use relative paths instead of absolute paths - Unnecessary Imports - Warns about explicit imports for Mintlify’s globally available components and React hooks
- Syntax Validation - Checks MDX, JSON, Shell, and JavaScript syntax
- Browser Validation - Tests that MDX pages actually render correctly in a headless browser (if
mint devis running)
Installation
MANDATORY: You must install the hooks before making any commits:What Happens on Violation
If you attempt to commit code that violates the style guide:- The commit is blocked
- You receive a detailed error message listing all violations
- You must fix the violations before committing again
Example Error Output
Browser Validation
The hooks include headless browser validation that tests MDX files actually render in the browser. This catches:- Runtime errors in components
- Failed imports
- Console errors
- Render failures
mint dev to be running. If it’s not running, the check is skipped (doesn’t block commit).
Comprehensive Test Suite
The repository includes a comprehensive test suite that validates all style guide rules and more:Running Tests
What Gets Tested
Style Guide Tests (test:style):
- CSS Custom Properties usage (no ThemeData, no hardcoded colors)
- No inline styles in MDX files
- No Tailwind classes
- Absolute import paths
- File naming conventions
- Component immutability warnings
test:mdx):
- Frontmatter validation
- Unclosed JSX tags
- Invalid import syntax
- MDX scope inheritance issues
test:spell):
- UK English spelling validation
- Custom dictionary for technical terms (Livepeer, Arbitrum, etc.)
- Excludes code blocks and frontmatter
test:quality):
- Image alt text presence
- Frontmatter completeness
- Internal link validation
- SEO metadata validation
test:browser):
- Page rendering in headless browser
- Console error detection
- Theme testing (light/dark)
- Content validation (H1, content length)
Resources
- Component Library - Complete component reference
- Mintlify Documentation - Official Mintlify docs
- Mintlify Behavior Guide - Comprehensive Mintlify gotchas
- Git Hooks Documentation - Complete pre-commit hook documentation
style.css- Global CSS Custom Properties for theming
Next Steps
- Review the Component Library for available components
- Check Snippets Inventory for all available snippets
- Read Mintlify Behavior Guide for detailed gotchas
- See Contribute to the Docs for contribution guidelines
- Install Git hooks:
./.githooks/install.sh