Skip to content
Jordi vidal edited this page Feb 28, 2026 · 2 revisions

Themes

Built-in themes

mdink ships with three built-in themes:

Name Description
dark Dark background with bright ANSI colors — the default
light Light background with muted colors
dracula The Dracula color palette
mdink --list-themes

Selecting a theme

CLI flag (highest priority):

mdink -s dracula README.md
mdink --style light README.md

Environment variable:

export MDINK_STYLE=light
mdink README.md

Config file (~/.config/mdink/config.json):

{ "style": "dracula" }

See CLI-Reference for the full precedence chain.


Custom themes

1 — Export a starting point

mdink --dump-theme > my-theme.json

This prints the fully-resolved current theme as pretty-printed JSON, including all defaults. Edit the file to taste.

2 — Apply the custom theme

mdink -s my-theme.json README.md

Any path that resolves to an existing file is loaded as a JSON theme file.

3 — Install permanently

Copy the file to ~/.config/mdink/themes/ and reference it by name (without .json):

mkdir -p ~/.config/mdink/themes
cp my-theme.json ~/.config/mdink/themes/nord.json

mdink -s nord README.md

Theme resolution order

When --style is given a value, mdink tries:

  1. Built-in name (dark, light, dracula) → embedded JSON
  2. Path that exists as a file → read and parse
  3. ~/.config/mdink/themes/<name>.json → read and parse
  4. Error: theme not found

JSON schema

The full theme object. All fields are optional; omitted fields fall back to the built-in dark theme defaults.

{
  "name": "my-theme",
  "syntect_theme": "base16-ocean.dark",

  "document": {
    "bg": null
  },

  "heading": [
    { "fg": "#88ffff", "bold": true, "italic": false, "underline": false, "prefix": null },
    { "fg": "#88ff88", "bold": true, "italic": false, "underline": false, "prefix": null },
    { "fg": "#ffff88", "bold": true, "italic": false, "underline": false, "prefix": null },
    { "fg": null,      "bold": true, "italic": true,  "underline": false, "prefix": null },
    { "fg": null,      "bold": true, "italic": true,  "underline": false, "prefix": null },
    { "fg": null,      "bold": true, "italic": true,  "underline": false, "prefix": null }
  ],

  "code_block": {
    "bg": "235",
    "label_fg": "245",
    "label_bg": "235",
    "label_italic": true
  },

  "code_inline": {
    "fg": "252", "bg": "236",
    "bold": true, "italic": true,
    "underline": false, "strikethrough": false, "dim": false
  },

  "block_quote": {
    "fg": null, "border_fg": null,
    "prefix": "│ ",
    "italic": true, "dim": true
  },

  "table": {
    "header_fg": null, "header_bold": true,
    "border_fg": null, "border_dim": true
  },

  "thematic_break": {
    "fg": null, "char": "─", "dim": true
  },

  "list": {
    "bullet": ["•", "◦", "▪"],
    "task_checked": "☑", "task_unchecked": "☐",
    "bullet_fg": null, "number_fg": null,
    "task_checked_fg": null, "task_unchecked_fg": null,
    "indent_size": 2
  },

  "emphasis":      { "italic": true },
  "strong":        { "bold": true },
  "strikethrough": { "strikethrough": true },
  "link":          { "italic": true },
  "image_alt":     { "dim": true },

  "outline": {
    "fg": "white",
    "bg": null,
    "selected_fg": "black",
    "selected_bg": "white",
    "border_fg": "dark_gray",
    "h1_fg": "light_cyan",
    "h2_fg": "green",
    "h3_fg": "yellow",
    "width_percent": 25
  },

  "status_bar": {
    "fg": "black", "bg": "white", "bold": true
  }
}

Color values

Colors are strings and support three formats (or null to use the terminal default):

Format Example Notes
Named "red", "light_cyan", "dark_gray" Standard ANSI names
Indexed "99", "235" 256-color palette (0–255)
Hex RGB "#ff5500" or "ff5500" 24-bit true color
null null Use the terminal default

syntect_theme

Controls the syntax-highlighting color scheme used inside fenced code blocks. Accepts any theme name bundled with syntect, such as:

  • base16-ocean.dark (default)
  • base16-ocean.light
  • Solarized (dark) / Solarized (light)
  • InspiredGitHub

Example: Nord-inspired theme

{
  "name": "nord",
  "syntect_theme": "base16-ocean.dark",
  "heading": [
    { "fg": "#88c0d0", "bold": true },
    { "fg": "#81a1c1", "bold": true },
    { "fg": "#5e81ac", "bold": true },
    { "fg": "#4c566a", "bold": true, "italic": true },
    { "fg": "#4c566a", "bold": true, "italic": true },
    { "fg": "#4c566a", "bold": true, "italic": true }
  ],
  "code_block": { "bg": "#2e3440", "label_fg": "#616e88" },
  "code_inline": { "fg": "#d8dee9", "bg": "#3b4252", "bold": true, "italic": true },
  "status_bar":  { "fg": "#2e3440", "bg": "#88c0d0", "bold": true }
}

Save as ~/.config/mdink/themes/nord.json and use with mdink -s nord README.md.

Clone this wiki locally