code-mirror-night-owl
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

code-mirror-night-owl

Night Owl Theme for codemirror 6, based on the Night Owl VS Code theme.

Install

npm install code-mirror-night-owl

Usage

Basic setup

import { EditorState } from "@codemirror/state";
import { EditorView } from "@codemirror/view";
import { javascript } from "@codemirror/lang-javascript";
import { nightOwl } from "code-mirror-night-owl/night-owl";

const state = EditorState.create({
  doc: "my source code",
  extensions: [javascript(), nightOwl],
});

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

Light theme

import { EditorState } from "@codemirror/state";
import { EditorView } from "@codemirror/view";
import { javascript } from "@codemirror/lang-javascript";
import { nightOwlLight } from "code-mirror-night-owl/night-owl-light";

const state = EditorState.create({
  doc: "my source code",
  extensions: [javascript(), nightOwl],
});

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

API Reference

nightOwl, nightOwlLight : Extension

Extension to enable the Night Owl and Night Owl Light theme (both the editor theme and the highlight style).

nightOwlTheme, nightOwlLightTheme : Extension

The editor theme styles for Night Owl.

nightOwlHighlightStyle , nightOwlLightHighlightStyle: HighlightStyle

The highlighting style for code in the Night Owl theme.

colors : Javascript Object

The colors used in the theme, as CSS color strings.

Readme

Keywords

Package Sidebar

Install

npm i code-mirror-night-owl

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

47.1 kB

Total Files

12

Last publish

Collaborators

  • johnnyair