Custom CSS
Add custom CSS to override theme styles, tweak typography, or add brand-specific styling. Jamdesk exposes CSS variables for common customizations.
Jamdesk themes provide sensible defaults, but you can add custom CSS to match your brand or adjust specific styles.
Adding Custom CSS
Create a style.css file in your project root — the same folder as your docs.json. Jamdesk applies it to every page automatically; no docs.json entry is needed.
Any .css file in the project root works, not just style.css — handy when migrating from another tool. When there are several, Jamdesk combines them in alphabetical filename order.
Run jamdesk dev to preview the result locally — it renders your custom CSS the same way the published site does.
/* Your custom styles */
.content h1 {
font-size: 2.5rem;
}CSS Variables
Jamdesk exposes CSS variables for common customizations. Override them in your custom CSS:
:root {
/* Typography */
--font-family-sans: 'Inter', system-ui, sans-serif;
--font-family-mono: 'JetBrains Mono', monospace;
/* Spacing */
--content-max-width: 900px;
--sidebar-width: 280px;
/* Border radius */
--radius-sm: 4px;
--radius-md: 8px;
--radius-lg: 12px;
}Color Variables
Primary colors are set in docs.json. For fine-grained control, override these variables:
:root {
/* Light mode */
--color-background: #ffffff;
--color-text: #1a1a1a;
--color-text-muted: #666666;
--color-border: #e5e5e5;
--color-code-bg: #f5f5f5;
}
[data-theme="dark"] {
/* Dark mode */
--color-background: #0a0a0a;
--color-text: #fafafa;
--color-text-muted: #a3a3a3;
--color-border: #262626;
--color-code-bg: #171717;
}Common Customizations
Adjust Content Width
:root {
--content-max-width: 1000px; /* Default: 900px */
}
Change Code Block Font
:root {
--font-family-mono: 'Fira Code', monospace;
}
/* Ensure ligatures work if your font supports them */
pre code {
font-variant-ligatures: common-ligatures;
}
Customize Link Styles
.content a:not([class]) {
color: var(--color-primary);
text-decoration: underline;
text-underline-offset: 2px;
}
.content a:not([class]):hover {
text-decoration-thickness: 2px;
}
Adjust Heading Spacing
.content h2 {
margin-top: 3rem;
margin-bottom: 1rem;
}
.content h3 {
margin-top: 2rem;
margin-bottom: 0.75rem;
}
Style Callouts
/* Make Note callouts more prominent */
[data-callout="note"] {
border-left-width: 4px;
background: var(--color-primary-subtle);
}
Dark Mode
Use the [data-theme="dark"] selector for dark mode styles:
/* Light mode */
.custom-banner {
background: #f0f4ff;
color: #1e3a5f;
}
/* Dark mode */
[data-theme="dark"] .custom-banner {
background: #1e293b;
color: #e2e8f0;
}
Targeting Components
Override styles for specific components:
/* Card component */
[data-component="card"] {
border-radius: 16px;
}
/* Code blocks */
[data-component="code-block"] {
border-radius: 8px;
}
/* Tabs */
[data-component="tabs"] [data-state="active"] {
border-bottom-width: 3px;
}
External Fonts
Load custom fonts with @import or @font-face:
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
:root {
--font-family-sans: 'Inter', system-ui, sans-serif;
}
Or self-host fonts:
@font-face {
font-family: 'CustomFont';
src: url('/fonts/custom-font.woff2') format('woff2');
font-weight: 400;
font-display: swap;
}
Responsive Styles
Use media queries for responsive adjustments:
/* Mobile adjustments */
@media (max-width: 768px) {
.content h1 {
font-size: 1.75rem;
}
:root {
--content-max-width: 100%;
}
}
Debugging
Use browser dev tools to inspect elements and find the correct selectors. Jamdesk uses data attributes for component targeting:
data-component="..."- Component typedata-theme="light|dark"- Current themedata-state="..."- Component state (active, disabled, etc.)
Limitations
- CSS is applied globally; use specific selectors to avoid conflicts
- Some internal layout styles use
!importantand may require the same to override - In local preview (
jamdesk dev), edits to your CSS file(s) apply on browser refresh; on your published site, changes take effect on the next build
