Themes
Lumis themes come from the Neovim ecosystem. You can use the built-in collection, load theme JSON yourself, or generate new themes from a colorscheme repository.
Pick a built-in theme
- JavaScript
- Rust
- Elixir
- Java
- CLI
import dracula from '@lumis-sh/themes/dracula';
console.log(dracula.name);
console.log(dracula.appearance);
use lumis::themes;
let theme = themes::get("dracula").unwrap();
theme = Lumis.Theme.get("github_light")
theme.name
import io.roastedroot.lumis4j.core.Theme;
var theme = Theme.DRACULA;
lumis themes list
Load a custom theme from JSON
- JavaScript
- Rust
- Elixir
- Java
- CLI
Custom theme JSON loading is not currently exposed by @lumis-sh/themes as a runtime helper.
use lumis::themes;
let theme = themes::from_file("my_theme.json").unwrap();
{:ok, theme} = Lumis.Theme.from_file("/path/to/theme.json")
Lumis.highlight!("const x = 1", formatter: {:html_inline, language: "javascript", theme: theme})
Custom theme JSON loading is not currently exposed by lumis4j.
# generate a theme JSON file
lumis themes generate \
--url https://github.com/catppuccin/nvim \
--colorscheme catppuccin-mocha \
--output catppuccin-mocha.json
# move it into the Lumis data dir so `lumis themes list` can discover it
mkdir -p ~/.local/share/lumis/themes
cp catppuccin-mocha.json ~/.local/share/lumis/themes/
# then use the theme by name
lumis highlight index.js --theme my-custom-theme
Replace `my-custom-theme` with the JSON theme's `name` field.
See CLI Commands for the full lumis themes generate options.
Generate a theme from a Neovim colorscheme
The CLI can extract a theme directly from a Git repository.
lumis themes generate \
--url https://github.com/catppuccin/nvim \
--colorscheme catppuccin-mocha \
--output catppuccin-mocha.json
You can also pass custom setup code or mark the theme as light mode:
lumis themes generate \
--url https://github.com/projekt0n/github-nvim-theme \
--colorscheme github_light \
--appearance light \
--output github-light.json
CSS theme files
If you use htmlLinked, pair the HTML output with a stylesheet. See CSS Theme Files for import paths and runtime-specific setup.
Theme switching with CSS variables
If you want one block to support multiple themes, use the multi-theme formatter from Formatters.