Skip to content

Commit 682fa68

Browse files
authored
Adopt link decoration var (microsoft#216859)
* Adopt link decoration var * Ensure links in walkthrough markdown content get underlines and react to setting change
1 parent 8001137 commit 682fa68

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ img {
3232
}
3333
3434
a {
35-
text-decoration: none;
35+
text-decoration: var(--text-link-decoration);
3636
}
3737
3838
a:hover {

src/vs/workbench/contrib/webview/browser/pre/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<meta http-equiv="Content-Security-Policy"
88

9-
content="default-src 'none'; script-src 'sha256-EJBlYt9sOvo6RhZZJG+duTqIZCB8pctk1a62h/ZIElc=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
9+
content="default-src 'none'; script-src 'sha256-ikaxwm2UFoiIKkEZTEU4mnSxpYf3lmsrhy5KqqJZfek=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
1010

1111

1212
<!-- Disable pinch zooming -->
@@ -112,6 +112,10 @@
112112
color: var(--vscode-textLink-foreground);
113113
}
114114
115+
p > a {
116+
text-decoration: var(--text-link-decoration);
117+
}
118+
115119
a:hover {
116120
color: var(--vscode-textLink-activeForeground);
117121
}

src/vs/workbench/contrib/webview/browser/themeing.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class WebviewThemeDataProvider extends Disposable {
3737
this._reset();
3838
}));
3939

40-
const webviewConfigurationKeys = ['editor.fontFamily', 'editor.fontWeight', 'editor.fontSize'];
40+
const webviewConfigurationKeys = ['editor.fontFamily', 'editor.fontWeight', 'editor.fontSize', 'accessibility.underlineLinks'];
4141
this._register(this._configurationService.onDidChangeConfiguration(e => {
4242
if (webviewConfigurationKeys.some(key => e.affectsConfiguration(key))) {
4343
this._reset();
@@ -55,6 +55,7 @@ export class WebviewThemeDataProvider extends Disposable {
5555
const editorFontFamily = configuration.fontFamily || EDITOR_FONT_DEFAULTS.fontFamily;
5656
const editorFontWeight = configuration.fontWeight || EDITOR_FONT_DEFAULTS.fontWeight;
5757
const editorFontSize = configuration.fontSize || EDITOR_FONT_DEFAULTS.fontSize;
58+
const linkUnderlines = this._configurationService.getValue('accessibility.underlineLinks');
5859

5960
const theme = this._themeService.getColorTheme();
6061
const exportedColors = colorRegistry.getColorRegistry().getColors().reduce<Record<string, string>>((colors, entry) => {
@@ -72,6 +73,7 @@ export class WebviewThemeDataProvider extends Disposable {
7273
'vscode-editor-font-family': editorFontFamily,
7374
'vscode-editor-font-weight': editorFontWeight,
7475
'vscode-editor-font-size': editorFontSize + 'px',
76+
'text-link-decoration': linkUnderlines ? 'underline' : 'none',
7577
...exportedColors
7678
};
7779

src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,7 @@
923923

924924
.monaco-workbench .part.editor > .content .gettingStartedContainer .button-link {
925925
color: var(--vscode-textLink-foreground);
926+
text-decoration: var(--text-link-decoration);
926927
}
927928

928929
.monaco-workbench .part.editor > .content .gettingStartedContainer .button-link .codicon {

src/vs/workbench/contrib/welcomeWalkthrough/browser/media/walkThroughPart.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919

2020
.monaco-workbench .part.editor > .content .walkThroughContent a {
21-
text-decoration: none;
21+
text-decoration: var(--text-link-decoration);
2222
}
2323

2424
.monaco-workbench .part.editor > .content .walkThroughContent a:focus,

0 commit comments

Comments
 (0)