Skip to content

Commit

Permalink
Clean up one-dark theme
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Dec 18, 2020
1 parent dc9a878 commit 555c0e7
Showing 1 changed file with 22 additions and 25 deletions.
47 changes: 22 additions & 25 deletions src/one-dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,22 @@ 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"

/// The editor theme styles for One Dark.
export const oneDarkTheme = EditorView.theme({
$: {
color: lightWhite,
color: ivory,
backgroundColor: background,
"& ::selection": {backgroundColor: selection},
caretColor: cursor
Expand All @@ -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"},

Expand Down Expand Up @@ -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},
Expand Down

0 comments on commit 555c0e7

Please sign in to comment.