Skip to content

Commit 3aa69d5

Browse files
ktranDevtools-frontend LUCI CQ
authored andcommitted
Duplicate empty state styles in Recorder controller
This CL duplicates the styles required for the empty states in order to address the regression on focus styles if the window is narrow. In the long run we want to remove the preset instead, see linked bug crbug.com/400964588. Bug: 402024085, 400964588 Change-Id: I9198f314c9075214d081470e7e3c9a2252431a31 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6349186 Reviewed-by: Alex Rudenko <[email protected]> Commit-Queue: Kim-Anh Tran <[email protected]>
1 parent 106ff6a commit 3aa69d5

File tree

2 files changed

+36
-8
lines changed

2 files changed

+36
-8
lines changed

front_end/panels/recorder/RecorderController.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ import * as Buttons from '../../ui/components/buttons/buttons.js';
1717
import type * as Dialogs from '../../ui/components/dialogs/dialogs.js';
1818
import * as ComponentHelpers from '../../ui/components/helpers/helpers.js';
1919
import type * as Menus from '../../ui/components/menus/menus.js';
20-
// inspectorCommonStyles is imported for the empty state styling that is used for the start view
21-
// eslint-disable-next-line rulesdir/es-modules-import
22-
import inspectorCommonStylesRaw from '../../ui/legacy/inspectorCommon.css.js';
2320
import * as UI from '../../ui/legacy/legacy.js';
2421
import * as Lit from '../../ui/lit/lit.js';
2522
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
@@ -34,10 +31,6 @@ import * as Actions from './recorder-actions/recorder-actions.js';
3431
import recorderControllerStylesRaw from './recorderController.css.js';
3532
import * as Events from './RecorderEvents.js';
3633

37-
// TODO(crbug.com/391381439): Fully migrate off of constructed style sheets.
38-
const inspectorCommonStyles = new CSSStyleSheet();
39-
inspectorCommonStyles.replaceSync(inspectorCommonStylesRaw.cssContent);
40-
4134
// TODO(crbug.com/391381439): Fully migrate off of constructed style sheets.
4235
const recorderControllerStyles = new CSSStyleSheet();
4336
recorderControllerStyles.replaceSync(recorderControllerStylesRaw.cssContent);
@@ -188,7 +181,7 @@ const CONVERTER_ID_TO_METRIC: Record<string, Host.UserMetrics.RecordingExported|
188181

189182
@customElement('devtools-recorder-controller')
190183
export class RecorderController extends LitElement {
191-
static override readonly styles = [recorderControllerStyles, inspectorCommonStyles];
184+
static override readonly styles = [recorderControllerStyles];
192185

193186
@state() declare private currentRecordingSession?: Models.RecordingSession.RecordingSession;
194187
@state() declare private currentRecording: StoredRecording|undefined;

front_end/panels/recorder/recorderController.css

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,38 @@ devtools-recording-list-view {
141141
.empty-state-description .x-link:focus-visible {
142142
outline: -webkit-focus-ring-color auto 1px;
143143
}
144+
145+
.empty-state {
146+
margin: var(--sys-size-5);
147+
display: flex;
148+
flex-grow: 1;
149+
justify-content: center;
150+
align-items: center;
151+
flex-direction: column;
152+
text-align: center;
153+
min-height: fit-content;
154+
min-width: fit-content;
155+
156+
> * {
157+
max-width: var(--sys-size-29);
158+
}
159+
160+
.empty-state-header {
161+
font: var(--sys-typescale-headline5);
162+
margin-bottom: var(--sys-size-3);
163+
}
164+
165+
.empty-state-description {
166+
font: var(--sys-typescale-body4-regular);
167+
color: var(--sys-color-on-surface-subtle);
168+
169+
> x-link { /* stylelint-disable-line selector-type-no-unknown */
170+
white-space: nowrap;
171+
margin-left: var(--sys-size-3);
172+
}
173+
}
174+
175+
> devtools-button {
176+
margin-top: var(--sys-size-7);
177+
}
178+
}

0 commit comments

Comments
 (0)