@fsegurai/codemirror-theme-monokai

中文文档
6.3.0发布于 2026/11/13MITTypeScriptESM + CJS零依赖近 30 天下载 3.2万

Monokai theme for the CodeMirror editor

原始使用文档
文档目录7 节
  1. Table of contents
  2. Installation
  3. @fsegurai/codemirror-theme-monokai
  4. Using Theme
  5. Available Themes
  6. Demo Application
  7. License

CodeMirror 6 Themes Logo

Test Status Latest Release Total npm downloads
GitHub contributors Dependency status for repo GitHub License
Stars Forks

A library of custom themes for CodeMirror 6.

@fsegurai/codemirror-theme-monokai is a theme for CodeMirror 6 editor, making it visually engaging and adaptable to different coding styles and user preferences.

Table of contents

Installation

@fsegurai/codemirror-theme-monokai

To add @fsegurai/codemirror-theme-monokai along with CodeMirror 6 to your package.json use the following commands.

bun install @fsegurai/codemirror-theme-monokai codemirror@^6.0.0 --save

Using Theme

Import the respective theme from the package and apply it to your CodeMirror instance as shown below.

import { EditorView, basicSetup } from 'codemirror'
import { markdown } from '@codemirror/lang-markdown'
import { monokai } from '@fsegurai/codemirror-theme-monokai'

let editor = new EditorView({
  doc: '# Hello World',
  extensions: [
    basicSetup,
    markdown(),
    monokai
  ],
  parent: document.body
})

Read the CodeMirror documentation for more details about themes.

Available Themes

ThemePackageVersionDownloads
Abcdef@fsegurai/codemirror-theme-abcdefnpmdownloads
Abyss@fsegurai/codemirror-theme-abyssnpmdownloads
Android Studio@fsegurai/codemirror-theme-android-studionpmdownloads
Andromeda@fsegurai/codemirror-theme-andromedanpmdownloads
Basic Dark@fsegurai/codemirror-theme-basic-darknpmdownloads
Basic Light@fsegurai/codemirror-theme-basic-lightnpmdownloads
All - Bundle@fsegurai/codemirror-theme-bundlenpmdownloads
Catppuccin Latte@fsegurai/codemirror-theme-catppuccin-lattenpmdownloads
Catppuccin Mocha@fsegurai/codemirror-theme-catppuccin-mochanpmdownloads
Cobalt2@fsegurai/codemirror-theme-cobalt2npmdownloads
Dracula@fsegurai/codemirror-theme-draculanpmdownloads
Forest@fsegurai/codemirror-theme-forestnpmdownloads
GitHub Dark@fsegurai/codemirror-theme-github-darknpmdownloads
GitHub Light@fsegurai/codemirror-theme-github-lightnpmdownloads
Gruvbox Dark@fsegurai/codemirror-theme-gruvbox-darknpmdownloads
Gruvbox Light@fsegurai/codemirror-theme-gruvbox-lightnpmdownloads
High Contrast Dark@fsegurai/codemirror-theme-high-contrast-darknpmdownloads
High Contrast Light@fsegurai/codemirror-theme-high-contrast-lightnpmdownloads
Material Dark@fsegurai/codemirror-theme-material-darknpmdownloads
Material Light@fsegurai/codemirror-theme-material-lightnpmdownloads
Material Ocean@fsegurai/codemirror-theme-material-oceannpmdownloads
Monokai@fsegurai/codemirror-theme-monokainpmdownloads
Nord@fsegurai/codemirror-theme-nordnpmdownloads
One Dark@fsegurai/codemirror-theme-one-darknpmdownloads
Palenight@fsegurai/codemirror-theme-palenightnpmdownloads
Rosé Pine Dawn@fsegurai/codemirror-theme-rose-pine-dawnnpmdownloads
Solarized Dark@fsegurai/codemirror-theme-solarized-darknpmdownloads
Solarized Light@fsegurai/codemirror-theme-solarized-lightnpmdownloads
Synthwave 84@fsegurai/codemirror-theme-synthwave-84npmdownloads
Tokyo Night Day@fsegurai/codemirror-theme-tokyo-night-daynpmdownloads
Tokyo Night Storm@fsegurai/codemirror-theme-tokyo-night-stormnpmdownloads
Volcano@fsegurai/codemirror-theme-volcanonpmdownloads
VS Code Dark@fsegurai/codemirror-theme-vscode-darknpmdownloads
VS Code Light@fsegurai/codemirror-theme-vscode-lightnpmdownloads

Demo Application

To see all themes in action, check out the demo: https://fsegurai.github.io/codemirror-themes.

To set up the demo locally:

git clone https://github.com/fsegurai/codemirror-themes.git
bun install
bun start

This will serve the application locally at http://[::1]:8000.

License

Licensed under MIT.

版本与发布记录

@fsegurai/codemirror-theme-monokai 共发布 25 个版本,首次发布于 2024/04/30;过去 12 个月发布了 5 个版本。

版本发布日期距今
6.3.0latest2026/11/132 天前
6.2.72026/09/052 个月前
6.2.52026/04/067 个月前
6.2.42026/04/037 个月前
6.2.32025/12/0311 个月前
6.2.22025/08/121.3 年前

其他发布通道:beta → 6.2.0-beta.5。

关于 @fsegurai/codemirror-theme-monokai 的常见问题

@fsegurai/codemirror-theme-monokai 是什么?

Monokai theme for the CodeMirror editor

如何安装 @fsegurai/codemirror-theme-monokai?

在项目目录运行 npm install @fsegurai/codemirror-theme-monokai,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@codemirror/view(^6.0.0)、@lezer/highlight(^1.0.0)、@codemirror/state(^6.0.0)、@codemirror/language(^6.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@fsegurai/codemirror-theme-monokai 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@fsegurai/codemirror-theme-monokai 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@fsegurai/codemirror-theme-monokai 可以商用吗?

@fsegurai/codemirror-theme-monokai 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fsegurai/codemirror-theme-monokai 的下载量有多少?

根据 npm 官方下载统计,@fsegurai/codemirror-theme-monokai 在 2026/10/16 – 2026/11/14 这 30 天内被下载 31,575 次,日均约 1,053 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fsegurai/codemirror-theme-monokai 还在维护吗?

最新版本 6.3.0 发布于 2026/11/13(2 天前);至今共发布 25 个版本,其中过去 12 个月发布了 5 个;首次发布于 2024/04/30。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。