Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
How to customize Monaco syntax highlighting using functions?

I want to enable the end user to customize the syntax highlighting of the Monaco editor. I know there's defineTheme but I want individual functions for each part of the Monaco colors like the code I have below.

SetBackground = function(background) {
                monaco.editor.defineTheme('Custom', {
                base: 'vs-dark',
                inherit: false,
                rules: [],
                colors: {
                    'editor.background': `#${background}`,
                }
                });
            }

This code works for setting the background but when I use my other function for setting the foreground the background reverts to that of vs-dark. Is there any way to write functions like these that add on to an existing theme and update it using user input?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You should keep your theme as a whole in memory and modify it with your function calls. At the end of all the modifier functions set your theme in monaco-editor.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!