Skip to content

Commit

Permalink
feat: use border-box as box-sizing
Browse files Browse the repository at this point in the history
  • Loading branch information
bytemain committed Apr 30, 2024
1 parent 71cb4a7 commit 3ce8625
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
6 changes: 6 additions & 0 deletions packages/components/src/style/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ input::-ms-reveal {
// we force a non-overlapping, non-auto-hiding scrollbar to counteract.
// 6. Change the default tap highlight to be completely transparent in iOS.

*,
*::before,
*::after {
box-sizing: border-box; // 1
}

@{html-selector} {
font-family: sans-serif; // 2
line-height: 1.15; // 3
Expand Down
9 changes: 2 additions & 7 deletions packages/core-browser/src/style/normalize.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,17 @@ html,
body {
margin: 0;
padding: 0;
// 使用该字体获取与vscode一致的图标表现
// 仅mac下可用,windows待区分
// https://stackoverflow.com/questions/32660748/how-to-use-apples-new-san-francisco-font-on-a-webpage
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', system-ui, 'Ubuntu', 'Droid Sans', sans-serif;
// 全局默认字体颜色
color: var(--foreground);
background-color: var(--editor-background);
font-size: 13px;
// 设置 antialiased 会导致整体清晰度降低
// -webkit-font-smoothing: antialiased;
}

html {
/* 防止 overlay/modal 撑开页面元素 */
overflow: hidden;
/* 防止mac上的回退手势 */
/* 防止 mac 上的回退手势 */
overscroll-behavior-x: none;

input::placeholder,
Expand Down
2 changes: 1 addition & 1 deletion packages/webview/src/browser/webview.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export class WebviewServiceImpl implements IWebviewService {

const styles = {
'vscode-font-family':
'-apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", ans-serif',
'-apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", system-ui, "Ubuntu", "Droid Sans", sans-serif',
'vscode-font-weight': 'normal',
'vscode-font-size': '13px',
'vscode-editor-font-family': editorFontFamily,
Expand Down
2 changes: 1 addition & 1 deletion tools/electron/src/browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
} catch (e) {}
</script>
<meta charset="UTF-8" />
<title>CloudIDE</title>
<title>OpenSumi</title>
<style>
body {
margin: 0;
Expand Down

0 comments on commit 3ce8625

Please sign in to comment.