4.23.10 • Published 1 month ago

@uiw/codemirror-theme-vscode v4.23.10

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

VSCode Theme

Buy me a coffee npm version

Install

npm install @uiw/codemirror-theme-vscode --save
import { vscodeDark, vscodeDarkInit } from '@uiw/codemirror-theme-vscode';
import { vscodeLight, vscodeLightInit } from '@uiw/codemirror-theme-vscode';
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { vscodeDark, vscodeLight } from '@uiw/codemirror-theme-vscode';

const state = EditorState.create({
  doc: 'my source code',
  extensions: [vscodeDark, javascript({ jsx: true })],
});

Using in React:

import { vscodeDark, vscodeDarkInit } from '@uiw/codemirror-theme-vscode';

<CodeMirror theme={vscodeDark} />
<CodeMirror
  theme={vscodeDarkInit({
    settings: {
      caret: '#c6c6c6',
      fontFamily: 'monospace',
    }
  })}
/>

API

import { CreateThemeOptions } from '@uiw/codemirror-themes';
// Dark
export declare const defaultSettingsVscodeDark: CreateThemeOptions['settings'];
export declare function vscodeDarkInit(options?: Partial<CreateThemeOptions>): import('@codemirror/state').Extension;
export declare const vscodeDark: import('@codemirror/state').Extension;
// Light
export declare const defaultSettingsVscodeLight: CreateThemeOptions['settings'];
export declare function vscodeLightInit(options?: Partial<CreateThemeOptions>): import('@codemirror/state').Extension;
export declare const vscodeLight: import('@codemirror/state').Extension;

Usage

import CodeMirror from '@uiw/react-codemirror';
import { vscodeDark } from '@uiw/codemirror-theme-vscode';
import { javascript } from '@codemirror/lang-javascript';

function App() {
  return (
    <CodeMirror
      value="console.log('hello world!');"
      height="200px"
      theme={vscodeDark}
      extensions={[javascript({ jsx: true })]}
      onChange={(value, viewUpdate) => {
        console.log('value:', value);
      }}
    />
  );
}
export default App;
import { EditorView } from '@codemirror/view';
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { vscodeDark } from '@uiw/codemirror-theme-vscode';

const state = EditorState.create({
  doc: 'my source code',
  extensions: [vscodeDark, javascript({ jsx: true })],
});

const view = new EditorView({
  parent: document.querySelector('#editor'),
  state,
});

Contributors

As always, thanks to our amazing contributors!

Made with action-contributors.

License

Licensed under the MIT License.

4.23.10

1 month ago

4.23.8

2 months ago

4.23.9

1 month ago

4.23.7

4 months ago

4.23.6

5 months ago

4.23.4

6 months ago

4.23.5

6 months ago

4.23.1

7 months ago

4.23.2

7 months ago

4.23.3

6 months ago

4.23.0

9 months ago

4.22.2

10 months ago

4.22.1

11 months ago

4.22.0

11 months ago

4.21.25

1 year ago

4.21.24

1 year ago

4.21.23

1 year ago

4.21.22

1 year ago

4.21.11

2 years ago

4.21.10

2 years ago

4.21.13

2 years ago

4.21.12

2 years ago

4.21.19

2 years ago

4.21.18

2 years ago

4.21.15

2 years ago

4.21.14

2 years ago

4.21.17

2 years ago

4.21.16

2 years ago

4.21.9

2 years ago

4.21.8

2 years ago

4.21.21

1 year ago

4.21.20

1 year ago

4.21.6

2 years ago

4.21.7

2 years ago

4.21.4

2 years ago

4.21.5

2 years ago

4.21.1

2 years ago

4.20.2

2 years ago

4.21.2

2 years ago

4.20.3

2 years ago

4.21.3

2 years ago

4.20.4

2 years ago

4.20.0

2 years ago

4.21.0

2 years ago

4.20.1

2 years ago

4.19.14

2 years ago

4.19.13

2 years ago

4.19.12

2 years ago

4.19.11

2 years ago

4.19.10

2 years ago

4.19.16

2 years ago

4.19.15

2 years ago

4.19.8

2 years ago

4.19.9

2 years ago

4.19.5

2 years ago

4.19.6

2 years ago

4.19.7

2 years ago

4.19.3

2 years ago

4.19.4

2 years ago

4.19.0

2 years ago

4.18.1

2 years ago

4.19.1

2 years ago

4.18.2

2 years ago

4.19.2

2 years ago

4.16.0

2 years ago

4.17.0

2 years ago

4.18.0

2 years ago

4.17.1

2 years ago

4.15.1

2 years ago

4.15.0

2 years ago

4.14.3

2 years ago

4.14.2

2 years ago

4.14.1

2 years ago

4.14.0

2 years ago

4.13.2

2 years ago