Skip to content

Theming โ€‹

Logsmith provides a powerful theming system that allows you to customize the visual appearance of your changelogs. Choose from 8 built-in themes or create your own custom themes to match your project's style.

Built-in Themes โ€‹

Available Themes โ€‹

List all available themes:

bash
# View all themes with descriptions
logsmith themes

Output:

๐ŸŽจ Available Themes:

  default      - Default: Standard emoji theme with colorful icons
  minimal      - Minimal: Clean theme with minimal symbols
  github       - GitHub: GitHub-inspired theme with familiar styling
  gitmoji      - Gitmoji: Complete gitmoji emoji set for commit types
  unicode      - Unicode: Unicode symbols instead of emojis for better compatibility
  simple       - Simple: Text-only theme without any symbols or emojis
  colorful     - Colorful: Vibrant theme with enhanced visual elements
  corporate    - Corporate: Professional theme suitable for business environments

Theme Comparison โ€‹

Here's how different themes style the same content:

markdown
## ๐Ÿš€ Features
- Add user authentication system ([abc123](repo/commit/abc123))
- Implement dark mode toggle ([def456](repo/commit/def456))

## ๐Ÿ› Bug Fixes
- Fix login token expiration issue ([ghi789](repo/commit/ghi789))
markdown
## โœจ Features
- Add user authentication system ([abc123](repo/commit/abc123))
- Implement dark mode toggle ([def456](repo/commit/def456))

## ๐Ÿ› Bug Fixes
- Fix login token expiration issue ([ghi789](repo/commit/ghi789))
markdown
### โœจ Features
* Add user authentication system ([abc123](repo/commit/abc123))
* Implement dark mode toggle ([def456](repo/commit/def456))

### ๐Ÿ”ง Bug Fixes
* Fix login token expiration issue ([ghi789](repo/commit/ghi789))
markdown
## Features
- Add user authentication system ([abc123](repo/commit/abc123))
- Implement dark mode toggle ([def456](repo/commit/def456))

## Bug Fixes
- Fix login token expiration issue ([ghi789](repo/commit/ghi789))

Using Themes โ€‹

Command Line โ€‹

Apply themes directly via CLI:

bash
# Use GitHub theme
logsmith --theme github --output CHANGELOG.md

# Use minimal theme
logsmith --theme minimal --output CHANGELOG.md

# Use corporate theme (no emojis)
logsmith --theme corporate --output CHANGELOG.md

Configuration File โ€‹

Set default theme in your config:

typescript
// logsmith.config.ts
import { defineConfig } from 'logsmith'

export default defineConfig({
  theme: 'github',
  output: 'CHANGELOG.md',
})

Theme Details โ€‹

Default Theme โ€‹

Best for: General use, open source projects Features: Colorful emojis, standard formatting

typescript
const defaultTheme = {
  emojis: {
    feat: '๐Ÿš€',
    fix: '๐Ÿ›',
    docs: '๐Ÿ“š',
    style: '๐Ÿ’…',
    refactor: 'โ™ป๏ธ',
    perf: 'โšก',
    test: '๐Ÿงช',
    build: '๐Ÿ“ฆ',
    ci: '๐Ÿค–',
    chore: '๐Ÿงน',
    revert: 'โช',
    breaking: '๐Ÿ’ฅ',
  }
}

GitHub Theme โ€‹

Best for: GitHub repositories, familiar styling Features: GitHub-style emojis, clean appearance

typescript
const githubTheme = {
  emojis: {
    feat: 'โœจ',
    fix: '๐Ÿ›',
    docs: '๐Ÿ“',
    style: '๐Ÿ’„',
    refactor: 'โ™ป๏ธ',
    perf: 'โšก',
    test: 'โœ…',
    build: '๐Ÿ‘ท',
    ci: '๐Ÿ’š',
    chore: '๐Ÿ”ง',
    revert: 'โช',
    breaking: '๐Ÿ’ฅ',
  }
}

Minimal Theme โ€‹

Best for: Clean, understated documentation Features: Simple symbols, reduced visual noise

typescript
const minimalTheme = {
  emojis: {
    feat: 'โœจ',
    fix: '๐Ÿ”ง',
    docs: '๐Ÿ“–',
    style: '๐ŸŽจ',
    refactor: '๐Ÿ”„',
    perf: 'โšก',
    test: 'โœ…',
    build: '๐Ÿ“ฆ',
    ci: '๐Ÿ”„',
    chore: '๐Ÿ”ง',
    revert: 'โ†ฉ๏ธ',
    breaking: 'โš ๏ธ',
  }
}

Corporate Theme โ€‹

Best for: Enterprise, professional environments Features: No emojis, business-friendly formatting

typescript
const corporateTheme = {
  emojis: {
    feat: '',
    fix: '',
    docs: '',
    style: '',
    refactor: '',
    perf: '',
    test: '',
    build: '',
    ci: '',
    chore: '',
    revert: '',
    breaking: '',
  }
}

Gitmoji Theme โ€‹

Best for: Projects using gitmoji conventions Features: Complete gitmoji emoji set

typescript
const gitmojiTheme = {
  emojis: {
    feat: 'โœจ',
    fix: '๐Ÿ›',
    docs: '๐Ÿ“',
    style: '๐ŸŽจ',
    refactor: 'โ™ป๏ธ',
    perf: 'โšก๏ธ',
    test: 'โœ…',
    build: '๐Ÿ‘ท',
    ci: '๐Ÿ’š',
    chore: '๐Ÿ”ง',
    revert: 'โช๏ธ',
    breaking: '๐Ÿ’ฅ',
  }
}

Unicode Theme โ€‹

Best for: Better terminal compatibility, accessibility Features: Unicode symbols instead of emojis

typescript
const unicodeTheme = {
  emojis: {
    feat: 'โ†’',
    fix: 'โœ—',
    docs: 'โ—‰',
    style: 'โ—ˆ',
    refactor: 'โ†ป',
    perf: 'โ–ฒ',
    test: 'โœ“',
    build: 'โ– ',
    ci: 'โ—',
    chore: 'โ—‹',
    revert: 'โ†',
    breaking: 'โ€ผ',
  }
}

Custom Themes โ€‹

Creating Custom Themes โ€‹

Define your own theme with custom emojis and styling:

typescript
// logsmith.config.ts
import { defineConfig } from 'logsmith'

export default defineConfig({
  // Override individual emojis
  templates: {
    typeFormat: {
      feat: '๐ŸŽ‰ New Features',
      fix: '๐Ÿ”ง Bug Fixes',
      docs: '๐Ÿ“– Documentation',
      style: '๐ŸŽจ Code Style',
      refactor: '๐Ÿ”จ Refactoring',
      perf: '๐Ÿš€ Performance',
      test: '๐Ÿงช Testing',
      build: '๐Ÿ“ฆ Build System',
      ci: '๐Ÿค– CI/CD',
      chore: '๐Ÿงน Maintenance',
      revert: 'โช Reverts',
    },
  },
})

Advanced Custom Theme โ€‹

Create a complete custom theme with styling options:

typescript
// my-theme.ts
import type { ThemeConfig } from 'logsmith'

export const myCustomTheme: ThemeConfig = {
  name: 'My Custom Theme',
  description: 'Custom theme for my project',
  emojis: {
    feat: '๐ŸŒŸ',
    fix: '๐Ÿ› ๏ธ',
    docs: '๐Ÿ“‹',
    style: '๐ŸŽญ',
    refactor: '๐Ÿ”„',
    perf: 'โšก',
    test: '๐Ÿ”',
    build: '๐Ÿ—๏ธ',
    ci: '๐Ÿค–',
    chore: '๐Ÿงฝ',
    revert: 'โ†ถ',
    misc: '๐Ÿ“',
    breaking: '๐Ÿ’ฅ',
  },
  styles: {
    markdown: {
      headerPrefix: '###',
      listItemPrefix: 'โ€ข',
      emphasis: 'bold',
      codeStyle: 'backticks',
    },
    html: {
      colorScheme: 'dark',
      fontSize: 'large',
      fontFamily: 'JetBrains Mono, monospace',
      customCss: `
        .changelog {
          background: #1a1a1a;
          color: #ffffff;
          padding: 2rem;
        }
        .commit-type {
          color: #00d4aa;
          font-weight: bold;
        }
        .breaking-change {
          color: #ff6b6b;
          background: #2a1f1f;
          padding: 0.5rem;
          border-left: 4px solid #ff6b6b;
        }
      `,
    },
  },
}

Using Custom Themes Programmatically โ€‹

typescript
import { generateChangelog } from 'logsmith'
import { myCustomTheme } from './my-theme'

// Apply custom theme programmatically
await generateChangelog({
  output: 'CHANGELOG.md',
  templates: {
    typeFormat: myCustomTheme.emojis,
  },
})

Theme Customization โ€‹

Format-Specific Themes โ€‹

Different themes for different output formats:

typescript
export default defineConfig({
  // Base theme
  theme: 'github',

  // Format-specific overrides
  templates: {
    // Markdown-specific formatting
    commitFormat: '- {{scope}}{{description}} ([{{hash}}]({{repoUrl}}/commit/{{hash}}))',
    groupFormat: '## {{title}}',

    // Different formatting for HTML
    ...(process.env.FORMAT === 'html' && {
      commitFormat: '<li>{{scope}}{{description}} <a href="{{repoUrl}}/commit/{{hash}}">{{hash}}</a></li>',
      groupFormat: '<h2>{{title}}</h2>',
    }),
  },
})

Conditional Theming โ€‹

Apply different themes based on environment:

typescript
export default defineConfig({
  theme: process.env.NODE_ENV === 'production' ? 'corporate' : 'default',

  templates: {
    typeFormat: {
      feat: process.env.CI ? 'โœจ Features' : '๐Ÿš€ Features',
      fix: process.env.CI ? '๐Ÿ› Bug Fixes' : '๐Ÿ”ง Bug Fixes',
    },
  },
})

Styling Options โ€‹

Markdown Styling โ€‹

Customize markdown output styling:

typescript
export default defineConfig({
  theme: 'github',
  templates: {
    // Custom header levels
    groupFormat: '### {{title}}', // Use h3 instead of h2

    // Custom list styling
    commitFormat: '* {{scope}}{{description}}', // Use * instead of -

    // Custom breaking change format
    breakingChangeFormat: 'โš ๏ธ **BREAKING**: {{scope}}{{description}}',

    // Custom date format
    dateFormat: '**Released: {{date}}**',
  },
})

HTML Styling โ€‹

Customize HTML output with CSS:

typescript
export default defineConfig({
  theme: 'colorful',

  // HTML-specific styling (when using format: 'html')
  templates: {
    commitFormat: `
      <div class="commit-entry">
        <span class="commit-type">{{type}}</span>
        <span class="commit-description">{{description}}</span>
        <a href="{{repoUrl}}/commit/{{hash}}" class="commit-hash">{{hash}}</a>
      </div>
    `,
  },
})

Theme Examples โ€‹

Blog-style Theme โ€‹

Perfect for project blogs and updates:

typescript
export default defineConfig({
  theme: 'minimal',
  templates: {
    groupFormat: '## ๐Ÿ“… {{title}} - {{date}}',
    commitFormat: '- **{{description}}** by @{{author}} ([view commit]({{repoUrl}}/commit/{{hash}}))',
    dateFormat: '_{{date}}_',
    typeFormat: {
      feat: '๐ŸŽ‰ New Features',
      fix: '๐Ÿ”ง Bug Fixes',
      docs: '๐Ÿ“š Documentation Updates',
      style: '๐Ÿ’… Style Improvements',
      refactor: 'โ™ป๏ธ Code Refactoring',
      perf: 'โšก Performance Improvements',
    },
  },
})

Release Notes Theme โ€‹

Optimized for release announcements:

typescript
export default defineConfig({
  theme: 'github',
  templates: {
    groupFormat: '## {{title}} ({{count}} changes)',
    commitFormat: '- {{description}} ([{{hash}}]({{repoUrl}}/commit/{{hash}}))',
    breakingChangeFormat: '- ๐Ÿšจ **BREAKING CHANGE**: {{description}} ([{{hash}}]({{repoUrl}}/commit/{{hash}}))',
    typeFormat: {
      feat: 'โœจ What\'s New',
      fix: '๐Ÿ› Bug Fixes',
      docs: '๐Ÿ“– Documentation',
      perf: 'โšก Performance',
      breaking: '๐Ÿšจ Breaking Changes',
    },
  },
})

Developer-focused Theme โ€‹

Technical details for developer audiences:

typescript
export default defineConfig({
  theme: 'unicode',
  includeCommitBody: true,
  hideAuthorEmail: false,
  templates: {
    commitFormat: '- `{{type}}{{scope}}`: {{description}} ({{hash}}) by {{author}}',
    groupFormat: '### {{title}}',
    typeFormat: {
      feat: 'FEAT',
      fix: 'FIX',
      docs: 'DOCS',
      style: 'STYLE',
      refactor: 'REFACTOR',
      perf: 'PERF',
      test: 'TEST',
      build: 'BUILD',
      ci: 'CI',
      chore: 'CHORE',
    },
  },
})

Best Practices โ€‹

Theme Selection Guidelines โ€‹

  1. Open Source Projects: Use default or github themes for familiarity
  2. Corporate Environments: Use corporate or minimal themes for professionalism
  3. Documentation Sites: Use minimal or custom themes for brand consistency
  4. Developer Tools: Use unicode or gitmoji themes for technical audiences
  5. Multi-audience Projects: Create environment-specific themes

Performance Considerations โ€‹

  • Emoji Support: Consider terminal/viewer emoji support
  • File Size: Corporate themes generate smaller files
  • Accessibility: Unicode themes are more accessible than emoji themes
  • Parsing Speed: Simple themes process faster than complex custom themes

Customization Tips โ€‹

  1. Start with a base theme and customize specific elements
  2. Test across different viewers (GitHub, terminals, browsers)
  3. Consider your audience when choosing emoji vs. text
  4. Use consistent formatting across all commit types
  5. Document your custom themes for team members

Next Steps โ€‹

Released under the MIT License.