Skip to main content

Themes & Styling

Built-in Themes

There are two themes you can pick from:

ThemeClassDescription
"dark".discord-darkDiscord dark theme (default)
"light".discord-lightDiscord light theme
const html = generateTranscriptHtml(data, { theme: "dark" });
const html = generateTranscriptHtml(data, { theme: "light" });

CSS Custom Properties

Both themes use CSS custom properties prefixed with --dc-. You can override any of them with customCss:

const html = generateTranscriptHtml(data, {
customCss: `
.discord-dark {
--dc-bg-primary: #1a1a2e;
--dc-bg-secondary: #16213e;
--dc-accent-primary: #e94560;
--dc-text-primary: #eee;
}
`,
});

Key CSS Variables

VariableDark DefaultLight DefaultUsed For
--dc-bg-primary#313338#ffffffMain background
--dc-bg-secondary#2b2d31#f2f3f5Secondary background
--dc-bg-tertiary#1e1f22#e3e5e8Tertiary background
--dc-text-primary#dbdee1#313338Main text
--dc-text-muted#949ba4#5c6470Muted/secondary text
--dc-text-link#00a8fc#006ce7Links
--dc-accent-primary#5865f2#5865f2Accent color
--dc-bg-message-hover#2e3035#f2f3f5Message hover

Custom Font

Swap out the default font:

const html = generateTranscriptHtml(data, {
fontFamily: "'Fira Code', monospace",
});
note

Since transcripts are self-contained HTML with no external requests, custom fonts must already be available on the viewer's system. If you need a web font, include an @import or @font-face rule in customCss.

Custom CSS

You can add your own CSS on top:

const html = generateTranscriptHtml(data, {
customCss: `
/* Hide avatars */
.discord-message-avatar { display: none; }

/* Custom embed border */
.discord-embed { border-radius: 8px; }

/* Bigger reactions */
.discord-reaction { font-size: 1.2em; padding: 6px 10px; }
`,
});
caution

The customCss value is sanitized to prevent </style> tag injection, but you should avoid passing untrusted user input directly.

There are built-in print styles so the transcript looks good when printed or saved as PDF:

  • Hover effects and interactive bits are stripped
  • Spacing is adjusted for paper
  • Ensures all content is visible (no collapsed sections)