1import { tags as t } from '@lezer/highlight';
2import { createTheme } from './theme-helper.mjs';
3
4export const settings = {
5  background: '#2e3440',
6  lineBackground: '#2e344099',
7  foreground: '#FFFFFF',
8  muted: '#FFFFFF50',
9  caret: '#FFFFFF',
10  selection: '#3b4252',
11  selectionMatch: '#e5e9f0',
12  gutterBackground: '#2e3440',
13  gutterForeground: '#4c566a',
14  gutterActiveForeground: '#d8dee9',
15  lineHighlight: '#4c566a',
16};

Colors from https://www.nordtheme.com/docs/colors-and-palettes

19export default createTheme({
20  theme: 'dark',
21  settings: {
22    background: '#2e3440',
23    foreground: '#FFFFFF',
24    muted: '#FFFFFF50',
25    caret: '#FFFFFF',
26    selection: '#00000073',
27    selectionMatch: '#00000073',
28    gutterBackground: '#2e3440',
29    gutterForeground: '#4c566a',
30    gutterActiveForeground: '#d8dee9',
31    lineHighlight: '#4c566a29',
32  },
33  styles: [
34    { tag: t.keyword, color: '#5e81ac' },
35    { tag: [t.name, t.deleted, t.character, t.propertyName, t.macroName], color: '#88c0d0' },
36    { tag: [t.variableName], color: '#8fbcbb' },
37    { tag: [t.function(t.variableName)], color: '#8fbcbb' },
38    { tag: [t.labelName], color: '#81a1c1' },
39    { tag: [t.color, t.constant(t.name), t.standard(t.name)], color: '#5e81ac' },
40    { tag: [t.definition(t.name), t.separator], color: '#a3be8c' },
41    { tag: [t.brace], color: '#8fbcbb' },
42    { tag: [t.annotation], color: '#d30102' },
43    { tag: [t.number, t.changed, t.annotation, t.modifier, t.self, t.namespace], color: '#b48ead' },
44    { tag: [t.typeName, t.className], color: '#ebcb8b' },
45    { tag: [t.operator, t.operatorKeyword], color: '#a3be8c' },
46    { tag: [t.tagName], color: '#b48ead' },
47    { tag: [t.squareBracket], color: '#bf616a' },
48    { tag: [t.angleBracket], color: '#d08770' },
49    { tag: [t.attributeName], color: '#ebcb8b' },
50    { tag: [t.regexp], color: '#5e81ac' },
51    { tag: [t.quote], color: '#b48ead' },
52    { tag: [t.string], color: '#a3be8c' },
53    {
54      tag: t.link,
55      color: '#a3be8c',
56      textDecoration: 'underline',
57      textUnderlinePosition: 'under',
58    },
59    { tag: [t.url, t.escape, t.special(t.string)], color: '#8fbcbb' },
60    { tag: [t.meta], color: '#88c0d0' },
61    { tag: [t.monospace], color: '#d8dee9', fontStyle: 'italic' },
62    { tag: [t.comment], color: '#4c566a', fontStyle: 'italic' },
63    { tag: t.strong, fontWeight: 'bold', color: '#5e81ac' },
64    { tag: t.emphasis, fontStyle: 'italic', color: '#5e81ac' },
65    { tag: t.strikethrough, textDecoration: 'line-through' },
66    { tag: t.heading, fontWeight: 'bold', color: '#5e81ac' },
67    { tag: t.special(t.heading1), fontWeight: 'bold', color: '#5e81ac' },
68    { tag: t.heading1, fontWeight: 'bold', color: '#5e81ac' },
69    {
70      tag: [t.heading2, t.heading3, t.heading4],
71      fontWeight: 'bold',
72      color: '#5e81ac',
73    },
74    { tag: [t.heading5, t.heading6], color: '#5e81ac' },
75    { tag: [t.atom, t.bool, t.special(t.variableName)], color: '#d08770' },
76    { tag: [t.processingInstruction, t.inserted], color: '#8fbcbb' },
77    { tag: [t.contentSeparator], color: '#ebcb8b' },
78    { tag: t.invalid, color: '#434c5e', borderBottom: `1px dotted #d30102` },
79  ],
80});