From 27e8d04b908abfcbf4bbe42e0d30844e6182f8e4 Mon Sep 17 00:00:00 2001 From: Cristiano Ventura Date: Thu, 2 Jan 2025 13:34:41 -0500 Subject: [PATCH] set styles for light and dark themes --- src/components/Monaco/themes/k6StudioDark.ts | 18 ++++++++++++++++++ src/components/Monaco/themes/k6StudioLight.ts | 8 +++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/components/Monaco/themes/k6StudioDark.ts diff --git a/src/components/Monaco/themes/k6StudioDark.ts b/src/components/Monaco/themes/k6StudioDark.ts new file mode 100644 index 00000000..e335cacf --- /dev/null +++ b/src/components/Monaco/themes/k6StudioDark.ts @@ -0,0 +1,18 @@ +import * as monaco from 'monaco-editor' +import '../languages/log' + +export const k6StudioDarkBackground = '#1E1E1E' + +monaco.editor.defineTheme('k6-studio-dark', { + base: 'vs-dark', + inherit: true, + rules: [ + { token: 'error.log', foreground: '#CE9178', fontStyle: 'bold' }, + { token: 'stackTrace.log', foreground: '#CE9178', fontStyle: 'italic' }, + { token: 'timestamp.log', foreground: '#368F2E' }, + { token: 'string.log', foreground: '#CE9178' }, + ], + colors: { + 'editor.background': k6StudioDarkBackground, + }, +}) diff --git a/src/components/Monaco/themes/k6StudioLight.ts b/src/components/Monaco/themes/k6StudioLight.ts index 2d65c90c..f99f3bf3 100644 --- a/src/components/Monaco/themes/k6StudioLight.ts +++ b/src/components/Monaco/themes/k6StudioLight.ts @@ -1,11 +1,17 @@ import * as monaco from 'monaco-editor' +import '../languages/log' export const k6StudioLightBackground = '#fafafa' monaco.editor.defineTheme('k6-studio-light', { base: 'vs', inherit: true, - rules: [], + rules: [ + { token: 'error.log', foreground: '#A6201E', fontStyle: 'bold' }, + { token: 'stackTrace.log', foreground: '#A6201E', fontStyle: 'italic' }, + { token: 'timestamp.log', foreground: '#368F2E' }, + { token: 'string.log', foreground: '#A6201E' }, + ], colors: { 'editor.background': k6StudioLightBackground, },