From d1dc19b649343c327987d6861f167c508a9c8da8 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 15 May 2017 23:12:47 +0200 Subject: [PATCH] [theme] externalize more hover colors --- src/vs/editor/contrib/hover/browser/hover.css | 6 +----- src/vs/editor/contrib/hover/browser/hover.ts | 11 ++++++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/vs/editor/contrib/hover/browser/hover.css b/src/vs/editor/contrib/hover/browser/hover.css index 191c253ae2d..076675d3e48 100644 --- a/src/vs/editor/contrib/hover/browser/hover.css +++ b/src/vs/editor/contrib/hover/browser/hover.css @@ -60,7 +60,6 @@ } .monaco-editor-hover code { - background-color: rgba(132, 132, 132, 0.14); border-radius: 3px; padding: 0 0.4em; } @@ -68,7 +67,4 @@ .monaco-editor-hover .monaco-tokenized-source { white-space: pre-wrap; word-break: break-all; -} - -.monaco-editor.vs-dark .monaco-editor-hover a { color: #1C5DAF; } -.monaco-editor.hc-black .monaco-editor-hover a { color: #1C5DAF; } \ No newline at end of file +} \ No newline at end of file diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index 97456adcbf4..7660cff426e 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -21,7 +21,7 @@ import { ModesContentHoverWidget } from './modesContentHover'; import { ModesGlyphHoverWidget } from './modesGlyphHover'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { editorHoverHighlight, editorHoverBackground, editorHoverBorder } from 'vs/platform/theme/common/colorRegistry'; +import { editorHoverHighlight, editorHoverBackground, editorHoverBorder, textLinkForeground, textCodeBlockBackground } from 'vs/platform/theme/common/colorRegistry'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; @editorContribution @@ -187,4 +187,13 @@ registerThemingParticipant((theme, collector) => { collector.addRule(`.monaco-editor .monaco-editor-hover { border: 1px solid ${hoverBorder}; }`); collector.addRule(`.monaco-editor .monaco-editor-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`); } + let link = theme.getColor(textLinkForeground); + if (link) { + collector.addRule(`.monaco-editor .monaco-editor-hover a { color: ${link}; }`); + } + let codeBackground = theme.getColor(textCodeBlockBackground); + if (codeBackground) { + collector.addRule(`.monaco-editor .monaco-editor-hover code { background-color: ${codeBackground}; }`); + } + }); -- GitLab