Microsoft/monaco-editor

[Feature Request] Colorizing with a specific theme

Open

#3,302 建立於 2022年9月8日

在 GitHub 查看
 (0 留言) (1 反應) (0 負責人)JavaScript (1,283 fork)batch import
feature-requesthelp wantedtokenization

倉庫指標

Star
 (14,836 star)
PR 合併指標
 (平均合併 6小時 26分鐘) (30 天內合併 15 個 PR)

描述

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.

貢獻者指南