@uiw/codemirror-theme-xcode
TypeScript icon, indicating that this package has built-in type declarations

4.23.6 • Public • Published

Xcode Theme

Buy me a coffee npm version

codemirror-theme-xcode dark codemirror-theme-xcode light

Install

npm install @uiw/codemirror-theme-xcode --save
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { xcodeLight, xcodeDark } from '@uiw/codemirror-theme-xcode';

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

Using in React:

import { xcodeLight, xcodeLightInit, xcodeDark, xcodeDarkInit } from '@uiw/codemirror-theme-xcode';

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

API

import { CreateThemeOptions } from '@uiw/codemirror-themes';
export declare const defaultSettingsXcodeLight: CreateThemeOptions['settings'];
export declare function xcodeLightInit(options?: Partial<CreateThemeOptions>): import('@codemirror/state').Extension;
export declare const xcodeLight: import('@codemirror/state').Extension;
export declare const defaultSettingsXcodeDark: CreateThemeOptions['settings'];
export declare const xcodeDarkInit: (options?: Partial<CreateThemeOptions>) => import('@codemirror/state').Extension;
export declare const xcodeDark: import('@codemirror/state').Extension;

Usage

import CodeMirror from '@uiw/react-codemirror';
import { xcodeLight, xcodeDark } from '@uiw/codemirror-theme-xcode';
import { javascript } from '@codemirror/lang-javascript';

function App() {
  return (
    <CodeMirror
      value="console.log('hello world!');"
      height="200px"
      theme={xcodeLight}
      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 { xcodeLight, xcodeDark } from '@uiw/codemirror-theme-xcode';

const state = EditorState.create({
  doc: 'my source code',
  extensions: [xcodeDark, 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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
4.23.6
5,231latest

Version History

VersionDownloads (Last 7 Days)Published
4.23.6
5,231
4.23.5
388
4.23.4
211
4.23.3
367
4.23.2
110
4.23.1
17
4.23.0
773
4.22.2
229
4.22.1
117
4.22.0
405
4.21.25
853
4.21.24
27
4.21.23
2
4.21.22
71
4.21.21
248
4.21.20
82
4.21.19
1
4.21.18
3
4.21.174
4.21.161
4.21.152
4.21.142
4.21.131
4.21.123
4.21.118
4.21.101
4.21.911
4.21.81
4.21.71
4.21.60
4.21.52
4.21.42
4.21.31
4.21.29
4.21.16
4.21.02
4.20.41
4.20.31
4.20.221
4.20.11
4.20.01
4.19.16713
4.19.156
4.19.142
4.19.131
4.19.122
4.19.114
4.19.101
4.19.93
4.19.81
4.19.71
4.19.61
4.19.51
4.19.41
4.19.31
4.19.22
4.19.11
4.19.01
4.18.20
4.18.11
4.18.02
4.17.11
4.17.01
4.16.01
4.15.15
4.15.02
4.14.31
4.14.21
4.14.11
4.14.01
4.13.20
4.13.11
4.13.07
4.12.440
4.12.320
4.12.22
4.12.11
4.12.01
4.11.61
4.11.51
4.11.42
4.11.31
4.11.21
4.11.14
4.11.01
4.10.4202

Package Sidebar

Install

npm i @uiw/codemirror-theme-xcode

Weekly Downloads

10,261

Version

4.23.6

License

MIT

Unpacked Size

14.3 kB

Total Files

7

Last publish

Collaborators

  • uiwjs
  • wcjiang