chore: support dark theme in recorder & tv (#18389)

This commit is contained in:
Pavel Feldman 2022-10-27 16:50:41 -07:00 committed by GitHub
parent a3f30674d3
commit c07f06aa3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 1173 additions and 113 deletions

View File

@ -16,7 +16,6 @@
:root { :root {
--box-shadow: rgba(0, 0, 0, 0.133) 0px 1.6px 3.6px 0px, rgba(0, 0, 0, 0.11) 0px 0.3px 0.9px 0px; --box-shadow: rgba(0, 0, 0, 0.133) 0px 1.6px 3.6px 0px, rgba(0, 0, 0, 0.11) 0px 0.3px 0.9px 0px;
--monospace-font: "SF Mono", Monaco, Consolas, "Droid Sans Mono", Inconsolata, "Courier New",monospace;
--box-shadow-thick: rgb(0 0 0 / 10%) 0px 1.8px 1.9px, --box-shadow-thick: rgb(0 0 0 / 10%) 0px 1.8px 1.9px,
rgb(0 0 0 / 15%) 0px 6.1px 6.3px, rgb(0 0 0 / 15%) 0px 6.1px 6.3px,
rgb(0 0 0 / 10%) 0px -2px 4px, rgb(0 0 0 / 10%) 0px -2px 4px,

View File

@ -68,7 +68,7 @@ const InnerMetadataView: React.FC<Metainfo> = metadata => {
return ( return (
<AutoChip header={ <AutoChip header={
<span> <span>
{metadata['revision.id'] && <span style={{ float: 'right', fontFamily: 'var(--monospace-font)' }}> {metadata['revision.id'] && <span style={{ float: 'right' }}>
{metadata['revision.id'].slice(0, 7)} {metadata['revision.id'].slice(0, 7)}
</span>} </span>}
{metadata['revision.subject'] || 'Commit Metainfo'} {metadata['revision.subject'] || 'Commit Metainfo'}
@ -82,7 +82,7 @@ const InnerMetadataView: React.FC<Metainfo> = metadata => {
{metadata['revision.id'] && {metadata['revision.id'] &&
<MetadatViewItem <MetadatViewItem
testId='revision.id' testId='revision.id'
content={<span style={{ fontFamily: 'var(--monospace-font)' }}>{metadata['revision.id']}</span>} content={<span>{metadata['revision.id']}</span>}
href={metadata['revision.link']} href={metadata['revision.link']}
icon='commit' icon='commit'
/> />

View File

@ -20,7 +20,6 @@
flex: auto; flex: auto;
line-height: 20px; line-height: 20px;
white-space: pre; white-space: pre;
background: white;
overflow: auto; overflow: auto;
} }
@ -35,7 +34,7 @@
display: flex; display: flex;
flex: none; flex: none;
flex-direction: column; flex-direction: column;
border-top: 1px solid #eee; border-top: 1px solid var(--vscode-panel-border);
} }
.call-log-call-header { .call-log-call-header {
@ -58,7 +57,7 @@
.call-log-call.error { .call-log-call.error {
background-color: #fff0f0; background-color: #fff0f0;
border-top: 1px solid #ffd6d6; border-top: 1px solid var(--vscode-panel-border);
} }
.call-log-call.error .call-log-call-header, .call-log-call.error .call-log-call-header,
@ -90,7 +89,7 @@
.call-log-call .codicon.preview { .call-log-call .codicon.preview {
visibility: hidden; visibility: hidden;
color: var(--toolbar-color); color: var(--vscode-sideBarTitle-foreground);
cursor: pointer; cursor: pointer;
} }

View File

@ -20,21 +20,11 @@
flex: auto; flex: auto;
} }
.recorder-paused-infobar {
display: flex;
color: #eee;
background-color: #333;
line-height: 24px;
align-items: center;
flex: none;
white-space: nowrap;
}
.recorder-chooser { .recorder-chooser {
border: none; border: none;
background: none; background: none;
outline: none; outline: none;
color: var(--toolbar-color); color: var(--vscode-sideBarTitle-foreground);
min-width: 100px; min-width: 100px;
} }

View File

@ -14,13 +14,17 @@
limitations under the License. limitations under the License.
*/ */
.action-list {
background-color: var(--vscode-sideBar-background);
border-top: 1px solid var(--vscode-panel-border);
}
.action-list-content { .action-list-content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex: auto; flex: auto;
position: relative; position: relative;
user-select: none; user-select: none;
color: #555;
overflow: auto; overflow: auto;
outline: none; outline: none;
} }
@ -37,20 +41,17 @@
.action-entry.highlighted, .action-entry.highlighted,
.action-entry.selected { .action-entry.selected {
background-color: var(--gray); background-color: var(--vscode-list-inactiveSelectionBackground);
} }
.action-entry.highlighted { .action-entry.highlighted {
background-color: var(--light-gray); background-color: var(--vscode-list-inactiveSelectionBackground);
} }
.action-list-content:focus .action-entry.selected { .action-list-content:focus .action-entry.selected {
background-color: var(--blue); background-color: var(--vscode-list-activeSelectionBackground);
} color: var(--vscode-list-activeSelectionForeground);
outline: 1px solid var(--vscode-focusBorder);
.action-entry.highlighted *,
.action-entry.selected * {
color: white !important;
} }
.action-title { .action-title {

View File

@ -24,7 +24,7 @@
} }
.call-error { .call-error {
border-bottom: 1px solid var(--background); border-bottom: 1px solid var(--vscode-panel-border);
padding: 3px 0 3px 12px; padding: 3px 0 3px 12px;
} }
@ -37,12 +37,13 @@
.call-section { .call-section {
padding-left: 6px; padding-left: 6px;
border-top: 1px solid #ddd; border-top: 1px solid var(--vscode-panel-border);
font-weight: bold; font-weight: bold;
text-transform: uppercase; text-transform: uppercase;
font-size: 10px; font-size: 10px;
border-bottom: 1px solid #ddd; border-bottom: 1px solid var(--vscode-panel-border);
background-color: #efefef; background-color: var(--vscode-sideBar-background);
color: var(--vscode-sideBarTitle-foreground);
line-height: 18px; line-height: 18px;
} }

View File

@ -19,17 +19,11 @@
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 3px; padding: 0 3px;
background: #fdfcfc;
width: 100%; width: 100%;
flex: none; flex: none;
outline: none; outline: none;
} }
.network-request.selected,
.network-request:hover {
border-color: var(--inactive-focus-ring);
}
.network-request.selected:focus { .network-request.selected:focus {
border-color: var(--orange); border-color: var(--orange);
} }
@ -79,7 +73,7 @@
.network-request-body { .network-request-body {
white-space: pre; white-space: pre;
overflow: scroll; overflow: scroll;
background-color: var(--network-content-bg); background-color: var(--vscode-sideBar-background);
border: black 1px solid; border: black 1px solid;
max-height: 500px; max-height: 500px;
} }
@ -87,7 +81,7 @@
.network-request-response-body { .network-request-response-body {
white-space: pre; white-space: pre;
overflow: scroll; overflow: scroll;
background-color: var(--network-content-bg); background-color: var(--vscode-sideBar-background);
border: black 1px solid; border: black 1px solid;
max-height: 500px; max-height: 500px;
} }

View File

@ -24,10 +24,10 @@
.snapshot-controls { .snapshot-controls {
flex: none; flex: none;
color: var(--toolbar-color); background-color: var(--vscode-sideBar-background);
color: var(--vscode-sideBarTitle-foreground);
display: flex; display: flex;
box-shadow: var(--box-shadow); box-shadow: var(--box-shadow);
background-color: var(--toolbar-bg-color);
height: 32px; height: 32px;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -65,10 +65,10 @@
} }
.snapshot-url { .snapshot-url {
background-color: var(--background); color: var(--vscode-input-foreground);
background-color: var(--vscode-input-background);
margin: 10px; margin: 10px;
padding: 4px; padding: 4px;
border-radius: 3px;
height: 28px; height: 28px;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;

View File

@ -31,9 +31,13 @@
padding: 0 5px; padding: 0 5px;
} }
.stack-trace-frame.selected,
.stack-trace-frame:hover { .stack-trace-frame:hover {
background-color: #eaeaea; background-color: var(--vscode-list-inactiveSelectionBackground);
}
.stack-trace-frame:selected {
background-color: var(--vscode-list-activeSelectionBackground);
color: var(--vscode-list-activeSelectionForeground);
} }
.stack-trace-frame-function { .stack-trace-frame-function {

View File

@ -27,10 +27,9 @@
} }
.tab-strip { .tab-strip {
color: var(--toolbar-color);
display: flex; display: flex;
box-shadow: var(--box-shadow); background-color: var(--vscode-sideBar-background);
background-color: var(--toolbar-bg-color); color: var(--vscode-sideBarTitle-foreground);
height: 32px; height: 32px;
align-items: center; align-items: center;
padding-right: 10px; padding-right: 10px;
@ -73,9 +72,5 @@
} }
.tab-element.selected { .tab-element.selected {
border-bottom-color: #666; background-color: var(--vscode-tab-activeBackground);
}
.tab-element:hover {
color: #333;
} }

View File

@ -135,7 +135,7 @@
top: 0; top: 0;
bottom: 0; bottom: 0;
margin-left: 2px; margin-left: 2px;
background-color: #fffffff0; background-color: var(--vscode-panel-background);
justify-content: center; justify-content: center;
display: none; display: none;
white-space: nowrap; white-space: nowrap;

View File

@ -113,8 +113,3 @@
.workbench .spacer { .workbench .spacer {
flex: auto; flex: auto;
} }
.tab-strip {
background-color: var(--light-background);
}

View File

@ -157,7 +157,7 @@ export const Workbench: React.FunctionComponent<{
{model.title && <div className='title'>{model.title}</div>} {model.title && <div className='title'>{model.title}</div>}
<div className='spacer'></div> <div className='spacer'></div>
</div> </div>
<div style={{ background: 'white', paddingLeft: '20px', flex: 'none', borderBottom: '1px solid #ddd' }}> <div style={{ paddingLeft: '20px', flex: 'none', borderBottom: '1px solid var(--vscode-panel-border)' }}>
<Timeline <Timeline
context={model} context={model}
boundaries={boundaries} boundaries={boundaries}

View File

@ -15,13 +15,6 @@
*/ */
:root { :root {
--toolbar-bg-color: #fafafa;
--toolbar-color: #555;
--light-background: #f3f2f1;
--background: #edebe9;
--active-background: #333333;
--color: #252423;
--red: #F44336; --red: #F44336;
--green: #367c39; --green: #367c39;
--purple: #9C27B0; --purple: #9C27B0;
@ -30,21 +23,20 @@
--blue: #0b7ad5; --blue: #0b7ad5;
--transparent-blue: #2196F355; --transparent-blue: #2196F355;
--orange: #d24726; --orange: #d24726;
--black: #1E1E1E;
--light-gray: #BBBBBB;
--gray: #888888;
--separator: #80808059;
--focus-ring: #0E639CCC;
--inactive-focus-ring: #80808059;
--layout-gap: 10px;
--selection: #074771;
--control-background: #3C3C3C;
--settings: #E7E7E7;
--sidebar-width: 250px;
--light-pink: #ff69b460; --light-pink: #ff69b460;
--network-content-bg: #dcdcdb; --gray: #888888;
--sidebar-width: 250px;
--box-shadow: rgba(0, 0, 0, 0.133) 0px 1.6px 3.6px 0px, rgba(0, 0, 0, 0.11) 0px 0.3px 0.9px 0px; --box-shadow: rgba(0, 0, 0, 0.133) 0px 1.6px 3.6px 0px, rgba(0, 0, 0, 0.11) 0px 0.3px 0.9px 0px;
--monospace-font: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace; }
@media(prefers-color-scheme: dark) {
:root {
--green: #28d12f;
--yellow: #ff9207;
--purple: #dc12ff;
--blue: #4dafff;
--orange: #ff7171;
}
} }
html, body { html, body {
@ -64,9 +56,11 @@ html, body {
} }
body { body {
color: var(--color); background-color: var(--vscode-panel-background);
font-size: 14px; color: var(--vscode-foreground);
font-family: SegoeUI-SemiBold-final,Segoe UI Semibold,SegoeUI-Regular-final,Segoe UI,"Segoe UI Web (West European)",Segoe,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,Tahoma,Helvetica,Arial,sans-serif; font-family: var(--vscode-font-family);
font-weight: var(--vscode-font-weight);
font-size: var(--vscode-font-size);
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
} }
@ -100,8 +94,3 @@ svg {
flex: auto; flex: auto;
position: relative; position: relative;
} }
.code {
font-family: var(--monospace-font);
color: yellow;
}

View File

@ -26,7 +26,7 @@ export const Expandable: React.FunctionComponent<React.PropsWithChildren<{
<div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', whiteSpace: 'nowrap' }}> <div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', whiteSpace: 'nowrap' }}>
<div <div
className={'codicon codicon-' + (expanded ? 'chevron-down' : 'chevron-right')} className={'codicon codicon-' + (expanded ? 'chevron-down' : 'chevron-right')}
style={{ cursor: 'pointer', color: 'var(--color)', marginRight: '4px' }} style={{ cursor: 'pointer', color: 'var(--vscode-foreground)', marginRight: '4px' }}
onClick={() => setExpanded(!expanded)} /> onClick={() => setExpanded(!expanded)} />
{title} {title}
</div> </div>

View File

@ -14,17 +14,22 @@
limitations under the License. limitations under the License.
*/ */
@import '../third_party/vscode/colors.css';
@import '../third_party/highlightjs/highlightjs/github.css';
@import '../third_party/highlightjs/highlightjs/github-dark.css' (prefers-color-scheme: dark);
.source { .source {
display: flex; display: flex;
flex: auto; flex: auto;
flex-direction: column; flex-direction: column;
white-space: pre; white-space: pre;
overflow: auto; overflow: auto;
font-family: var(--monospace-font);
font-size: 12px;
line-height: 20px;
background: white;
user-select: text; user-select: text;
font-family: var(--vscode-editor-font-family);
font-weight: var(--vscode-editor-font-weight);
line-height: 19px;
background: var(--vscode-editor-background);
color: var(--vscode-editor-foreground);
} }
.source-line { .source-line {
@ -38,7 +43,6 @@
width: 40px; width: 40px;
margin-right: 3px; margin-right: 3px;
text-align: right; text-align: right;
background: #f6f5f4;
user-select: none; user-select: none;
flex: none; flex: none;
} }

View File

@ -17,7 +17,6 @@
import './source.css'; import './source.css';
import * as React from 'react'; import * as React from 'react';
import highlightjs from '../third_party/highlightjs/highlightjs'; import highlightjs from '../third_party/highlightjs/highlightjs';
import '../third_party/highlightjs/highlightjs/github.css';
export type SourceHighlight = { export type SourceHighlight = {
line: number; line: number;

View File

@ -47,19 +47,19 @@
} }
.split-view.vertical:not(.sidebar-first) > .split-view-sidebar { .split-view.vertical:not(.sidebar-first) > .split-view-sidebar {
border-top: 1px solid #ddd; border-top: 1px solid var(--vscode-panel-border);
} }
.split-view.horizontal:not(.sidebar-first) > .split-view-sidebar { .split-view.horizontal:not(.sidebar-first) > .split-view-sidebar {
border-left: 1px solid #ddd; border-left: 1px solid var(--vscode-panel-border);
} }
.split-view.vertical.sidebar-first > .split-view-sidebar { .split-view.vertical.sidebar-first > .split-view-sidebar {
border-bottom: 1px solid #ddd; border-bottom: 1px solid var(--vscode-panel-border);
} }
.split-view.horizontal.sidebar-first > .split-view-sidebar { .split-view.horizontal.sidebar-first > .split-view-sidebar {
border-right: 1px solid #ddd; border-right: 1px solid var(--vscode-panel-border);
} }
.split-view-resizer { .split-view-resizer {

View File

@ -17,7 +17,8 @@
.toolbar { .toolbar {
display: flex; display: flex;
box-shadow: var(--box-shadow); box-shadow: var(--box-shadow);
background-color: var(--toolbar-bg-color); background-color: var(--vscode-sideBar-background);
color: var(--vscode-sideBarTitle-foreground);
height: 40px; height: 40px;
align-items: center; align-items: center;
padding-right: 10px; padding-right: 10px;
@ -31,19 +32,21 @@
} }
.toolbar input { .toolbar input {
border: 1px solid #ddd;
padding: 0 10px; padding: 0 10px;
border-radius: 14px;
line-height: 24px; line-height: 24px;
background: white;
outline: none; outline: none;
margin-left: 10px; margin-left: 10px;
color: var(--toolbar-color);
} }
.toolbar select { .toolbar select {
border: none;
background: none; background: none;
outline: none; outline: none;
color: var(--toolbar-color); padding: 3px;
margin: 2px;
}
.toolbar input, .toolbar select {
border: none;
color: var(--vscode-input-foreground);
background-color: var(--vscode-input-background);
} }

View File

@ -17,9 +17,9 @@
.toolbar-button { .toolbar-button {
border: none; border: none;
outline: none; outline: none;
color: var(--toolbar-color); color: var(--vscode-sideBarTitle-foreground);
background: transparent; background: transparent;
padding: 0; padding: 4px;
margin-left: 10px; margin-left: 10px;
cursor: pointer; cursor: pointer;
display: inline-flex; display: inline-flex;
@ -27,14 +27,14 @@
} }
.toolbar-button:disabled { .toolbar-button:disabled {
color: #bbb !important; color: var(--vscode-disabledForeground) !important;
cursor: default; cursor: default;
} }
.toolbar-button:not(.disabled):hover { .toolbar-button:not(:disabled):hover {
color: #333; background-color: var(--vscode-toolbar-hoverBackground);
} }
.toolbar-button .codicon { .toolbar-button:not(:disabled):active {
margin-right: 4px; background-color: var(--vscode-toolbar-activeBackground);
} }

File diff suppressed because it is too large Load Diff