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:
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¶
https://rebuyengine.com/api/v1/products/recommended
https://rebuyengine.com/api/v1/analytics/event
https://rebuyengine.com/api/v1/settings/{id}
https://rebuyengine.com/api/v1/widgets/{widget_id}
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¶
- First step
- Second step
- Sub-step A
- Sub-step B
- Third step
Links¶
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 |
Navigation Components¶
Tab Bar¶
Top navigation tabs on the gradient header. White text with background-based states:
States:
- Default: White text, no background
- Hover:
background: rgba(255, 255, 255, 0.15) - Active: Same as hover
- Focus: White outline ring
Sidebar Section Headers¶
Uppercase, small, muted text with top border separator:
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)
Sidebar Method Badges¶
Smaller than inline badges, right-aligned in nav items:
AI Actions Dropdown¶
Appears on every page (except homepage) in the H1 title area. Provides quick access to AI chat and copy functionality.
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.
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¶
GET badges
POST badges
PUT badges
PATCH badges
DELETE badges
Background Colors¶
Main background
Code blocks, cards
Hover states
Hero sections
Text Colors¶
--rb-text-default
--rb-text-muted
--rb-text-minimum
--rb-text-inverse
Brand Colors¶
--rb-brand-primaryLinks, active states
--rb-brand-accentNav 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¶
--rb-shadow-sm
--rb-shadow-md
--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
--- title: Design System Preview robots: noindex search: exclude: true --- # 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: <div style="height: 48px; background: linear-gradient(90deg, #6366f1 0%, #a855f7 25%, #ec4899 50%, #f472b6 70%, #fb923c 100%); border-radius: 4px; display: flex; align-items: center; padding: 0 1rem;"> <span style="color: white; font-weight: 600;">Purple → Pink → Orange</span> </div> 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 | <span style="font-size: 0.6rem">Section headers, badges</span> | | `--rb-font-size-sm` | 0.7rem | 14px | <span style="font-size: 0.7rem">Secondary content, nav links</span> | | `--rb-font-size-md` | 0.8rem | 16px | <span style="font-size: 0.8rem">Body text (default)</span> | | `--rb-font-size-lg` | 0.9rem | 18px | <span style="font-size: 0.9rem">Lead paragraphs</span> | | `--rb-font-size-xl` | 1rem | 20px | <span style="font-size: 1rem">Subheadings</span> | --- ## Headings <h1 style="margin-top: 0;">H1 Page Title</h1> <h2>H2 Section Header</h2> <h3>H3 Subsection</h3> <h4>H4 Minor Section</h4> --- ## Admonitions !!! note "Example Note" This is a note admonition. Used for general information and tips. Font size should be 14px (secondary content). !!! warning "Example Warning" This is a warning admonition. Used for cautions and deprecation notices. !!! tip "Tip" This is a tip admonition. Used for helpful hints. !!! danger "Danger" This is a danger admonition. Used for critical warnings. !!! info "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): - <span class="method-badge method-get">GET</span> Success/Green - <span class="method-badge method-post">POST</span> Info/Blue - <span class="method-badge method-put">PUT</span> Neutral/Purple - <span class="method-badge method-patch">PATCH</span> Attention/Orange - <span class="method-badge method-delete">DELETE</span> 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 <div class="endpoint-display" style="margin-bottom: 12px;"> <span class="endpoint-method endpoint-method--get">GET</span> <code class="endpoint-url">https://rebuyengine.com/api/v1/products/recommended</code> <button class="endpoint-copy" type="button" style="opacity: 1;"><span class="endpoint-copy-icon"></span></button> </div> <div class="endpoint-display" style="margin-bottom: 12px;"> <span class="endpoint-method endpoint-method--post">POST</span> <code class="endpoint-url">https://rebuyengine.com/api/v1/analytics/event</code> <button class="endpoint-copy" type="button" style="opacity: 1;"><span class="endpoint-copy-icon"></span></button> </div> <div class="endpoint-display" style="margin-bottom: 12px;"> <span class="endpoint-method endpoint-method--put">PUT</span> <code class="endpoint-url">https://rebuyengine.com/api/v1/settings/<span class="endpoint-var">{id}</span></code> <button class="endpoint-copy" type="button" style="opacity: 1;"><span class="endpoint-copy-icon"></span></button> </div> <div class="endpoint-display" style="margin-bottom: 12px;"> <span class="endpoint-method endpoint-method--patch">PATCH</span> <code class="endpoint-url">https://rebuyengine.com/api/v1/widgets/<span class="endpoint-var">{widget_id}</span></code> <button class="endpoint-copy" type="button" style="opacity: 1;"><span class="endpoint-copy-icon"></span></button> </div> <div class="endpoint-display"> <span class="endpoint-method endpoint-method--delete">DELETE</span> <code class="endpoint-url">https://rebuyengine.com/api/v1/rules/<span class="endpoint-var">{ruleset_id}</span></code> <button class="endpoint-copy" type="button" style="opacity: 1;"><span class="endpoint-copy-icon"></span></button> </div> ### 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 ```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 ```json { "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 1. Sub-step A 2. Sub-step B 3. Third step --- ## Links - [Internal link to Recommended endpoint](reference/recommended.md) - [External link to MkDocs Material](https://squidfunk.github.io/mkdocs-material/) --- ## 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. <div style="display: flex; gap: 1rem; flex-wrap: wrap; margin: 1rem 0;"> <a href="#" style="display: inline-flex; align-items: center; padding: 12px 24px; border-radius: 8px; background: var(--rb-btn-primary-bg); color: var(--rb-btn-primary-fg) !important; font-weight: 600; text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;" onmouseover="this.style.transform='translateY(-2px)'; this.style.boxShadow='0 4px 16px rgba(0,0,0,0.15)'; this.style.background='var(--rb-btn-primary-bg-hover)';" onmouseout="this.style.transform=''; this.style.boxShadow=''; this.style.background='var(--rb-btn-primary-bg)';">Primary Button</a> </div> **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` | --- ## Navigation Components ### Tab Bar Top navigation tabs on the gradient header. White text with background-based states: <div style="height: 40px; background: linear-gradient(90deg, #6366f1 0%, #a855f7 25%, #ec4899 50%, #f472b6 70%, #fb923c 100%); border-radius: 4px; display: flex; align-items: center; gap: 4px; padding: 0 8px;"> <span style="color: white; font-weight: 600; padding: 4px 16px; border-radius: 4px; font-size: 14px;">Home</span> <span style="color: white; font-weight: 600; padding: 4px 16px; border-radius: 4px; background: rgba(255,255,255,0.15); font-size: 14px;">Guides</span> <span style="color: white; font-weight: 600; padding: 4px 16px; border-radius: 4px; font-size: 14px;">Reference</span> </div> **States:** - Default: White text, no background - Hover: `background: rgba(255, 255, 255, 0.15)` - Active: Same as hover - Focus: White outline ring ### Sidebar Section Headers Uppercase, small, muted text with top border separator: <div style="border: 1px solid var(--rb-border-default); border-radius: 8px; padding: 16px; background: var(--rb-bg-page);"> <div style="font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--rb-text-minimum); padding-bottom: 4px; border-top: 1px solid var(--rb-border-muted); padding-top: 8px;">Platform Data Sources</div> <div style="display: flex; flex-direction: column; gap: 2px; margin-top: 8px;"> <div style="display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; border-radius: 4px; font-size: 14px; color: var(--rb-text-muted); cursor: pointer;" onmouseover="this.style.background='var(--rb-bg-hover)'" onmouseout="this.style.background=''"> <span>Recommended</span> <span class="nav-method-badge nav-method-badge--get">GET</span> </div> <div style="display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; border-radius: 4px; font-size: 14px; background: var(--rb-brand-accent-bg); color: var(--rb-brand-accent-dark); font-weight: 500;"> <span>Top Sellers</span> <span class="nav-method-badge nav-method-badge--get">GET</span> </div> <div style="display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; border-radius: 4px; font-size: 14px; color: var(--rb-text-muted); cursor: pointer;" onmouseover="this.style.background='var(--rb-bg-hover)'" onmouseout="this.style.background=''"> <span>Collections</span> <span class="nav-method-badge nav-method-badge--get">GET</span> </div> </div> </div> **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)` ### Sidebar Method Badges Smaller than inline badges, right-aligned in nav items: <div style="display: flex; gap: 8px; flex-wrap: wrap; margin: 1rem 0;"> <span class="nav-method-badge nav-method-badge--get">GET</span> <span class="nav-method-badge nav-method-badge--post">POST</span> <span class="nav-method-badge nav-method-badge--put">PUT</span> <span class="nav-method-badge nav-method-badge--patch">PATCH</span> <span class="nav-method-badge nav-method-badge--delete">DELETE</span> </div> --- ## AI Actions Dropdown Appears on every page (except homepage) in the H1 title area. Provides quick access to AI chat and copy functionality. <div style="display: flex; justify-content: flex-end; margin: 1rem 0;"> <div style="position: relative;"> <button type="button" style="display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--rb-border-default); border-radius: 4px; background: var(--rb-bg-page); color: var(--rb-text-muted); cursor: pointer; font-size: 14px;"> <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M19 9l1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25L19 9zm-7.5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12l-5.5-2.5z"/></svg> <span style="font-weight: 500;">Ask AI</span> <svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/></svg> </button> <div style="position: absolute; right: 0; top: calc(100% + 4px); min-width: 140px; padding: 4px 0; background: var(--rb-bg-page); border: 1px solid var(--rb-border-default); border-radius: 4px; box-shadow: var(--rb-shadow-md);"> <div style="display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12px; color: var(--rb-text-default); cursor: pointer;" onmouseover="this.style.background='var(--rb-bg-muted)'" onmouseout="this.style.background=''"> <svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" style="color: var(--rb-text-minimum);"><path d="m4.709 15.956 4.72-2.648.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.104 2.278.157 1.652.098 2.449.255h.389l.055-.158-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 0 1-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.236-2.095.231-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.189-.02 2.855-.606 1.544-.28 1.84-.315.833.388.091.395-.328.807-1.969.486-2.309.461-3.439.814-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.828-.91-1.313-.329h-.182v.11l1.094 1.068 2.005 1.81 2.509 2.33.128.578-.322.455-.34-.049-2.206-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.212-.668-.12-1.373-1.925-1.416-2.168-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.007Z"/></svg> <span>Ask Claude</span> </div> <div style="display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12px; color: var(--rb-text-default); cursor: pointer;" onmouseover="this.style.background='var(--rb-bg-muted)'" onmouseout="this.style.background=''"> <svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" style="color: var(--rb-text-minimum);"><path d="M22.282 9.821a5.984 5.984 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.984 5.984 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.05 6.05 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.989 5.989 0 0 0 3.997-2.9 6.055 6.055 0 0 0-.747-7.073Z"/></svg> <span>Ask ChatGPT</span> </div> <div style="display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12px; color: var(--rb-text-default); cursor: pointer;" onmouseover="this.style.background='var(--rb-bg-muted)'" onmouseout="this.style.background=''"> <svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" style="color: var(--rb-text-minimum);"><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg> <span>Copy MD</span> </div> </div> </div> </div> **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. <div style="display: flex; gap: 1rem; justify-content: center; margin: 1rem 0;"> <div style="padding: 12px 20px; border-radius: 8px; background: var(--rb-toast-success-bg); color: var(--rb-toast-success-fg); font-size: 14px; font-weight: 500;"> Copied to clipboard! </div> <div style="padding: 12px 20px; border-radius: 8px; background: var(--rb-toast-error-bg); color: var(--rb-toast-error-fg); font-size: 14px; font-weight: 500;"> Failed to copy </div> </div> **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: <p style="color: var(--rb-text-minimum); font-size: 14px; margin: 1rem 0;"> Press <kbd style="background: var(--rb-bg-muted); padding: 4px 8px; border-radius: 4px; font-family: var(--rb-font-family-mono); border: 1px solid var(--rb-border-default); font-size: 12px;">⌘</kbd> + <kbd style="background: var(--rb-bg-muted); padding: 4px 8px; border-radius: 4px; font-family: var(--rb-font-family-mono); border: 1px solid var(--rb-border-default); font-size: 12px;">K</kbd> to search </p> Used on: - 404 page search hint - Jump To feature (future) --- ## Focus States All interactive elements have `:focus-visible` styles for keyboard navigation accessibility. **Pattern:** ```css .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 <div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin: 1rem 0;"> <div style="padding: 1rem; background: var(--rb-success-bg); color: var(--rb-success-fg); border-radius: 4px;"> <strong>Success</strong><br>GET badges </div> <div style="padding: 1rem; background: var(--rb-info-bg); color: var(--rb-info-fg); border-radius: 4px;"> <strong>Info</strong><br>POST badges </div> <div style="padding: 1rem; background: var(--rb-neutral-bg); color: var(--rb-neutral-fg); border-radius: 4px;"> <strong>Neutral</strong><br>PUT badges </div> <div style="padding: 1rem; background: var(--rb-attention-bg); color: var(--rb-attention-fg); border-radius: 4px;"> <strong>Attention</strong><br>PATCH badges </div> <div style="padding: 1rem; background: var(--rb-danger-bg); color: var(--rb-danger-fg); border-radius: 4px;"> <strong>Danger</strong><br>DELETE badges </div> </div> ### Background Colors <div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin: 1rem 0;"> <div style="padding: 1rem; background: var(--rb-bg-page); border: 1px solid var(--rb-border-default); border-radius: 4px;"> <strong>Page</strong><br>Main background </div> <div style="padding: 1rem; background: var(--rb-bg-muted); border: 1px solid var(--rb-border-default); border-radius: 4px;"> <strong>Muted</strong><br>Code blocks, cards </div> <div style="padding: 1rem; background: var(--rb-bg-subtle); border: 1px solid var(--rb-border-default); border-radius: 4px;"> <strong>Subtle</strong><br>Hover states </div> <div style="padding: 1rem; background: var(--rb-bg-emphasis); color: var(--rb-text-inverse); border-radius: 4px;"> <strong>Emphasis</strong><br>Hero sections </div> </div> ### Text Colors <div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin: 1rem 0;"> <div style="padding: 1rem; border: 1px solid var(--rb-border-default); border-radius: 4px;"> <span style="color: var(--rb-text-default);">Default Text</span><br> <code style="font-size: 12px;">--rb-text-default</code> </div> <div style="padding: 1rem; border: 1px solid var(--rb-border-default); border-radius: 4px;"> <span style="color: var(--rb-text-muted);">Muted Text</span><br> <code style="font-size: 12px;">--rb-text-muted</code> </div> <div style="padding: 1rem; border: 1px solid var(--rb-border-default); border-radius: 4px;"> <span style="color: var(--rb-text-minimum);">Minimum Text</span><br> <code style="font-size: 12px;">--rb-text-minimum</code> </div> <div style="padding: 1rem; background: var(--rb-bg-emphasis); border-radius: 4px;"> <span style="color: var(--rb-text-inverse);">Inverse Text</span><br> <code style="font-size: 12px; color: var(--rb-text-inverse); background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.2);">--rb-text-inverse</code> </div> </div> ### Brand Colors <div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin: 1rem 0;"> <div style="padding: 1rem; border: 1px solid var(--rb-border-default); border-radius: 4px;"> <span style="color: var(--rb-brand-primary); font-weight: 600;">Brand Primary</span><br> <code style="font-size: 12px;">--rb-brand-primary</code><br> <small style="color: var(--rb-text-minimum);">Links, active states</small> </div> <div style="padding: 1rem; border: 1px solid var(--rb-border-default); border-radius: 4px;"> <span style="color: var(--rb-brand-accent); font-weight: 600;">Brand Accent</span><br> <code style="font-size: 12px;">--rb-brand-accent</code><br> <small style="color: var(--rb-text-minimum);">Nav active, CTAs</small> </div> </div> --- ## 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 <div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin: 1rem 0;"> <div style="padding: 1rem; background: var(--rb-bg-page); border-radius: 8px; box-shadow: var(--rb-shadow-sm);"> <strong>Small</strong><br> <code style="font-size: 11px;">--rb-shadow-sm</code> </div> <div style="padding: 1rem; background: var(--rb-bg-page); border-radius: 8px; box-shadow: var(--rb-shadow-md);"> <strong>Medium</strong><br> <code style="font-size: 11px;">--rb-shadow-md</code> </div> <div style="padding: 1rem; background: var(--rb-bg-page); border-radius: 8px; box-shadow: var(--rb-shadow-lg);"> <strong>Large</strong><br> <code style="font-size: 11px;">--rb-shadow-lg</code> </div> </div> --- ## 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*