Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions redisinsight/ui/src/constants/monaco/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,39 @@ export const lightTheme: monaco.editor.IStandaloneThemeData = {
rules: lightThemeRules,
colors: {}
}

export const redisearchDarKThemeRules = [
{ token: 'keyword', foreground: '#8094B1', fontStyle: 'bold' },
{ token: 'argument.block.0', foreground: '#BDE8D7' },
{ token: 'argument.block.1', foreground: '#8CD7B9' },
{ token: 'argument.block.2', foreground: '#5BC69B' },
{ token: 'argument.block.3', foreground: '#3A8365' },
{ token: 'argument.block.withToken.0', foreground: '#BDE8D7' },
{ token: 'argument.block.withToken.1', foreground: '#8CD7B9' },
{ token: 'argument.block.withToken.2', foreground: '#5BC69B' },
{ token: 'argument.block.withToken.3', foreground: '#3A8365' },
{ token: 'loadAll', foreground: '#BDE8D7' },
{ token: 'index', foreground: '#DE47BB' },
{ token: 'query', foreground: '#7B90E0' },
{ token: 'field', foreground: '#B02C30' },
{ token: 'query.operator', foreground: '#B9F0F3' },
{ token: 'function', foreground: '#9E7EE8' },
]

export const redisearchLightThemeRules = [
{ token: 'keyword', foreground: '#8094B1', fontStyle: 'bold' },
{ token: 'argument.block.0', foreground: '#BDE8D7' },
{ token: 'argument.block.1', foreground: '#8CD7B9' },
{ token: 'argument.block.2', foreground: '#5BC69B' },
{ token: 'argument.block.3', foreground: '#3A8365' },
{ token: 'argument.block.withToken.0', foreground: '#BDE8D7' },
{ token: 'argument.block.withToken.1', foreground: '#8CD7B9' },
{ token: 'argument.block.withToken.2', foreground: '#5BC69B' },
{ token: 'argument.block.withToken.3', foreground: '#3A8365' },
{ token: 'loadAll', foreground: '#BDE8D7' },
{ token: 'index', foreground: '#DE47BB' },
{ token: 'query', foreground: '#7B90E0' },
{ token: 'field', foreground: '#B02C30' },
{ token: 'query.operator', foreground: '#B9F0F3' },
{ token: 'function', foreground: '#9E7EE8' },
]
37 changes: 3 additions & 34 deletions redisinsight/ui/src/utils/monaco/monacoThemes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { monaco as monacoEditor } from 'react-monaco-editor'
import { redisearchDarKThemeRules, redisearchLightThemeRules } from 'uiSrc/constants/monaco'

export enum RedisearchMonacoTheme {
dark = 'redisearchDarkTheme',
Expand All @@ -9,46 +10,14 @@ export const installRedisearchTheme = () => {
monacoEditor.editor.defineTheme(RedisearchMonacoTheme.dark, {
base: 'vs-dark',
inherit: true,
rules: [
{ token: 'keyword', foreground: '#569cd6', fontStyle: 'bold' },
{ token: 'argument.block.0', foreground: '#66ccaf' },
{ token: 'argument.block.1', foreground: '#459d7f' },
{ token: 'argument.block.2', foreground: '#3c816a' },
{ token: 'argument.block.3', foreground: '#28644f' },
{ token: 'argument.block.withToken.0', foreground: '#66ccaf' },
{ token: 'argument.block.withToken.1', foreground: '#459d7f' },
{ token: 'argument.block.withToken.2', foreground: '#3c816a' },
{ token: 'argument.block.withToken.3', foreground: '#28644f' },
{ token: 'loadAll', foreground: '#6db9a2' },
{ token: 'index', foreground: '#ce51cc' },
{ token: 'query', foreground: '#5183ce' },
{ token: 'field', foreground: '#c43265' },
{ token: 'query.operator', foreground: '#a4e7df' },
{ token: 'function', foreground: '#aa58d2' },
],
rules: redisearchDarKThemeRules,
colors: {}
})

monacoEditor.editor.defineTheme(RedisearchMonacoTheme.light, {
base: 'vs',
inherit: true,
rules: [
{ token: 'keyword', foreground: '#569cd6', fontStyle: 'bold' },
{ token: 'argument.block.0', foreground: '#66ccaf' },
{ token: 'argument.block.1', foreground: '#459d7f' },
{ token: 'argument.block.2', foreground: '#3c816a' },
{ token: 'argument.block.3', foreground: '#28644f' },
{ token: 'argument.block.withToken.0', foreground: '#66ccaf' },
{ token: 'argument.block.withToken.1', foreground: '#459d7f' },
{ token: 'argument.block.withToken.2', foreground: '#3c816a' },
{ token: 'argument.block.withToken.3', foreground: '#28644f' },
{ token: 'loadAll', foreground: '#6db9a2' },
{ token: 'index', foreground: '#ce51cc' },
{ token: 'field', foreground: '#5183ce' },
{ token: 'field', foreground: '#c43265' },
{ token: 'query.operator', foreground: '#a4e7df' },
{ token: 'function', foreground: '#aa58d2' },
],
rules: redisearchLightThemeRules,
colors: {}
})
}