question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Theme Rules not working for Custom Theme

See original GitHub issue

Steps to reproduce:

image


// Theme matching (i.e. applying a style to a token) happens in JavaScript.
// We must therefore register the theme rules in JavaScript.

// A custom theme must name its base theme (i.e. 'vs', 'vs-dark' or 'hc-black')
// It can then choose to inherit the rules from the base theme or not
// A rule token matching is prefix based: e.g.
//  - string will match a token with type: string, string.double.js or string.html
//  - string.double will match a token with type string.double but will not match string or string.html

// !!! Tokens can be inspected using F1 > Developer: Inspect Tokens !!!

monaco.editor.defineTheme('myCustomTheme', {
    "inherit":false,
    "base":"vs-dark",
    "colors":{
       "activityBar.background":"#090b10",
       "activityBar.border":"#00000060",
       "activityBar.foreground":"#8f93a2",
       "activityBarBadge.background":"#80cbc4",
       "activityBarBadge.foreground":"#000000",
       "badge.background":"#00000030",
       "badge.foreground":"#464b5d",
       "breadcrumb.activeSelectionForeground":"#80cbc4",
       "breadcrumb.background":"#0f111a",
       "breadcrumb.focusForeground":"#8f93a2",
       "breadcrumb.foreground":"#4b526d",
       "breadcrumbPicker.background":"#090b10",
       "button.background":"#717cb450",
       "debugToolBar.background":"#0f111a",
       "diffEditor.insertedTextBackground":"#c3e88d15",
       "diffEditor.removedTextBackground":"#ff537020",
       "dropdown.background":"#0f111a",
       "dropdown.border":"#ffffff10",
       "editor.background":"#0f111a",
       "editor.findMatchBackground":"#000000",
       "editor.findMatchBorder":"#80cbc4",
       "editor.findMatchHighlightBackground":"#00000050",
       "editor.findMatchHighlightBorder":"#ffffff50",
       "editor.foreground":"#8f93a2",
       "editor.lineHighlightBackground":"#00000050",
       "editor.selectionBackground":"#717cb450",
       "editor.selectionHighlightBackground":"#ffcc0020",
       "editorBracketMatch.background":"#0f111a",
       "editorBracketMatch.border":"#ffcc0050",
       "editorCursor.foreground":"#ffcc00",
       "editorError.foreground":"#ff537070",
       "editorGroup.border":"#00000030",
       "editorGroupHeader.tabsBackground":"#0f111a",
       "editorGutter.addedBackground":"#c3e88d60",
       "editorGutter.deletedBackground":"#ff537060",
       "editorGutter.modifiedBackground":"#82aaff60",
       "editorHoverWidget.background":"#0f111a",
       "editorHoverWidget.border":"#ffffff10",
       "editorIndentGuide.activeBackground":"#3b3f51",
       "editorIndentGuide.background":"#3b3f5170",
       "editorInfo.foreground":"#82aaff70",
       "editorLineNumber.activeForeground":"#4b526d",
       "editorLineNumber.foreground":"#3b3f5180",
       "editorLink.activeForeground":"#8f93a2",
       "editorMarkerNavigation.background":"#8f93a205",
       "editorOverviewRuler.border":"#0f111a",
       "editorOverviewRuler.errorForeground":"#ff537040",
       "editorOverviewRuler.findMatchForeground":"#80cbc4",
       "editorOverviewRuler.infoForeground":"#82aaff40",
       "editorOverviewRuler.warningForeground":"#ffcb6b40",
       "editorRuler.foreground":"#3b3f51",
       "editorSuggestWidget.background":"#0f111a",
       "editorSuggestWidget.border":"#ffffff10",
       "editorSuggestWidget.foreground":"#8f93a2",
       "editorSuggestWidget.highlightForeground":"#80cbc4",
       "editorSuggestWidget.selectedBackground":"#00000050",
       "editorWarning.foreground":"#ffcb6b70",
       "editorWhitespace.foreground":"#8f93a240",
       "editorWidget.background":"#090b10",
       "editorWidget.border":"#ff0000",
       "editorWidget.resizeBorder":"#80cbc4",
       "extensionButton.prominentBackground":"#c3e88d90",
       "extensionButton.prominentHoverBackground":"#c3e88d",
       "focusBorder":"#ffffff00",
       "gitDecoration.conflictingResourceForeground":"#ffcb6b90",
       "gitDecoration.deletedResourceForeground":"#ff537090",
       "gitDecoration.ignoredResourceForeground":"#4b526d90",
       "gitDecoration.modifiedResourceForeground":"#82aaff90",
       "gitDecoration.untrackedResourceForeground":"#c3e88d90",
       "input.background":"#1a1c25",
       "input.border":"#ffffff10",
       "input.foreground":"#eeffff",
       "input.placeholderForeground":"#8f93a260",
       "inputOption.activeBackground":"#8f93a230",
       "inputOption.activeBorder":"#8f93a230",
       "inputValidation.errorBorder":"#ff537050",
       "inputValidation.infoBorder":"#82aaff50",
       "inputValidation.warningBorder":"#ffcb6b50",
       "list.activeSelectionBackground":"#090b10",
       "list.activeSelectionForeground":"#80cbc4",
       "list.focusBackground":"#8f93a220",
       "list.focusForeground":"#8f93a2",
       "list.highlightForeground":"#80cbc4",
       "list.hoverBackground":"#090b10",
       "list.hoverForeground":"#ffffff",
       "list.inactiveSelectionBackground":"#00000030",
       "list.inactiveSelectionForeground":"#80cbc4",
       "listFilterWidget.background":"#00000030",
       "listFilterWidget.noMatchesOutline":"#00000030",
       "listFilterWidget.outline":"#00000030",
       "menu.background":"#0f111a",
       "menu.foreground":"#8f93a2",
       "menu.selectionBackground":"#00000050",
       "menu.selectionBorder":"#00000030",
       "menu.selectionForeground":"#80cbc4",
       "menu.separatorBackground":"#8f93a2",
       "menubar.selectionBackground":"#00000030",
       "menubar.selectionBorder":"#00000030",
       "menubar.selectionForeground":"#80cbc4",
       "notificationLink.foreground":"#80cbc4",
       "notifications.background":"#0f111a",
       "notifications.foreground":"#8f93a2",
       "panel.background":"#090b10",
       "panel.border":"#00000060",
       "panelTitle.activeBorder":"#80cbc4",
       "panelTitle.activeForeground":"#ffffff",
       "panelTitle.inactiveForeground":"#8f93a2",
       "peekView.border":"#00000030",
       "peekViewEditor.background":"#8f93a205",
       "peekViewEditor.matchHighlightBackground":"#717cb450",
       "peekViewEditorGutter.background":"#8f93a205",
       "peekViewResult.background":"#8f93a205",
       "peekViewResult.matchHighlightBackground":"#717cb450",
       "peekViewResult.selectionBackground":"#4b526d70",
       "peekViewTitle.background":"#8f93a205",
       "peekViewTitleDescription.foreground":"#8f93a260",
       "pickerGroup.foreground":"#80cbc4",
       "progressBar.background":"#80cbc4",
       "scrollbar.shadow":"#0f111a00",
       "scrollbarSlider.activeBackground":"#80cbc4",
       "scrollbarSlider.background":"#8f93a220",
       "scrollbarSlider.hoverBackground":"#8f93a210",
       "selection.background":"#80cbc4",
       "settings.checkboxBackground":"#090b10",
       "settings.checkboxForeground":"#8f93a2",
       "settings.dropdownBackground":"#090b10",
       "settings.dropdownForeground":"#8f93a2",
       "settings.headerForeground":"#80cbc4",
       "settings.modifiedItemIndicator":"#80cbc4",
       "settings.numberInputBackground":"#090b10",
       "settings.numberInputForeground":"#8f93a2",
       "settings.textInputBackground":"#090b10",
       "settings.textInputForeground":"#8f93a2",
       "sideBar.background":"#090b10",
       "sideBar.border":"#00000060",
       "sideBar.foreground":"#4b526d",
       "sideBarSectionHeader.background":"#090b10",
       "sideBarSectionHeader.border":"#00000060",
       "sideBarTitle.foreground":"#8f93a2",
       "statusBar.background":"#090b10",
       "statusBar.border":"#00000060",
       "statusBar.debuggingBackground":"#c792ea",
       "statusBar.debuggingForeground":"#ffffff",
       "statusBar.foreground":"#4b526d",
       "statusBar.noFolderBackground":"#0f111a",
       "statusBarItem.hoverBackground":"#464b5d20",
       "statusBarItem.remoteBackground":"#80cbc4",
       "statusBarItem.remoteForeground":"#000000",
       "tab.activeBorder":"#80cbc4",
       "tab.activeForeground":"#ffffff",
       "tab.activeModifiedBorder":"#4b526d",
       "tab.border":"#0f111a",
       "tab.inactiveBackground":"#0f111a",
       "tab.inactiveForeground":"#4b526d",
       "tab.unfocusedActiveBorder":"#464b5d",
       "tab.unfocusedActiveForeground":"#8f93a2",
       "terminal.ansiBlack":"#000000",
       "terminal.ansiBlue":"#82aaff",
       "terminal.ansiBrightBlack":"#464b5d",
       "terminal.ansiBrightBlue":"#82aaff",
       "terminal.ansiBrightCyan":"#89ddff",
       "terminal.ansiBrightGreen":"#c3e88d",
       "terminal.ansiBrightMagenta":"#c792ea",
       "terminal.ansiBrightRed":"#ff5370",
       "terminal.ansiBrightWhite":"#ffffff",
       "terminal.ansiBrightYellow":"#ffcb6b",
       "terminal.ansiCyan":"#89ddff",
       "terminal.ansiGreen":"#c3e88d",
       "terminal.ansiMagenta":"#c792ea",
       "terminal.ansiRed":"#ff5370",
       "terminal.ansiWhite":"#ffffff",
       "terminal.ansiYellow":"#ffcb6b",
       "terminalCursor.background":"#000000",
       "terminalCursor.foreground":"#ffcb6b",
       "textLink.activeForeground":"#8f93a2",
       "textLink.foreground":"#80cbc4",
       "titleBar.activeBackground":"#090b10",
       "titleBar.activeForeground":"#8f93a2",
       "titleBar.border":"#00000060",
       "titleBar.inactiveBackground":"#090b10",
       "titleBar.inactiveForeground":"#4b526d",
       "tree.indentGuidesStroke":"#3b3f51",
       "widget.shadow":"#00000030"
    },
    "rules":[
       {
          "foreground":"#464B5D",
          "fontStyle":"italic",
          "token":"comment"
       },
       {
          "foreground":"#464B5D",
          "fontStyle":"italic",
          "token":"punctuation.definition.comment"
       },
       {
          "foreground":"#464B5D",
          "fontStyle":"italic",
          "token":"string.quoted.docstring"
       },
       {
          "foreground":"#8F93A2",
          "token":"variable"
       },
       {
          "foreground":"#8F93A2",
          "token":"string constant.other.placeholder"
       },
       {
          "foreground":"#FFCB6B",
          "token":"constant.other.php"
       },
       {
          "foreground":"#FFFFFF",
          "token":"constant.other.color"
       },
       {
          "foreground":"#FF5370",
          "token":"invalid"
       },
       {
          "foreground":"#FF5370",
          "token":"invalid.illegal"
       },
       {
          "foreground":"#C792EA",
          "token":"invalid.deprecated"
       },
       {
          "foreground":"#C792EA",
          "token":"keyword"
       },
       {
          "foreground":"#C792EA",
          "token":"storage.type"
       },
       {
          "foreground":"#C792EA",
          "token":"storage.modifier"
       },
       {
          "fontStyle":"italic",
          "token":"Keyword"
       },
       {
          "fontStyle":"italic",
          "token":"Storage"
       },
       {
          "foreground":"#89DDFF",
          "token":"keyword.control"
       },
       {
          "foreground":"#89DDFF",
          "token":"constant.other.color"
       },
       {
          "foreground":"#89DDFF",
          "token":"punctuation.definition.tag"
       },
       {
          "foreground":"#89DDFF",
          "token":"punctuation"
       },
       {
          "foreground":"#89DDFF",
          "token":"punctuation.separator.inheritance.php"
       },
       {
          "foreground":"#89DDFF",
          "token":"punctuation.definition.tag.html"
       },
       {
          "foreground":"#89DDFF",
          "token":"punctuation.definition.tag.begin.html"
       },
       {
          "foreground":"#89DDFF",
          "token":"punctuation.definition.tag.end.html"
       },
       {
          "foreground":"#89DDFF",
          "token":"punctuation.section.embedded"
       },
       {
          "foreground":"#89DDFF",
          "token":"keyword.other.template"
       },
       {
          "foreground":"#89DDFF",
          "token":"keyword.other.substitution"
       },
       {
          "fontStyle":"italic",
          "token":"keyword.control"
       },
       {
          "foreground":"#F07178",
          "token":"entity.name.tag"
       },
       {
          "foreground":"#F07178",
          "token":"meta.tag.sgml"
       },
       {
          "foreground":"#F07178",
          "token":"markup.deleted.git_gutter"
       },
       {
          "foreground":"#82AAFF",
          "token":"entity.name.function"
       },
       {
          "foreground":"#82AAFF",
          "token":"variable.function"
       },
       {
          "foreground":"#82AAFF",
          "token":"support.function"
       },
       {
          "foreground":"#82AAFF",
          "token":"keyword.other.special-method"
       },
       {
          "foreground":"#F07178",
          "token":"source.cpp meta.block variable.other"
       },
       {
          "foreground":"#F07178",
          "token":"variable.other.constant"
       },
       {
          "foreground":"#F07178",
          "token":"support.other.variable"
       },
       {
          "foreground":"#F07178",
          "token":"string.other.link"
       },
       {
          "foreground":"#F78C6C",
          "token":"constant.numeric"
       },
       {
          "foreground":"#F78C6C",
          "token":"constant.language"
       },
       {
          "foreground":"#F78C6C",
          "token":"support.constant"
       },
       {
          "foreground":"#F78C6C",
          "token":"constant.character"
       },
       {
          "foreground":"#F78C6C",
          "token":"constant.escape"
       },
       {
          "foreground":"#F78C6C",
          "token":"keyword.other.unit"
       },
       {
          "foreground":"#F78C6C",
          "token":"keyword.other"
       },
       {
          "foreground":"#FF5370",
          "token":"variable.parameter.function.language.special"
       },
       {
          "foreground":"#FF5370",
          "token":"variable.parameter"
       },
       {
          "foreground":"#C3E88D",
          "fontStyle":"normal",
          "token":"string"
       },
       {
          "foreground":"#C3E88D",
          "fontStyle":"normal",
          "token":"constant.other.symbol"
       },
       {
          "foreground":"#C3E88D",
          "fontStyle":"normal",
          "token":"constant.other.key"
       },
       {
          "foreground":"#C3E88D",
          "fontStyle":"normal",
          "token":"entity.other.inherited-class"
       },
       {
          "foreground":"#C3E88D",
          "fontStyle":"normal",
          "token":"markup.heading"
       },
       {
          "foreground":"#C3E88D",
          "fontStyle":"normal",
          "token":"markup.inserted.git_gutter"
       },
       {
          "foreground":"#C3E88D",
          "fontStyle":"normal",
          "token":"meta.group.braces.curly constant.other.object.key.js string.unquoted.label.js"
       },
       {
          "foreground":"#FFCB6B",
          "token":"entity.name"
       },
       {
          "foreground":"#FFCB6B",
          "token":"support.type"
       },
       {
          "foreground":"#FFCB6B",
          "token":"support.class"
       },
       {
          "foreground":"#FFCB6B",
          "token":"support.orther.namespace.use.php"
       },
       {
          "foreground":"#FFCB6B",
          "token":"meta.use.php"
       },
       {
          "foreground":"#FFCB6B",
          "token":"support.other.namespace.php"
       },
       {
          "foreground":"#FFCB6B",
          "token":"markup.changed.git_gutter"
       },
       {
          "foreground":"#FFCB6B",
          "token":"support.type.sys-types"
       },
       {
          "foreground":"#B2CCD6",
          "token":"support.type"
       },
       {
          "foreground":"#B2CCD6",
          "token":"source.css support.type.property-name"
       },
       {
          "foreground":"#B2CCD6",
          "token":"source.sass support.type.property-name"
       },
       {
          "foreground":"#B2CCD6",
          "token":"source.scss support.type.property-name"
       },
       {
          "foreground":"#B2CCD6",
          "token":"source.less support.type.property-name"
       },
       {
          "foreground":"#B2CCD6",
          "token":"source.stylus support.type.property-name"
       },
       {
          "foreground":"#B2CCD6",
          "token":"source.postcss support.type.property-name"
       },
       {
          "foreground":"#FF5370",
          "token":"entity.name.module.js"
       },
       {
          "foreground":"#FF5370",
          "token":"variable.import.parameter.js"
       },
       {
          "foreground":"#FF5370",
          "token":"variable.other.class.js"
       },
       {
          "foreground":"#FF5370",
          "fontStyle":"italic",
          "token":"variable.language"
       },
       {
          "foreground":"#82AAFF",
          "fontStyle":"italic",
          "token":"entity.name.method.js"
       },
       {
          "foreground":"#82AAFF",
          "token":"meta.class-method.js entity.name.function.js"
       },
       {
          "foreground":"#82AAFF",
          "token":"variable.function.constructor"
       },
       {
          "foreground":"#C792EA",
          "fontStyle":"italic",
          "token":"entity.other.attribute-name"
       },
       {
          "foreground":"#FFCB6B",
          "token":"entity.other.attribute-name.class"
       },
       {
          "foreground":"#82AAFF",
          "token":"source.sass keyword.control"
       },
       {
          "foreground":"#C3E88D",
          "token":"markup.inserted"
       },
       {
          "foreground":"#FF5370",
          "token":"markup.deleted"
       },
       {
          "foreground":"#C792EA",
          "token":"markup.changed"
       },
       {
          "foreground":"#89DDFF",
          "token":"string.regexp"
       },
       {
          "foreground":"#89DDFF",
          "token":"constant.character.escape"
       },
       {
          "fontStyle":"underline",
          "token":"*url*"
       },
       {
          "fontStyle":"underline",
          "token":"*link*"
       },
       {
          "fontStyle":"underline",
          "token":"*uri*"
       },
       {
          "foreground":"#82AAFF",
          "fontStyle":"italic",
          "token":"tag.decorator.js entity.name.tag.js"
       },
       {
          "foreground":"#82AAFF",
          "fontStyle":"italic",
          "token":"tag.decorator.js punctuation.definition.tag.js"
       },
       {
          "foreground":"#FF5370",
          "fontStyle":"italic",
          "token":"source.js constant.other.object.key.js string.unquoted.label.js"
       },
       {
          "foreground":"#C792EA",
          "token":"source.json meta.structure.dictionary.json support.type.property-name.json"
       },
       {
          "foreground":"#FFCB6B",
          "token":"source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json"
       },
       {
          "foreground":"#F78C6C",
          "token":"source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json"
       },
       {
          "foreground":"#FF5370",
          "token":"source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json"
       },
       {
          "foreground":"#C17E70",
          "token":"source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json"
       },
       {
          "foreground":"#82AAFF",
          "token":"source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json"
       },
       {
          "foreground":"#F07178",
          "token":"source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json"
       },
       {
          "foreground":"#C792EA",
          "token":"source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json"
       },
       {
          "foreground":"#C3E88D",
          "token":"source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json"
       },
       {
          "foreground":"#8F93A2",
          "token":"text.html.markdown"
       },
       {
          "foreground":"#8F93A2",
          "token":"punctuation.definition.list_item.markdown"
       },
       {
          "foreground":"#C792EA",
          "token":"text.html.markdown markup.inline.raw.markdown"
       },
       {
          "foreground":"#80869E50",
          "token":"text.html.markdown markup.inline.raw.markdown punctuation.definition.raw.markdown"
       },
       {
          "token":"text.html.markdown meta.dummy.line-break"
       },
       {
          "foreground":"#C3E88D",
          "token":"markdown.heading"
       },
       {
          "foreground":"#C3E88D",
          "token":"markup.heading | markup.heading entity.name"
       },
       {
          "foreground":"#C3E88D",
          "token":"markup.heading.markdown punctuation.definition.heading.markdown"
       },
       {
          "foreground":"#F07178",
          "fontStyle":"italic",
          "token":"markup.italic"
       },
       {
          "foreground":"#F07178",
          "fontStyle":"bold",
          "token":"markup.bold"
       },
       {
          "foreground":"#F07178",
          "fontStyle":"bold",
          "token":"markup.bold string"
       },
       {
          "foreground":"#F07178",
          "fontStyle":"bold",
          "token":"markup.bold markup.italic"
       },
       {
          "foreground":"#F07178",
          "fontStyle":"bold",
          "token":"markup.italic markup.bold"
       },
       {
          "foreground":"#F07178",
          "fontStyle":"bold",
          "token":"markup.quote markup.bold"
       },
       {
          "foreground":"#F07178",
          "fontStyle":"bold",
          "token":"markup.bold markup.italic string"
       },
       {
          "foreground":"#F07178",
          "fontStyle":"bold",
          "token":"markup.italic markup.bold string"
       },
       {
          "foreground":"#F07178",
          "fontStyle":"bold",
          "token":"markup.quote markup.bold string"
       },
       {
          "foreground":"#F78C6C",
          "fontStyle":"underline",
          "token":"markup.underline"
       },
       {
          "fontStyle":"strike",
          "token":"markup.strike"
       },
       {
          "foreground":"#80869E50",
          "token":"markup.quote punctuation.definition.blockquote.markdown"
       },
       {
          "fontStyle":"italic",
          "token":"markup.quote"
       },
       {
          "foreground":"#82AAFF",
          "token":"string.other.link.title.markdown"
       },
       {
          "foreground":"#C792EA",
          "token":"string.other.link.description.title.markdown"
       },
       {
          "foreground":"#FFCB6B",
          "token":"constant.other.reference.link.markdown"
       },
       {
          "foreground":"#C792EA",
          "token":"markup.raw.block"
       },
       {
          "foreground":"#8F93A290",
          "token":"markup.fenced_code.block.markdown"
       },
       {
          "foreground":"#8F93A290",
          "token":"markup.inline.raw.string.markdown"
       },
       {
          "foreground":"#80869E50",
          "token":"variable.language.fenced.markdown"
       },
       {
          "foreground":"#80869E50",
          "fontStyle":"bold",
          "token":"meta.separator"
       },
       {
          "foreground":"#8F93A2",
          "token":"markup.table"
       },
       {
          "foreground":"#6796E6",
          "token":"token.info-token"
       },
       {
          "foreground":"#CD9731",
          "token":"token.warn-token"
       },
       {
          "foreground":"#F44747",
          "token":"token.error-token"
       },
       {
          "foreground":"#B267E6",
          "token":"token.debug-token"
       }
    ]
 });

monaco.editor.create(document.getElementById("container"), {
	value: getCode(),
	language: "apex",
	theme: "myCustomTheme"
});

function getCode() {
	return "public static void a;";
}

What am I missing?

monaco-editor version: 0.22.0 Browser: Chrome OS: Windows 10

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
spahnkecommented, Feb 23, 2021

I don’t know much about themes but the comment from the example shows you how you can debug your tokens.

// !!! Tokens can be inspected using F1 > Developer: Inspect Tokens !!!

grafik

By that it seems you’re missing color definitions for at least identifier and delimiter tokens. Either add those

{
  "foreground":"#FFFFFF",
  "token":"identifier"
},
{
  "foreground":"#FFFFFF",
  "token":"delimiter"
},

or set "inherit":true in your theme definition so that they are taken from the base theme you specified.

Hope that helps!

0reactions
AllanOricilcommented, Feb 23, 2021

@spahnke Yes, that I know. But shouldn’t the tokens be the same in both? Like, both use Monaco Editor and the same Apex language tokenizer. Right? D:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom theme is not working properly in DEV
In my DEV instance my custom theme is not working fine as i apply custom theme then my incident form is not fully...
Read more >
Not able to use a custom theme in Angular 4
I'm trying to use my custom theme in my angular project. It's not working as expected, I get the following error:
Read more >
Custom Theme not working for some users
Hi All, I have a requirement to change logo in Masthead. My portal is using Custom Theme. So I've changed the logo and...
Read more >
Custom Themes No Longer working
Just create a new theme and make sure that IsInverted is true. ... That solve my problem. 2 Likes.
Read more >
Configuring themes
The CSS files in a theme can either create new CSS rules, ... Note: If customizing the login page by using JavaScript does...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found