LiG.
Less is Great.
Syntax
Less.
mono
Ordinary identifiers, text and comments
struct
Parameter bindings, modules, tags and modifiers
ref
Type references, constants, values and escapes
action
Functions, constructors, calls, async and exceptions
Hover to inspect · click to pin · ← → ↑ ↓ to move · Esc to clear
import type { TokenBundle, LigVariant } from './core'
// Load one theme; every port shares the same tokens.
export async function loadTheme(
variant: LigVariant,
retries = 3,
): Promise<Record<string, string>> {
for (let attempt = 0; attempt < retries; attempt++) {
try {
const response = await fetch('/tokens.json')
if (!response.ok)
throw new Error('Theme unavailable')
const bundle: TokenBundle = await response.json()
if (bundle.schemaVersion !== 2)
throw new Error('Unsupported schema')
return bundle.variants[variant].tokens
} catch (error) {
if (attempt === retries - 1)
throw error
await new Promise(resolve =>
setTimeout(resolve, 250 * 2 ** attempt),
)
}
}
throw new Error('No attempts remaining\n')
}
Hover to inspect · click to pin · ← → ↑ ↓ to move · Esc to clear
import json
from pathlib import Path
# Export resolved colors without duplicating the palette.
def export_theme(
source: Path,
destination: Path,
variant: str = "dark",
) -> int:
"""Write a stable, alphabetically sorted color table."""
bundle = json.loads(source.read_text(encoding="utf-8"))
if bundle["schemaVersion"] != 2:
raise ValueError("Unsupported token schema")
tokens = bundle["variants"][variant]["tokens"]
lines = [f"# LiG {variant} · {bundle['version']}"]
for name, color in sorted(tokens.items()):
if not color.startswith("#") or len(color) != 7:
raise ValueError(f"Invalid color: {name}")
lines.append(f"{name} = {color}")
destination.parent.mkdir(parents=True, exist_ok=True)
destination.write_text("\n".join(lines) + "\n", encoding="utf-8")
return len(tokens)
lig check --colors
Normal
blackblackredredgreengreenyellowyellowbluebluemagentamagentacyancyanwhitewhiteBright
bright blackbright blackbright redbright redbright greenbright greenbright yellowbright yellowbright bluebright bluebright magentabright magentabright cyanbright cyanbright whitebright whiteSource
Ports
Downloads & ports
lig.nvim for Neovim
{
"0froq/lig.nvim",
lazy = false,
priority = 1000,
opts = { style = "dark" },
config = function(_, opts)
require("lig").setup(opts)
vim.cmd.colorscheme("lig")
end,
}