1.3 KB37 lines
Blame
1/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8import {isMac, isWindows} from 'isl-components/OperatingSystem';
9
10// https://github.com/microsoft/vscode/blob/c90951b/src/vs/workbench/browser/style.ts#L72
11const fontFamily = isWindows
12 ? '"Segoe WPC", "Segoe UI", sans-serif'
13 : isMac
14 ? '-apple-system, BlinkMacSystemFont, sans-serif'
15 : 'system-ui, "Ubuntu", "Droid Sans", sans-serif';
16
17// https://github.com/microsoft/vscode/blob/c90951b147164bb427d08f2c251666d5610076d3/src/vs/workbench/contrib/webview/browser/themeing.ts#L68-L76
18const fontSize = '13px';
19
20/**
21 * Default "reset" CSS to normalize things like font size, etc.
22 * This is intended to match VSCode webview's CSS and should be skipped
23 * when running inside VSCode (by setting theme.resetCSS to '').
24 */
25// https://github.com/microsoft/vscode/blob/c90951b147164bb427d08f2c251666d5610076d3/src/vs/workbench/contrib/webview/browser/pre/index.html#L96-L98
26export const DEFAULT_RESET_CSS = `
27html {
28 --vscode-font-size: ${fontSize};
29 --vscode-font-family: ${fontFamily};
30}
31
32body {
33 font-family: var(--vscode-font-family);
34 font-size: var(--vscode-font-size);
35}
36`;
37