Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/sessions/browser/parts/mobile/mobileSidebarPart.ts
13399 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { AbstractPaneCompositePart } from '../../../../workbench/browser/parts/paneCompositePart.js';
7
import { SidebarPart } from '../sidebarPart.js';
8
import { isPhoneLayout } from './mobileLayout.js';
9
10
/**
11
* Mobile variant of SidebarPart.
12
*
13
* On phone-sized viewports the sidebar skips card-specific inline styles
14
* so that CSS-only theming takes over. On tablet/desktop it falls back
15
* to the desktop behavior so runtime viewport transitions keep working.
16
*/
17
export class MobileSidebarPart extends SidebarPart {
18
19
override updateStyles(): void {
20
// Run base theme wiring; this also cascades to AbstractPaneCompositePart.
21
super.updateStyles();
22
23
if (!isPhoneLayout(this.layoutService)) {
24
return;
25
}
26
27
// Skip SidebarPart's card / title-area inline styles on phone.
28
AbstractPaneCompositePart.prototype.updateStyles.call(this);
29
30
const container = this.getContainer();
31
if (container) {
32
container.style.backgroundColor = '';
33
container.style.color = '';
34
container.style.outlineColor = '';
35
}
36
}
37
}
38
39