/** @returns {import("shiki").ThemeRegistration} */
function theme(name, type, p) {
return {
name,
type,
colors: {
"editor.background": p.background,
"editor.foreground": p.foreground,
},
tokenColors: [
{ settings: { foreground: p.foreground } },
{ scope: ["comment", "punctuation.definition.comment"], settings: { foreground: p.comment } },
{ scope: ["keyword", "storage", "keyword.control", "storage.type", "storage.modifier"], settings: { foreground: p.magenta } },
{ scope: ["keyword.operator", "punctuation"], settings: { foreground: p.punctuation } },
{ scope: ["string", "string.template", "markup.inline.raw"], settings: { foreground: p.green } },
{ scope: ["string.regexp", "constant.character.escape"], settings: { foreground: p.cyan } },
{ scope: ["constant.numeric", "constant.language", "constant.other", "support.constant", "variable.other.constant"], settings: { foreground: p.yellow } },
{ scope: ["entity.name.function", "support.function", "meta.function-call"], settings: { foreground: p.blue } },
{ scope: ["entity.name.type", "entity.name.class", "support.type", "support.class", "entity.other.inherited-class"], settings: { foreground: p.cyan } },
{ scope: ["entity.name.tag", "variable.language"], settings: { foreground: p.red } },
{ scope: ["entity.other.attribute-name", "support.type.property-name", "meta.object-literal.key"], settings: { foreground: p.yellow } },
{ scope: ["markup.heading", "entity.name.section"], settings: { foreground: p.blue } },
{ scope: ["markup.bold"], settings: { fontStyle: "bold" } },
{ scope: ["markup.italic"], settings: { fontStyle: "italic" } },
{ scope: ["markup.underline.link", "string.other.link"], settings: { foreground: p.cyan } },
{ scope: ["markup.inserted", "punctuation.definition.inserted"], settings: { foreground: p.green } },
{ scope: ["markup.deleted", "punctuation.definition.deleted"], settings: { foreground: p.red } },
{ scope: ["markup.changed", "punctuation.definition.changed"], settings: { foreground: p.yellow } },
{ scope: ["invalid"], settings: { foreground: p.red } },
],
};
}
export const tangledDark = theme("tangled-dark", "dark", {
background: "#0a0a0a",
foreground: "#D1D5DB",
comment: "#9f9fb3",
punctuation: "#9a9ab3",
red: "#d45555",
green: "#68b37a",
yellow: "#cc7143",
blue: "#897ee6",
magenta: "#b178bf",
cyan: "#8cc2c2",
});
export const tangledLight = theme("tangled-light", "light", {
background: "#f5f5f5",
foreground: "#1F2937",
comment: "#6e6e8b",
punctuation: "#6d6d91",
red: "#ba4949",
green: "#2b7f4b",
yellow: "#a65d42",
blue: "#6161b8",
magenta: "#8945c4",
cyan: "#387b76",
});