diff --git a/src/one-dark.ts b/src/one-dark.ts index 15023d0..4ae1f67 100644 --- a/src/one-dark.ts +++ b/src/one-dark.ts @@ -4,15 +4,14 @@ import {HighlightStyle, tags as t} from "@codemirror/next/highlight" const chalky = "#e5c07b", coral = "#e06c75", - dark = "#5c6370", - fountainBlue = "#56b6c2", - green = "#98c379", + cyan = "#56b6c2", invalid = "#ffffff", - lightDark = "#7f848e", - lightWhite = "#abb2bf", + ivory = "#abb2bf", + stone = "#5c6370", malibu = "#61afef", - purple = "#c678dd", + sage = "#98c379", whiskey = "#d19a66", + violet = "#c678dd", background = "#282c34", selection = "#405948", cursor = "#528bff" @@ -20,7 +19,7 @@ const chalky = "#e5c07b", /// The editor theme styles for One Dark. export const oneDarkTheme = EditorView.theme({ $: { - color: lightWhite, + color: ivory, backgroundColor: background, "& ::selection": {backgroundColor: selection}, caretColor: cursor @@ -29,7 +28,7 @@ export const oneDarkTheme = EditorView.theme({ "$$focused $cursor": {borderLeftColor: cursor}, "$$focused $selectionBackground": {backgroundColor: selection}, - $panels: {backgroundColor: background, color: lightWhite}, + $panels: {backgroundColor: background, color: ivory}, "$panels.top": {borderBottom: "2px solid black"}, "$panels.bottom": {borderTop: "2px solid black"}, @@ -73,37 +72,35 @@ export const oneDarkTheme = EditorView.theme({ /// The highlighting style for code in the One Dark theme. export const oneDarkHighlightStyle = HighlightStyle.define( - {tag: t.comment, - color: lightDark}, {tag: t.keyword, - color: purple}, - {tag: [t.name, t.deleted], + color: violet}, + {tag: [t.name, t.deleted, t.character, t.propertyName, t.macroName], color: coral}, - {tag: [t.operator, t.operatorKeyword, t.regexp], - color: fountainBlue}, - {tag: [t.string, t.inserted], - color: green}, - {tag: t.propertyName, + {tag: [t.processingInstruction, t.string, t.inserted], + color: sage}, + {tag: [t.function(t.variableName), t.labelName], color: malibu}, {tag: [t.color, t.constant(t.name), t.standard(t.name)], color: whiskey}, - {tag: t.definition(t.name), - color: lightWhite}, - {tag: [t.typeName, t.className, t.number, t.changed], + {tag: [t.definition(t.name), t.separator], + color: ivory}, + {tag: [t.typeName, t.className, t.number, t.changed, t.annotation, t.modifier, t.self, t.namespace], color: chalky}, - {tag: t.meta, - color: dark}, + {tag: [t.operator, t.operatorKeyword, t.url, t.escape, t.regexp, t.link, t.special(t.string)], + color: cyan}, + {tag: [t.meta, t.comment], + color: stone}, {tag: t.strong, - fontWeight: "bold"}, // FIXME export a template for this from highlight + fontWeight: "bold"}, {tag: t.emphasis, fontStyle: "italic"}, {tag: t.link, - color: dark, + color: stone, textDecoration: "underline"}, {tag: t.heading, fontWeight: "bold", color: coral}, - {tag: [t.atom, t.bool], + {tag: [t.atom, t.bool, t.special(t.variableName)], color: whiskey }, {tag: t.invalid, color: invalid},