From e42482597c9a165a25006b80e85e2de92a2b16df Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 9 Jul 2023 12:06:58 +0200 Subject: [PATCH] rename getProp to getColor --- web_src/js/features/codeeditor.js | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/web_src/js/features/codeeditor.js b/web_src/js/features/codeeditor.js index bb733b12d20dc..7dbbcd3dd62a9 100644 --- a/web_src/js/features/codeeditor.js +++ b/web_src/js/features/codeeditor.js @@ -72,32 +72,32 @@ export async function createMonaco(textarea, filename, editorOpts) { // https://github.com/microsoft/monaco-editor/issues/2427 // also, monaco can only parse 6-digit hex colors, so we convert the colors to that format const styles = window.getComputedStyle(document.documentElement); - const getProp = (name) => tinycolor(styles.getPropertyValue(name).trim()).toString('hex6'); + const getColor = (name) => tinycolor(styles.getPropertyValue(name).trim()).toString('hex6'); monaco.editor.defineTheme('gitea', { base: isDarkTheme() ? 'vs-dark' : 'vs', inherit: true, rules: [ { - background: getProp('--color-code-bg'), + background: getColor('--color-code-bg'), } ], colors: { - 'editor.background': getProp('--color-code-bg'), - 'editor.foreground': getProp('--color-text'), - 'editor.inactiveSelectionBackground': getProp('--color-primary-light-4'), - 'editor.lineHighlightBackground': getProp('--color-editor-line-highlight'), - 'editor.selectionBackground': getProp('--color-primary-light-3'), - 'editor.selectionForeground': getProp('--color-primary-light-3'), - 'editorLineNumber.background': getProp('--color-code-bg'), - 'editorLineNumber.foreground': getProp('--color-secondary-dark-6'), - 'editorWidget.background': getProp('--color-body'), - 'editorWidget.border': getProp('--color-secondary'), - 'input.background': getProp('--color-input-background'), - 'input.border': getProp('--color-input-border'), - 'input.foreground': getProp('--color-input-text'), - 'scrollbar.shadow': getProp('--color-shadow'), - 'progressBar.background': getProp('--color-primary'), + 'editor.background': getColor('--color-code-bg'), + 'editor.foreground': getColor('--color-text'), + 'editor.inactiveSelectionBackground': getColor('--color-primary-light-4'), + 'editor.lineHighlightBackground': getColor('--color-editor-line-highlight'), + 'editor.selectionBackground': getColor('--color-primary-light-3'), + 'editor.selectionForeground': getColor('--color-primary-light-3'), + 'editorLineNumber.background': getColor('--color-code-bg'), + 'editorLineNumber.foreground': getColor('--color-secondary-dark-6'), + 'editorWidget.background': getColor('--color-body'), + 'editorWidget.border': getColor('--color-secondary'), + 'input.background': getColor('--color-input-background'), + 'input.border': getColor('--color-input-border'), + 'input.foreground': getColor('--color-input-text'), + 'scrollbar.shadow': getColor('--color-shadow'), + 'progressBar.background': getColor('--color-primary'), } });