addons/isl/src/resetStyle.tsblame
View source
b69ab311/**
b69ab312 * Copyright (c) Meta Platforms, Inc. and affiliates.
b69ab313 *
b69ab314 * This source code is licensed under the MIT license found in the
b69ab315 * LICENSE file in the root directory of this source tree.
b69ab316 */
b69ab317
b69ab318import {isMac, isWindows} from 'isl-components/OperatingSystem';
b69ab319
b69ab3110// https://github.com/microsoft/vscode/blob/c90951b/src/vs/workbench/browser/style.ts#L72
b69ab3111const fontFamily = isWindows
b69ab3112 ? '"Segoe WPC", "Segoe UI", sans-serif'
b69ab3113 : isMac
b69ab3114 ? '-apple-system, BlinkMacSystemFont, sans-serif'
b69ab3115 : 'system-ui, "Ubuntu", "Droid Sans", sans-serif';
b69ab3116
b69ab3117// https://github.com/microsoft/vscode/blob/c90951b147164bb427d08f2c251666d5610076d3/src/vs/workbench/contrib/webview/browser/themeing.ts#L68-L76
b69ab3118const fontSize = '13px';
b69ab3119
b69ab3120/**
b69ab3121 * Default "reset" CSS to normalize things like font size, etc.
b69ab3122 * This is intended to match VSCode webview's CSS and should be skipped
b69ab3123 * when running inside VSCode (by setting theme.resetCSS to '').
b69ab3124 */
b69ab3125// https://github.com/microsoft/vscode/blob/c90951b147164bb427d08f2c251666d5610076d3/src/vs/workbench/contrib/webview/browser/pre/index.html#L96-L98
b69ab3126export const DEFAULT_RESET_CSS = `
b69ab3127html {
b69ab3128 --vscode-font-size: ${fontSize};
b69ab3129 --vscode-font-family: ${fontFamily};
b69ab3130}
b69ab3131
b69ab3132body {
b69ab3133 font-family: var(--vscode-font-family);
b69ab3134 font-size: var(--vscode-font-size);
b69ab3135}
b69ab3136`;