diff --git a/packages/codemirror/themes.mjs b/packages/codemirror/themes.mjs index 84abfd8b..33b09e8d 100644 --- a/packages/codemirror/themes.mjs +++ b/packages/codemirror/themes.mjs @@ -1,35 +1,3 @@ -/* import { - abcdef, - androidstudio, - atomone, - aura, - bespin, - darcula, - dracula, - duotoneDark, - eclipse, - githubDark, - gruvboxDark, - materialDark, - nord, - okaidia, - solarizedDark, - sublime, - tokyoNight, - tokyoNightStorm, - vscodeDark, - xcodeDark, - bbedit, - duotoneLight, - githubLight, - gruvboxLight, - materialLight, - noctisLilac, - solarizedLight, - tokyoNightDay, - xcodeLight, -} from '@uiw/codemirror-themes-all'; */ - import strudelTheme, { settings as strudelThemeSettings } from './themes/strudel-theme.mjs'; import bluescreen, { settings as bluescreenSettings } from './themes/bluescreen.mjs'; import blackscreen, { settings as blackscreenSettings } from './themes/blackscreen.mjs'; @@ -49,6 +17,11 @@ import duotoneLight, { settings as duotoneLightSettings } from './themes/duotone import eclipse, { settings as eclipseSettings } from './themes/eclipse.mjs'; import githubDark, { settings as githubDarkSettings } from './themes/githubDark.mjs'; import githubLight, { settings as githubLightSettings } from './themes/githubLight.mjs'; +import gruvboxDark, { settings as gruvboxDarkSettings } from './themes/gruvboxDark.mjs'; +import gruvboxLight, { settings as gruvboxLightSettings } from './themes/gruvboxLight.mjs'; +import materialDark, { settings as materialDarkSettings } from './themes/materialDark.mjs'; +import materialLight, { settings as materialLightSettings } from './themes/materialLight.mjs'; + import { setTheme } from '@strudel/draw'; export const themes = { @@ -70,9 +43,9 @@ export const themes = { duotoneLight, eclipse, githubDark, - /*gruvboxDark, + gruvboxDark, materialDark, - nord, + /*nord, okaidia, solarizedDark, sublime, @@ -81,9 +54,9 @@ export const themes = { vscodeDark, xcodeDark,*/ /*bbedit,*/ - githubLight /* + githubLight, gruvboxLight, - materialLight, + materialLight /* noctisLilac, solarizedLight, tokyoNightDay, @@ -125,57 +98,13 @@ export const settings = { eclipse: eclipseSettings, githubLight: githubLightSettings, githubDark: githubDarkSettings, - /* - gruvboxDark: { - background: '#282828', - lineBackground: '#28282899', - foreground: '#ebdbb2', - caret: '#ebdbb2', - selection: '#bdae93', - selectionMatch: '#bdae93', - lineHighlight: '#3c3836', - gutterBackground: '#282828', - gutterForeground: '#7c6f64', - }, - gruvboxLight: { - light: true, - background: '#fbf1c7', - lineBackground: '#fbf1c799', - foreground: '#3c3836', - caret: '#af3a03', - selection: '#ebdbb2', - selectionMatch: '#bdae93', - lineHighlight: '#ebdbb2', - gutterBackground: '#ebdbb2', - gutterForeground: '#665c54', - gutterBorder: 'transparent', - }, - materialDark: { - background: '#2e3235', - lineBackground: '#2e323599', - foreground: '#bdbdbd', - caret: '#a0a4ae', - selection: '#d7d4f0', - selectionMatch: '#d7d4f0', - gutterBackground: '#2e3235', - gutterForeground: '#999', - gutterActiveForeground: '#4f5b66', - lineHighlight: '#545b61', - }, - materialLight: { - light: true, - background: '#FAFAFA', - lineBackground: '#FAFAFA99', - foreground: '#90A4AE', - caret: '#272727', - selection: '#80CBC440', - selectionMatch: '#FAFAFA', - gutterBackground: '#FAFAFA', - gutterForeground: '#90A4AE', - gutterBorder: 'transparent', - lineHighlight: '#CCD7DA50', - }, - noctisLilac: { + + gruvboxDark: gruvboxDarkSettings, + gruvboxLight: gruvboxLightSettings, + + materialDark: materialDarkSettings, + materialLight: materialLightSettings, + /*noctisLilac: { light: true, background: '#f2f1f8', lineBackground: '#f2f1f899', diff --git a/packages/codemirror/themes/gruvboxDark.mjs b/packages/codemirror/themes/gruvboxDark.mjs new file mode 100644 index 00000000..0e2c7379 --- /dev/null +++ b/packages/codemirror/themes/gruvboxDark.mjs @@ -0,0 +1,83 @@ +/** + * @name gruvbox-dark + * @author morhetz + * Name: Gruvbox + * From github.com/codemirror/codemirror5/blob/master/theme/gruvbox-dark.css + */ +import { tags as t } from '@lezer/highlight'; +import { createTheme } from './theme-helper.mjs'; + +export const settings = { + background: '#282828', + lineBackground: '#28282899', + foreground: '#ebdbb2', + caret: '#ebdbb2', + selection: '#bdae93', + selectionMatch: '#bdae93', + lineHighlight: '#3c3836', + gutterBackground: '#282828', + gutterForeground: '#7c6f64', +}; + +export default createTheme({ + theme: 'dark', + settings: { + background: '#282828', + foreground: '#ebdbb2', + caret: '#ebdbb2', + selection: '#b99d555c', + selectionMatch: '#b99d555c', + lineHighlight: '#baa1602b', + gutterBackground: '#282828', + gutterForeground: '#7c6f64', + }, + styles: [ + { tag: t.keyword, color: '#fb4934' }, + { tag: [t.name, t.deleted, t.character, t.propertyName, t.macroName], color: '#8ec07c' }, + { tag: [t.variableName], color: '#83a598' }, + { tag: [t.function(t.variableName)], color: '#b8bb26', fontStyle: 'bold' }, + { tag: [t.labelName], color: '#ebdbb2' }, + { tag: [t.color, t.constant(t.name), t.standard(t.name)], color: '#d3869b' }, + { tag: [t.definition(t.name), t.separator], color: '#ebdbb2' }, + { tag: [t.brace], color: '#ebdbb2' }, + { tag: [t.annotation], color: '#fb4934d' }, + { tag: [t.number, t.changed, t.annotation, t.modifier, t.self, t.namespace], color: '#d3869b' }, + { tag: [t.typeName, t.className], color: '#fabd2f' }, + { tag: [t.operator, t.operatorKeyword], color: '#fb4934' }, + { + tag: [t.tagName], + color: '#8ec07c', + fontStyle: 'bold', + }, + { tag: [t.squareBracket], color: '#fe8019' }, + { tag: [t.angleBracket], color: '#83a598' }, + { tag: [t.attributeName], color: '#8ec07c' }, + { tag: [t.regexp], color: '#8ec07c' }, + { tag: [t.quote], color: '#928374' }, + { tag: [t.string], color: '#ebdbb2' }, + { + tag: t.link, + color: '#a89984', + textDecoration: 'underline', + textUnderlinePosition: 'under', + }, + { tag: [t.url, t.escape, t.special(t.string)], color: '#d3869b' }, + { tag: [t.meta], color: '#fabd2f' }, + { tag: [t.comment], color: '#928374', fontStyle: 'italic' }, + { tag: t.strong, fontWeight: 'bold', color: '#fe8019' }, + { tag: t.emphasis, fontStyle: 'italic', color: '#b8bb26' }, + { tag: t.strikethrough, textDecoration: 'line-through' }, + { tag: t.heading, fontWeight: 'bold', color: '#b8bb26' }, + { tag: [t.heading1, t.heading2], fontWeight: 'bold', color: '#b8bb26' }, + { + tag: [t.heading3, t.heading4], + fontWeight: 'bold', + color: '#fabd2f', + }, + { tag: [t.heading5, t.heading6], color: '#fabd2f' }, + { tag: [t.atom, t.bool, t.special(t.variableName)], color: '#d3869b' }, + { tag: [t.processingInstruction, t.inserted], color: '#83a598' }, + { tag: [t.contentSeparator], color: '#fb4934' }, + { tag: t.invalid, color: '#fe8019', borderBottom: `1px dotted #fb4934d` }, + ], +}); diff --git a/packages/codemirror/themes/gruvboxLight.mjs b/packages/codemirror/themes/gruvboxLight.mjs new file mode 100644 index 00000000..ffb4d716 --- /dev/null +++ b/packages/codemirror/themes/gruvboxLight.mjs @@ -0,0 +1,131 @@ +/** + * @name gruvbox-light + * @author morhetz + * Name: Gruvbox + * From github.com/codemirror/codemirror5/blob/master/theme/gruvbox-light.css + */ +import { tags as t } from '@lezer/highlight'; +import { createTheme } from './theme-helper.mjs'; + +export const settings = { + light: true, + background: '#fbf1c7', + lineBackground: '#fbf1c799', + foreground: '#3c3836', + caret: '#af3a03', + selection: '#ebdbb2', + selectionMatch: '#bdae93', + lineHighlight: '#ebdbb2', + gutterBackground: '#ebdbb2', + gutterForeground: '#665c54', + gutterBorder: 'transparent', +}; + +export default createTheme({ + theme: 'light', + settings: { + background: '#fbf1c7', + foreground: '#3c3836', + caret: '#af3a03', + selection: '#bdae9391', + selectionMatch: '#bdae9391', + lineHighlight: '#a37f2238', + gutterBackground: '#ebdbb2', + gutterForeground: '#665c54', + gutterBorder: 'transparent', + }, + styles: [ + { tag: t.keyword, color: '#9d0006' }, + { + tag: [t.name, t.deleted, t.character, t.propertyName, t.macroName], + color: '#427b58', + }, + { tag: [t.variableName], color: '#076678' }, + { tag: [t.function(t.variableName)], color: '#79740e', fontStyle: 'bold' }, + { tag: [t.labelName], color: '#3c3836' }, + { + tag: [t.color, t.constant(t.name), t.standard(t.name)], + color: '#8f3f71', + }, + { tag: [t.definition(t.name), t.separator], color: '#3c3836' }, + { tag: [t.brace], color: '#3c3836' }, + { + tag: [t.annotation], + color: '#9d0006', + }, + { + tag: [t.number, t.changed, t.annotation, t.modifier, t.self, t.namespace], + color: '#8f3f71', + }, + { + tag: [t.typeName, t.className], + color: '#b57614', + }, + { + tag: [t.operator, t.operatorKeyword], + color: '#9d0006', + }, + { + tag: [t.tagName], + color: '#427b58', + fontStyle: 'bold', + }, + { + tag: [t.squareBracket], + color: '#af3a03', + }, + { + tag: [t.angleBracket], + color: '#076678', + }, + { + tag: [t.attributeName], + color: '#427b58', + }, + { + tag: [t.regexp], + color: '#427b58', + }, + { + tag: [t.quote], + color: '#928374', + }, + { tag: [t.string], color: '#3c3836' }, + { + tag: t.link, + color: '#7c6f64', + textDecoration: 'underline', + textUnderlinePosition: 'under', + }, + { + tag: [t.url, t.escape, t.special(t.string)], + color: '#8f3f71', + }, + { tag: [t.meta], color: '#b57614' }, + { tag: [t.comment], color: '#928374', fontStyle: 'italic' }, + { tag: t.strong, fontWeight: 'bold', color: '#af3a03' }, + { tag: t.emphasis, fontStyle: 'italic', color: '#79740e' }, + { tag: t.strikethrough, textDecoration: 'line-through' }, + { tag: t.heading, fontWeight: 'bold', color: '#79740e' }, + { tag: [t.heading1, t.heading2], fontWeight: 'bold', color: '#79740e' }, + { + tag: [t.heading3, t.heading4], + fontWeight: 'bold', + color: '#b57614', + }, + { + tag: [t.heading5, t.heading6], + color: '#b57614', + }, + { tag: [t.atom, t.bool, t.special(t.variableName)], color: '#8f3f71' }, + { + tag: [t.processingInstruction, t.inserted], + color: '#076678', + }, + { + tag: [t.contentSeparator], + color: '#9d0006', + }, + { tag: t.invalid, color: '#af3a03', borderBottom: `1px dotted #9d0006` }, + ], +}); diff --git a/packages/codemirror/themes/materialDark.mjs b/packages/codemirror/themes/materialDark.mjs new file mode 100644 index 00000000..87d9b3c7 --- /dev/null +++ b/packages/codemirror/themes/materialDark.mjs @@ -0,0 +1,77 @@ +import { tags as t } from '@lezer/highlight'; +import { createTheme } from './theme-helper.mjs'; + +export const settings = { + background: '#2e3235', + lineBackground: '#2e323599', + foreground: '#bdbdbd', + caret: '#a0a4ae', + selection: '#d7d4f0', + selectionMatch: '#d7d4f0', + gutterBackground: '#2e3235', + gutterForeground: '#999', + gutterActiveForeground: '#4f5b66', + lineHighlight: '#545b61', +}; + +export default createTheme({ + theme: 'dark', + settings: { + background: '#2e3235', + foreground: '#bdbdbd', + caret: '#a0a4ae', + selection: '#d7d4f063', + selectionMatch: '#d7d4f063', + gutterBackground: '#2e3235', + gutterForeground: '#999', + gutterActiveForeground: '#4f5b66', + lineHighlight: '#545b6130', + }, + styles: [ + { tag: t.keyword, color: '#cf6edf' }, + { tag: [t.name, t.deleted, t.character, t.macroName], color: '#56c8d8' }, + { tag: [t.propertyName], color: '#facf4e' }, + { tag: [t.variableName], color: '#bdbdbd' }, + { tag: [t.function(t.variableName)], color: '#56c8d8' }, + { tag: [t.labelName], color: '#cf6edf' }, + { tag: [t.color, t.constant(t.name), t.standard(t.name)], color: '#facf4e' }, + { tag: [t.definition(t.name), t.separator], color: '#fa5788' }, + { tag: [t.brace], color: '#cf6edf' }, + { tag: [t.annotation], color: '#ff5f52' }, + { tag: [t.number, t.changed, t.annotation, t.modifier, t.self, t.namespace], color: '#ffad42' }, + { tag: [t.typeName, t.className], color: '#ffad42' }, + { tag: [t.operator, t.operatorKeyword], color: '#7186f0' }, + { tag: [t.tagName], color: '#99d066' }, + { tag: [t.squareBracket], color: '#ff5f52' }, + { tag: [t.angleBracket], color: '#606f7a' }, + { tag: [t.attributeName], color: '#bdbdbd' }, + { tag: [t.regexp], color: '#ff5f52' }, + { tag: [t.quote], color: '#6abf69' }, + { tag: [t.string], color: '#99d066' }, + { + tag: t.link, + color: '#56c8d8', + textDecoration: 'underline', + textUnderlinePosition: 'under', + }, + { tag: [t.url, t.escape, t.special(t.string)], color: '#facf4e' }, + { tag: [t.meta], color: '#707d8b' }, + { tag: [t.comment], color: '#707d8b', fontStyle: 'italic' }, + { tag: t.monospace, color: '#bdbdbd' }, + { tag: t.strong, fontWeight: 'bold', color: '#ff5f52' }, + { tag: t.emphasis, fontStyle: 'italic', color: '#99d066' }, + { tag: t.strikethrough, textDecoration: 'line-through' }, + { tag: t.heading, fontWeight: 'bold', color: '#facf4e' }, + { tag: t.heading1, fontWeight: 'bold', color: '#facf4e' }, + { + tag: [t.heading2, t.heading3, t.heading4], + fontWeight: 'bold', + color: '#facf4e', + }, + { tag: [t.heading5, t.heading6], color: '#facf4e' }, + { tag: [t.atom, t.bool, t.special(t.variableName)], color: '#56c8d8' }, + { tag: [t.processingInstruction, t.inserted], color: '#ff5f52' }, + { tag: [t.contentSeparator], color: '#56c8d8' }, + { tag: t.invalid, color: '#606f7a', borderBottom: `1px dotted #ff5f52` }, + ], +}); diff --git a/packages/codemirror/themes/materialLight.mjs b/packages/codemirror/themes/materialLight.mjs new file mode 100644 index 00000000..d2598c64 --- /dev/null +++ b/packages/codemirror/themes/materialLight.mjs @@ -0,0 +1,52 @@ +import { tags as t } from '@lezer/highlight'; +import { createTheme } from './theme-helper.mjs'; + +export const settings = { + light: true, + background: '#FAFAFA', + lineBackground: '#FAFAFA99', + foreground: '#90A4AE', + caret: '#272727', + selection: '#80CBC440', + selectionMatch: '#FAFAFA', + gutterBackground: '#FAFAFA', + gutterForeground: '#90A4AE', + gutterBorder: 'transparent', + lineHighlight: '#CCD7DA50', +}; +export default createTheme({ + theme: 'light', + settings: { + background: '#FAFAFA', + foreground: '#90A4AE', + caret: '#272727', + selection: '#80CBC440', + selectionMatch: '#80CBC440', + gutterBackground: '#FAFAFA', + gutterForeground: '#90A4AE', + gutterBorder: 'transparent', + lineHighlight: '#CCD7DA50', + }, + styles: [ + { tag: t.keyword, color: '#39ADB5' }, + { tag: [t.name, t.deleted, t.character, t.macroName], color: '#90A4AE' }, + { tag: [t.propertyName], color: '#6182B8' }, + { tag: [t.processingInstruction, t.string, t.inserted, t.special(t.string)], color: '#91B859' }, + { tag: [t.function(t.variableName), t.labelName], color: '#6182B8' }, + { tag: [t.color, t.constant(t.name), t.standard(t.name)], color: '#39ADB5' }, + { tag: [t.definition(t.name), t.separator], color: '#90A4AE' }, + { tag: [t.className], color: '#E2931D' }, + { tag: [t.number, t.changed, t.annotation, t.modifier, t.self, t.namespace], color: '#F76D47' }, + { tag: [t.typeName], color: '#E2931D', fontStyle: '#E2931D' }, + { tag: [t.operator, t.operatorKeyword], color: '#39ADB5' }, + { tag: [t.url, t.escape, t.regexp, t.link], color: '#91B859' }, + { tag: [t.meta, t.comment], color: '#90A4AE' }, + { tag: t.strong, fontWeight: 'bold' }, + { tag: t.emphasis, fontStyle: 'italic' }, + { tag: t.link, textDecoration: 'underline' }, + { tag: t.heading, fontWeight: 'bold', color: '#39ADB5' }, + { tag: [t.atom, t.bool, t.special(t.variableName)], color: '#90A4AE' }, + { tag: t.invalid, color: '#E5393570' }, + { tag: t.strikethrough, textDecoration: 'line-through' }, + ], +});