Monaco-editor: Load css for colorizing an element or a string, without an editor.

Created on 30 Apr 2020  路  3Comments  路  Source: microsoft/monaco-editor

As clearly seen on the playground:
https://microsoft.github.io/monaco-editor/playground.html#creating-the-editor-syntax-highlighting-for-html-elements

The element is "colorized", but it lacks the appropriate styles to show said colorization. This is due to the fact that without an editor there is no call to StandaloneThemeServiceImpl.registerEditorContainer, which creates the monaco-colors style.

Allowing us to some how call the function to generate said style will also allow us to utilize the syntax highlighting feature of monaco-editor in places where we only want to colorize code.

*duplicate bug

Most helpful comment

Is there any plan on making it possible? Without this feature, monaco.editor.colorize is useless without the actual editor in the same page.

All 3 comments

Is there any plan on making it possible? Without this feature, monaco.editor.colorize is useless without the actual editor in the same page.

Note: one can create a page with the editor, copy the css, add said css to whatever page that uses monaco.editor.colorize. The only downside to said method is that one must remember to do said thing any time the editor is updated, incase something in the css is added or changed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Kang-Jun-sik picture Kang-Jun-sik  路  3Comments

zeegin picture zeegin  路  3Comments

akosyakov picture akosyakov  路  3Comments

andreymarchenko picture andreymarchenko  路  3Comments

ststeiger picture ststeiger  路  3Comments