Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for themes #2 #263

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anjerodev
Copy link
Contributor

This is a second attempt to implement different themes into codi.link.

I’ve tried to keep things as simple and clear as possible. Unfortunately, Monaco Editor’s syntax highlighting isn’t as complete as VSCode’s. I initially went with monaco-themes since it’s probably the simplest way to implement themes, but a lot of syntax wasn’t being applied correctly. Because of that, I switched to monaco-editor-textmate. It adds a bit more complexity, but works significantly better.

Adding themes

This PR keeps the existing default themes and adds three more: GitHub Dark, One Dark Pro, and Dracula, just to see that there is no conflicts. If everything works well, we can add more.

VSCode .json theme files don’t work directly with Monaco. They need to be transformed using a tool like monaco-vscode-textmate-theme-converter. I did this manually for the new themes. Not exactly fun.

Best method I found: open the theme on vscodethemes using VSCode web, then run Developer: Generate Color Theme From Current Settings to extract the full .json. After that, run it through the converter tool to get a Monaco-compatible version. It is quite tedious, maybe we can come up with a better or more automated flow.

New themes preview

Screen.Recording.2025-04-05.at.17.53.44.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant