Skip to content

Commit

Permalink
Merge pull request #4734 from activepieces/fix/monaco-on-ff-w11
Browse files Browse the repository at this point in the history
fix: add missing hashtags for colors on monaco editor
  • Loading branch information
AbdulTheActivePiecer committed May 21, 2024
2 parents 9622222 + 293231d commit 0c54375
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions packages/ui/core/src/app/monaco-themes/ap-monaco-theme.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
const getVariableValue = (variableName: string) => {
//in case the browser hasn't rendered the css variables in embedding
const defaults = {
'--code-editor-purple': '#770088',
'--code-editor-green': '#0f9b68',
'--code-editor-blue': '#0d57a8',
};
const monacoRoot = document.querySelector('body');
if (monacoRoot) {
const varnameValue = getComputedStyle(monacoRoot).getPropertyValue(
`--${variableName}`
);
return varnameValue;
}
return '';
if (defaults[`--${variableName}`]) {
return defaults[`--${variableName}`];
}
return null;
};
export const apMonacoTheme = {
base: 'vs',
inherit: true,
rules: [
{
background: '#FFFFFF',
token: '',
},
{
foreground: getVariableValue('code-editor-blue'),
token: 'string',
Expand All @@ -24,6 +29,7 @@ export const apMonacoTheme = {
foreground: '#1c00cf',
token: 'constant.numeric',
},

{
foreground: getVariableValue('code-editor-purple'),
token: 'keyword',
Expand Down Expand Up @@ -75,7 +81,7 @@ export const apMonacoTheme = {
token: 'meta.tag',
},
{
foreground: '770088',
foreground: '#770088',
token: 'declaration.tag',
},
{
Expand Down Expand Up @@ -110,7 +116,7 @@ export const apMonacoTheme = {
token: 'entity.name.tag',
},
{
foreground: '881280',
foreground: '#881280',
token: 'entity.name.tag',
},
{ token: 'string.key.json', foreground: '#000000' },
Expand Down

0 comments on commit 0c54375

Please sign in to comment.