Skip to content

Design System Preview

Internal page for reviewing all visual components. Not linked in navigation.


Header Gradient

The header uses the Rebuy brand gradient across all pages:

Purple → Pink → Orange

Token: --rb-gradient-header


Typography Scale

The design system uses rem values calculated against Material's 20px root.

Token Value Computed Example
--rb-font-size-xs 0.6rem 12px Section headers, badges
--rb-font-size-sm 0.7rem 14px Secondary content, nav links
--rb-font-size-md 0.8rem 16px Body text (default)
--rb-font-size-lg 0.9rem 18px Lead paragraphs
--rb-font-size-xl 1rem 20px Subheadings

Headings

H1 Page Title

H2 Section Header

H3 Subsection

H4 Minor Section


Admonitions

Example Note

This is a note admonition. Used for general information and tips. Font size should be 14px (secondary content).

Example Warning

This is a warning admonition. Used for cautions and deprecation notices.

Tip

This is a tip admonition. Used for helpful hints.

Danger

This is a danger admonition. Used for critical warnings.

Info

This is an info admonition. Alternative to note.


Definition Lists (Query Parameters)

Used for API parameter documentation. Card-based layout with gray header and white body.

parameter_name · string · Default: value
Description of what this parameter does. Should be 14px font size to match admonitions and secondary content.
another_param · integer · Required
Another parameter description. The dt (header) should have a gray background with monospace font.
complex_param · object

This parameter has multiple paragraphs of description.

It can include additional context like this second paragraph.

And even code examples or lists if needed.


Method Badges

Inline badges for HTTP methods (pill-shaped, white text on solid background):

  • GET Success/Green
  • POST Info/Blue
  • PUT Neutral/Purple
  • PATCH Attention/Orange
  • DELETE Danger/Red

Tokens: --rb-badge-get-bg, --rb-badge-post-bg, etc. (darker in dark mode for WCAG contrast)


Endpoint Display

API endpoint pages use a styled display block with method badge, full URL, variable highlighting, and copy button. Generated automatically by the endpoint_display.py hook when pages contain ## METHOD /path headings.

All Method Variants

GET https://rebuyengine.com/api/v1/products/recommended
POST https://rebuyengine.com/api/v1/analytics/event
PUT https://rebuyengine.com/api/v1/settings/{id}
PATCH https://rebuyengine.com/api/v1/widgets/{widget_id}
DELETE https://rebuyengine.com/api/v1/rules/{ruleset_id}

Features

  • Method badge: Pill-shaped, color-coded by HTTP method
  • URL: Monospace font, muted color, no background
  • Variable params: {id} wrapped in subtle background (.endpoint-var)
  • Copy button: Appears on hover (always visible on mobile), shows checkmark on success

Code Blocks

JavaScript

// Example API call
const response = await fetch('https://rebuyengine.com/api/v1/products/recommended', {
  headers: {
    'Content-Type': 'application/json',
    'Rebuy-Api-Key': 'your-api-key'
  }
});

const data = await response.json();
console.log(data);

JSON Response

{
  "data": [
    {
      "id": 123456,
      "title": "Example Product",
      "price": "29.99",
      "variants": []
    }
  ],
  "metadata": {
    "count": 1
  }
}

Inline Code

Use inline_code for variable names, function calls like getData(), and file paths like src/components/Widget.tsx.


Tables

Response Header Description
Search-Page-Current The current page number
Search-Page-Total The total number of pages
Search-Size-Current Products in current page
Search-Size-Total Total products across all pages

Blockquotes

This is a blockquote. Used for API endpoint descriptions and important callouts.


Lists

Unordered List

  • First item
  • Second item
  • Nested item
  • Another nested item
  • Third item

Ordered List

  1. First step
  2. Second step
  3. Sub-step A
  4. Sub-step B
  5. Third step


Buttons

Primary Button

Used for main CTAs. Uses dedicated --rb-btn-primary-* tokens that go darker in dark mode (opposite of link colors) to maintain WCAG contrast with white text.

Tokens:

Token Light Mode Dark Mode
--rb-btn-primary-bg #335de9 #1d4ed8
--rb-btn-primary-bg-hover #1742d2 #1e40af
--rb-btn-primary-fg #fff #fff

Tab Bar

Top navigation tabs on the gradient header. White text with background-based states:

Home Guides Reference

States:

  • Default: White text, no background
  • Hover: background: rgba(255, 255, 255, 0.15)
  • Active: Same as hover
  • Focus: White outline ring

Uppercase, small, muted text with top border separator:

Platform Data Sources
Recommended GET
Top Sellers GET
Collections GET

Nav Link States:

  • Default: color: var(--rb-text-muted)
  • Hover: background: var(--rb-bg-hover)
  • Active: background: var(--rb-brand-accent-bg); color: var(--rb-brand-accent-dark)

Smaller than inline badges, right-aligned in nav items:

GET POST PUT PATCH DELETE

AI Actions Dropdown

Appears on every page (except homepage) in the H1 title area. Provides quick access to AI chat and copy functionality.

Ask Claude
Ask ChatGPT
Copy MD

Features:

  • Keyboard accessible: Arrow keys, Enter, Escape, Tab
  • ARIA attributes for screen readers
  • Focus trap when open
  • Click outside to close

Toast Notifications

Appears at bottom-center of screen for copy confirmations and errors. Both our custom toast (.copy-toast) and Material's built-in clipboard toast (.md-dialog) use the same styling.

Copied to clipboard!
Failed to copy

Tokens:

  • Success: --rb-toast-success-bg (#059669), --rb-toast-success-fg (#fff)
  • Error: --rb-toast-error-bg (#dc2626), --rb-toast-error-fg (#fff)

Keyboard Shortcuts

Styled <kbd> elements for keyboard shortcut hints:

Press + K to search

Used on:

  • 404 page search hint
  • Jump To feature (future)

Focus States

All interactive elements have :focus-visible styles for keyboard navigation accessibility.

Pattern:

.interactive-element:focus-visible {
  outline: 2px solid var(--rb-brand-primary);
  outline-offset: 2px;
}

Elements with focus styles:

  • Tab bar links (white outline on gradient)
  • Sidebar nav links
  • Buttons (primary, hero, 404 page)
  • AI dropdown trigger and menu items
  • Endpoint copy button
  • Links (using Material default)

Color Tokens

Status Colors

Success
GET badges
Info
POST badges
Neutral
PUT badges
Attention
PATCH badges
Danger
DELETE badges

Background Colors

Page
Main background
Muted
Code blocks, cards
Subtle
Hover states
Emphasis
Hero sections

Text Colors

Default Text
--rb-text-default
Muted Text
--rb-text-muted
Minimum Text
--rb-text-minimum
Inverse Text
--rb-text-inverse

Brand Colors

Brand Primary
--rb-brand-primary
Links, active states
Brand Accent
--rb-brand-accent
Nav active, CTAs

Spacing Scale

Based on 4px increments:

Token Value Pixels
--rb-space-1 0.25rem 4px
--rb-space-2 0.5rem 8px
--rb-space-3 0.75rem 12px
--rb-space-4 1rem 16px
--rb-space-6 1.5rem 24px
--rb-space-8 2rem 32px

Border Radius

Token Value Usage
--rb-radius-sm 2px Subtle rounding
--rb-radius-md 4px Default (buttons, inputs)
--rb-radius-lg 8px Cards, modals
--rb-radius-full 9999px Pills, badges

Shadows

Small
--rb-shadow-sm
Medium
--rb-shadow-md
Large
--rb-shadow-lg

Dark Mode

Toggle dark mode using the sun/moon icon in the header to verify all components work in both themes.

Key dark mode changes:

  • Text colors lighten for contrast
  • Background colors darken
  • Status colors adjust for visibility
  • Borders become lighter (white alpha)
  • Badge/button backgrounds go darker (for WCAG contrast with white text)
  • Brand primary goes lighter (for link text contrast)

Last updated: 2026-01-12

See something that needs updating? Suggest an edit