microsoft / microsoft/monaco-editor

[Feature Request] Colorizing with a specific theme

Open
#3,302 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request help wanted tokenization
Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

Context
  • This issue is not a bug report. (please use a different template for reporting a bug)
  • This issue is not a duplicate of an existing issue. (please use the search to find existing issues)
Description

I see that colorizeElement supports being given a theme, but colorize doesn't.

I'd like to pass a specific theme to colorize as well, and have it write the styles inline in the output string, so that I can use different themes for different things at the same time.

Example use case: a github-like markdown editor, where the editor has a light theme just like the preview, but perhaps code blocks rendered in the preview use a dark theme, for better contrast and an arguably more interesting design choice.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the colorize and colorizeElement entry points and comparing how their theme arguments are handled. Done means colorize accepts a specific theme and returns output with inline styles, while allowing separately rendered snippets to use different themes; check the relevant colorization tests or examples once located.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
api, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.