Skip to content

Commit 9f1dbf0

Browse files
feat: add font ligatures to webview theme
1 parent c5ccd47 commit 9f1dbf0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { DEFAULT_FONT_FAMILY } from '../../../../base/browser/fonts.js';
77
import { Emitter } from '../../../../base/common/event.js';
88
import { Disposable } from '../../../../base/common/lifecycle.js';
9-
import { EDITOR_FONT_DEFAULTS, IEditorOptions } from '../../../../editor/common/config/editorOptions.js';
9+
import { EDITOR_FONT_DEFAULTS, IEditorOptions, EditorFontLigatures } from '../../../../editor/common/config/editorOptions.js';
1010
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';
1111
import * as colorRegistry from '../../../../platform/theme/common/colorRegistry.js';
1212
import { ColorScheme } from '../../../../platform/theme/common/theme.js';
@@ -37,7 +37,7 @@ export class WebviewThemeDataProvider extends Disposable {
3737
this._reset();
3838
}));
3939

40-
const webviewConfigurationKeys = ['editor.fontFamily', 'editor.fontWeight', 'editor.fontSize', 'accessibility.underlineLinks'];
40+
const webviewConfigurationKeys = ['editor.fontFamily', 'editor.fontWeight', 'editor.fontSize', 'editor.fontLigatures', '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 editorFontLigatures = new EditorFontLigatures().validate(configuration.fontLigatures);
5859
const linkUnderlines = this._configurationService.getValue('accessibility.underlineLinks');
5960

6061
const theme = this._themeService.getColorTheme();
@@ -73,6 +74,7 @@ export class WebviewThemeDataProvider extends Disposable {
7374
'vscode-editor-font-family': editorFontFamily,
7475
'vscode-editor-font-weight': editorFontWeight,
7576
'vscode-editor-font-size': editorFontSize + 'px',
77+
'vscode-editor-font-feature-settings': editorFontLigatures,
7678
'text-link-decoration': linkUnderlines ? 'underline' : 'none',
7779
...exportedColors
7880
};

0 commit comments

Comments
 (0)