Skip to content

Commit 500ba92

Browse files
committed
fix: style links with correct colors
1 parent d950894 commit 500ba92

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts

+17-12
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/
3232
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
3333
import Severity from 'vs/base/common/severity';
3434
import { IActivityService, NumberBadge } from 'vs/workbench/services/activity/common/activity';
35-
import { IThemeService } from 'vs/platform/theme/common/themeService';
35+
import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
3636
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
3737
import { IViewsRegistry, IViewDescriptor, Extensions, ViewContainer, IViewDescriptorService, IAddedViewDescriptorRef } from 'vs/workbench/common/views';
3838
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
@@ -61,6 +61,7 @@ import { SIDE_BAR_DRAG_AND_DROP_BACKGROUND } from 'vs/workbench/common/theme';
6161
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
6262
import { WorkbenchStateContext } from 'vs/workbench/browser/contextkeys';
6363
import { ICommandService } from 'vs/platform/commands/common/commands';
64+
import { textLinkForeground } from 'vs/platform/theme/common/colorRegistry';
6465

6566
const DefaultViewsContext = new RawContextKey<boolean>('defaultExtensionViews', true);
6667
const SearchMarketplaceExtensionsContext = new RawContextKey<boolean>('searchMarketplaceExtensions', false);
@@ -420,17 +421,21 @@ export class ExtensionsViewPaneContainer extends ViewPaneContainer implements IE
420421
helperHeader.style.fontWeight = '600';
421422
helperHeader.style.padding = 'padding: 5px 16px';
422423
helperHeader.style.position = 'relative';
423-
helperHeader.innerHTML = `
424-
<div style="margin-bottom: 8px;">
425-
<p style="margin-bottom: 0; display: flex; align-items: center"><span class="codicon codicon-warning" style="margin-right: 2px; color: #C4A103"></span>WARNING</p>
426-
<p style="margin-top: 0; margin-bottom: 4px">
427-
These extensions are not official. Find additional open-source extensions
428-
<a href="https://open-vsx.org/" target="_blank">here</a>.
429-
See <a href="https://github.com/cdr/code-server/blob/master/doc/FAQ.md#differences-compared-to-vs-code" target="_blank">docs</a>.
430-
</p>
431-
</div>
432-
`;
433-
424+
// We call this function because it gives us access to the current theme
425+
// Then we can apply the link color to the links in the helper header
426+
registerThemingParticipant((theme) => {
427+
const linkColor = theme.getColor(textLinkForeground);
428+
helperHeader.innerHTML = `
429+
<div style="margin-bottom: 8px;">
430+
<p style="margin-bottom: 0; display: flex; align-items: center"><span class="codicon codicon-warning" style="margin-right: 2px; color: #C4A103"></span>WARNING</p>
431+
<p style="margin-top: 0; margin-bottom: 4px">
432+
These extensions are not official. Find additional open-source extensions
433+
<a style="color: ${linkColor}" href="https://open-vsx.org/" target="_blank">here</a>.
434+
See <a style="color: ${linkColor}" href="https://github.com/cdr/code-server/blob/master/doc/FAQ.md#differences-compared-to-vs-code" target="_blank">docs</a>.
435+
</p>
436+
</div>
437+
`;
438+
});
434439
const dismiss = append(helperHeader, $('span'));
435440
dismiss.innerHTML = 'Dismiss';
436441
dismiss.style.display = 'block';

0 commit comments

Comments
 (0)