Skip to content

Commit

Permalink
feat: change background color for editor in light theme
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianoventura committed Sep 19, 2024
1 parent c689b17 commit e170a31
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Monaco/ReactMonacoEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function ReactMonacoEditor(props: EditorProps) {
<Editor
{...props}
options={{ ...defaultOptions, ...props.options }}
theme={theme === 'dark' ? 'vs-dark' : 'vs'}
theme={theme === 'dark' ? 'vs-dark' : 'k6-studio-light'}
/>
)
}
12 changes: 12 additions & 0 deletions src/components/Monaco/themes/k6StudioLight.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import * as monaco from 'monaco-editor'

export const k6StudioLightBackground = '#fafafa'

monaco.editor.defineTheme('k6-studio-light', {
base: 'vs',
inherit: true,
rules: [],
colors: {
'editor.background': k6StudioLightBackground,
},
})
3 changes: 2 additions & 1 deletion src/components/WebLogView/ResponseDetails/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ReadOnlyEditor } from '../../Monaco/ReadOnlyEditor'
import ReactJson from '@microlink/react-json-view'
import { Font } from './Font'
import { useTheme } from '@/hooks/useTheme'
import { k6StudioLightBackground } from '@/components/Monaco/themes/k6StudioLight'

interface PreviewProps {
content: string
Expand Down Expand Up @@ -80,5 +81,5 @@ const reactJsonDarkStyles = {

const reactJsonLightStyles = {
...reactJsonStyles,
background: '#fff',
background: k6StudioLightBackground,
}

0 comments on commit e170a31

Please sign in to comment.