@fsegurai/codemirror-theme-vscode-dark
v6.5.0
Published
VSCode Dark theme for the CodeMirror editor
Maintainers
Readme
A library of custom themes for CodeMirror 6.
@fsegurai/codemirror-theme-vscode-dark 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-vscode-dark
To add @fsegurai/codemirror-theme-vscode-dark along with CodeMirror 6 to your package.json use the following commands.
bun install @fsegurai/codemirror-theme-vscode-dark codemirror@^6.0.0 --saveUsing 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 { vsCodeDark } from '@fsegurai/codemirror-theme-vscode-dark'
let editor = new EditorView({
doc: '# Hello World',
extensions: [
basicSetup,
markdown(),
vsCodeDark
],
parent: document.body
})Read the CodeMirror documentation for more details about themes.
Reading the Palette
The package also exports the plain-data definition the theme is built from, so an app can read its colors without evaluating the built files. An app that imports only the theme above does not bundle the export (it is tree-shaken).
import { vsCodeDarkDefinition } from '@fsegurai/codemirror-theme-vscode-dark'
vsCodeDarkDefinition.dark // boolean
vsCodeDarkDefinition.ui.background // '#rrggbb'
vsCodeDarkDefinition.syntax.comment // { color: '#rrggbb', ... }
vsCodeDarkDefinition.pair // package folder of the light/dark counterpart, when the theme has oneThe bundle package also exports themeDefinitions (every definition by package folder name) and themePairs (the
natural [light, dark] pairs). To check the contrast of a definition, see contrastReport in
@fsegurai/codemirror-theme-core.
Available Themes
| Theme | Package | Version | Downloads |
|-------|---------|---------|-----------|
| Abcdef | @fsegurai/codemirror-theme-abcdef | |
|
| Abyss | @fsegurai/codemirror-theme-abyss |
|
|
| Android Studio | @fsegurai/codemirror-theme-android-studio |
|
|
| Andromeda | @fsegurai/codemirror-theme-andromeda |
|
|
| Basic Dark | @fsegurai/codemirror-theme-basic-dark |
|
|
| Basic Light | @fsegurai/codemirror-theme-basic-light |
|
|
| All - Bundle | @fsegurai/codemirror-theme-bundle |
|
|
| Catppuccin Latte | @fsegurai/codemirror-theme-catppuccin-latte |
|
|
| Catppuccin Mocha | @fsegurai/codemirror-theme-catppuccin-mocha |
|
|
| Cobalt2 | @fsegurai/codemirror-theme-cobalt2 |
|
|
| Dracula | @fsegurai/codemirror-theme-dracula |
|
|
| Forest | @fsegurai/codemirror-theme-forest |
|
|
| GitHub Dark | @fsegurai/codemirror-theme-github-dark |
|
|
| GitHub Light | @fsegurai/codemirror-theme-github-light |
|
|
| Gruvbox Dark | @fsegurai/codemirror-theme-gruvbox-dark |
|
|
| Gruvbox Light | @fsegurai/codemirror-theme-gruvbox-light |
|
|
| High Contrast Dark | @fsegurai/codemirror-theme-high-contrast-dark |
|
|
| High Contrast Light | @fsegurai/codemirror-theme-high-contrast-light |
|
|
| Material Dark | @fsegurai/codemirror-theme-material-dark |
|
|
| Material Light | @fsegurai/codemirror-theme-material-light |
|
|
| Material Ocean | @fsegurai/codemirror-theme-material-ocean |
|
|
| Monokai | @fsegurai/codemirror-theme-monokai |
|
|
| Nord | @fsegurai/codemirror-theme-nord |
|
|
| One Dark | @fsegurai/codemirror-theme-one-dark |
|
|
| Palenight | @fsegurai/codemirror-theme-palenight |
|
|
| Rosé Pine Dawn | @fsegurai/codemirror-theme-rose-pine-dawn |
|
|
| Solarized Dark | @fsegurai/codemirror-theme-solarized-dark |
|
|
| Solarized Light | @fsegurai/codemirror-theme-solarized-light |
|
|
| Synthwave 84 | @fsegurai/codemirror-theme-synthwave-84 |
|
|
| Tokyo Night Day | @fsegurai/codemirror-theme-tokyo-night-day |
|
|
| Tokyo Night Storm | @fsegurai/codemirror-theme-tokyo-night-storm |
|
|
| Volcano | @fsegurai/codemirror-theme-volcano |
|
|
| VS Code Dark | @fsegurai/codemirror-theme-vscode-dark |
|
|
| VS Code Light | @fsegurai/codemirror-theme-vscode-light |
|
|
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 startThis will serve the application locally at http://[::1]:8000.
License
Licensed under MIT.
