Aminadav Glickshtein
Aminadav Glickshtein

Reputation: 24600

Is it possible to create an extension to vscode that changes the CSS of the editor?

I wish to develop an open-source WYSIWYG editor for markdown in vscode.

See the image below. I want an extension that can do something like that.

  1. Change font-sizes for lines for titles.
  2. Change lines indentation for subtitles.

I'm looking at the extension reference: https://code.visualstudio.com/api/references/vscode-api and don't see something that can help.

Do you have an idea how to change the CSS of the editor based on rules? in addition, If you have a link to extension that did it may help.

In other words: How a vscode extension can change css style of the editor window?

enter image description here

Upvotes: 3

Views: 418

Answers (1)

Matt Bierner
Matt Bierner

Reputation: 65303

You can't change arbitrary css in the editor. See the extension guide for info about the VS Code extension philosophy and how you can extend VS Code

Two options:

  • Use the decorations api to change rendering of tokens in the editor.

  • Use a webview to implement a custom view (but don't try re-implementing a text-editor because it will be a pain and will not work like VS Code's normal editors do)

Upvotes: 3

Related Questions