Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit f51407b

Browse files
starpitk8s-ci-robot
authored andcommitted
fix(plugins/plugin-client-common): split headers have low contrast in dark themes
part of #7538
1 parent 182da7b commit f51407b

File tree

4 files changed

+46
-18
lines changed

4 files changed

+46
-18
lines changed

plugins/plugin-client-common/src/components/Views/Terminal/ScrollableTerminal.tsx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import {
4545

4646
import Block from './Block'
4747
import getSize from './getSize'
48+
import SplitHeader from './SplitHeader'
4849
import { NotebookImpl, isNotebookImpl, snapshot, FlightRecorder, tabAlignment } from './Snapshot'
4950
import KuiConfiguration from '../../Client/KuiConfiguration'
5051
import { onCopy, onCut, onPaste } from './ClipboardTransfer'
@@ -1324,20 +1325,6 @@ export default class ScrollableTerminal extends React.PureComponent<Props, State
13241325
})
13251326
}
13261327

1327-
/** Render a header for the given split */
1328-
private splitHeader(scrollback: ScrollbackState) {
1329-
return (
1330-
this.state.splits.length > 1 && (
1331-
<div className="kui--split-header flex-layout kui--inverted-color-context">
1332-
<div className="flex-fill" />
1333-
<div className="kui--split-close-button" onClick={scrollback.remove}>
1334-
&#x2A2F;
1335-
</div>
1336-
</div>
1337-
)
1338-
)
1339-
}
1340-
13411328
/** Render one split */
13421329
private split(scrollback: ScrollbackState, sbidx: number) {
13431330
const tab = this.tabFor(scrollback)
@@ -1356,7 +1343,7 @@ export default class ScrollableTerminal extends React.PureComponent<Props, State
13561343
onClick={scrollback.onClick}
13571344
>
13581345
<React.Fragment>
1359-
{this.splitHeader(scrollback)}
1346+
{this.state.splits.length > 1 && <SplitHeader onRemove={scrollback.remove} />}
13601347
<ul className="kui--scrollback-block-list">{this.blocks(tab, scrollback, sbidx)}</ul>
13611348
</React.Fragment>
13621349
</div>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2021 The Kubernetes Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import React from 'react'
18+
19+
import '../../../../web/scss/components/Terminal/SplitHeader.scss'
20+
21+
interface Props {
22+
onRemove(): void
23+
}
24+
25+
/** Render a header for the given split */
26+
export default class SplitHeader extends React.PureComponent<Props> {
27+
public render() {
28+
return (
29+
<div className="kui--split-header flex-layout kui--inverted-color-context">
30+
<div className="flex-fill" />
31+
<div className="kui--split-close-button" onClick={this.props.onRemove}>
32+
&#x2A2F;
33+
</div>
34+
</div>
35+
)
36+
}
37+
}

plugins/plugin-client-common/web/scss/components/Terminal/SplitHeader.scss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@
1717
@import 'mixins';
1818

1919
@include SplitHeader {
20-
opacity: 0.925;
2120
padding: 0.125em 0;
21+
padding-left: $input-padding-left;
2222
padding-right: $input-padding-right;
23-
background-color: var(--color-stripe-01);
23+
24+
opacity: 0.925;
25+
background-color: var(--color-sidecar-toolbar-background);
26+
& > div {
27+
color: var(--color-sidecar-toolbar-foreground);
28+
}
2429
}
2530

2631
@include SplitHeaderClose {

plugins/plugin-client-common/web/scss/components/Terminal/_index.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@
2222
@import 'Scrollback';
2323
@import 'SourceRef';
2424
@import 'Spinner';
25-
@import 'SplitHeader';

0 commit comments

Comments
 (0)