Skip to content

Commit

Permalink
Fixes microsoft#9
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Nov 13, 2017
1 parent 6a3a3ed commit 4ce2107
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions sample-monarch/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,6 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<style>
.monaco-editor.vs .token.custom-info {
color: grey;
}
.monaco-editor.vs .token.custom-error {
color: red;
font-weight: bold;
font-size: 1.2em;
}
.monaco-editor.vs .token.custom-notice {
color: orange;
}

.monaco-editor.vs .token.custom-date {
color: green;
}
</style>
</head>
<body>

Expand All @@ -46,7 +29,20 @@ <h2>Monarch Tokenizer Sample</h2>
}
});

// Define a new theme that constains only rules that match this language
monaco.editor.defineTheme('myCoolTheme', {
base: 'vs',
inherit: false,
rules: [
{ token: 'custom-info', foreground: '808080' },
{ token: 'custom-error', foreground: 'ff0000', fontStyle: 'bold' },
{ token: 'custom-notice', foreground: 'FFA500' },
{ token: 'custom-date', foreground: '008800' },
]
});

var editor = monaco.editor.create(document.getElementById('container'), {
theme: 'myCoolTheme',
value: getCode(),
language: 'myCustomLanguage'
});
Expand Down Expand Up @@ -108,4 +104,4 @@ <h2>Monarch Tokenizer Sample</h2>
}
</script>
</body>
</html>
</html>

0 comments on commit 4ce2107

Please sign in to comment.