Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

225
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda