Skip to content

Commit 66acf79

Browse files
committed
Remove gradient backgrounds and dynamic gradient sizing from StatusBar in favor of solid theme colors and VS Code list hover styling
1 parent 4830fe3 commit 66acf79

2 files changed

Lines changed: 36 additions & 50 deletions

File tree

‎packages/ui/src/components/editor/prompt/StatusBar/StatusBar.module.scss‎

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,63 +30,66 @@
3030

3131
.theme-default {
3232
color: var(--cwc-text-color);
33-
background: var(--cwc-bg-tertiary);
34-
background: linear-gradient(
35-
90deg,
36-
var(--cwc-bg-secondary) var(--gradient-start, 40px),
37-
var(--cwc-bg-tertiary) var(--gradient-end, 140px)
38-
);
33+
background-color: var(--cwc-bg-tertiary);
3934
--theme-description-color: var(--cwc-text-color-dimmed);
35+
36+
.action {
37+
color: var(--vscode-textLink-foreground);
38+
}
39+
40+
.action:hover {
41+
background-color: var(--cwc-bg-tertiary);
42+
}
4043
}
4144

4245
.theme-warning {
4346
color: var(--cwc-yellow-foreground);
44-
background: linear-gradient(
45-
90deg,
46-
var(--cwc-yellow-background) var(--gradient-start, 40px),
47-
var(--cwc-bg-tertiary) var(--gradient-end, 140px)
48-
);
47+
background-color: var(--cwc-yellow-background);
4948
--theme-description-color: var(--cwc-yellow-foreground-dimmed);
49+
50+
.action:hover {
51+
background-color: var(--cwc-yellow-background);
52+
}
5053
}
5154

5255
.theme-success {
5356
color: var(--cwc-green-foreground);
54-
background: linear-gradient(
55-
90deg,
56-
var(--cwc-green-background) var(--gradient-start, 40px),
57-
var(--cwc-bg-tertiary) var(--gradient-end, 140px)
58-
);
57+
background-color: var(--cwc-green-background);
5958
--theme-description-color: var(--cwc-green-foreground-dimmed);
59+
60+
.action:hover {
61+
background-color: var(--cwc-green-background);
62+
}
6063
}
6164

6265
.theme-error {
6366
color: var(--cwc-red-foreground);
64-
background: linear-gradient(
65-
90deg,
66-
var(--cwc-red-background) var(--gradient-start, 40px),
67-
var(--cwc-bg-tertiary) var(--gradient-end, 140px)
68-
);
67+
background-color: var(--cwc-red-background);
6968
--theme-description-color: var(--cwc-red-foreground-dimmed);
69+
70+
.action:hover {
71+
background-color: var(--cwc-red-background);
72+
}
7073
}
7174

7275
.theme-blue {
7376
color: var(--cwc-blue-foreground);
74-
background: linear-gradient(
75-
90deg,
76-
var(--cwc-blue-background) var(--gradient-start, 40px),
77-
var(--cwc-bg-tertiary) var(--gradient-end, 140px)
78-
);
77+
background-color: var(--cwc-blue-background);
7978
--theme-description-color: var(--cwc-blue-foreground-dimmed);
79+
80+
.action:hover {
81+
background-color: var(--cwc-blue-background);
82+
}
8083
}
8184

8285
.theme-purple {
8386
color: var(--cwc-purple-foreground);
84-
background: linear-gradient(
85-
90deg,
86-
var(--cwc-purple-background) var(--gradient-start, 40px),
87-
var(--cwc-bg-tertiary) var(--gradient-end, 140px)
88-
);
87+
background-color: var(--cwc-purple-background);
8988
--theme-description-color: var(--cwc-purple-foreground-dimmed);
89+
90+
.action:hover {
91+
background-color: var(--cwc-purple-background);
92+
}
9093
}
9194

9295
.content {
@@ -139,9 +142,8 @@
139142
cursor: pointer;
140143
white-space: nowrap;
141144
padding: 0 7px 0 4px;
142-
color: var(--cwc-text-color-dimmed);
143145

144146
&:hover {
145-
background-color: var(--cwc-bg-tertiary);
147+
background-color: var(--vscode-list-hoverBackground);
146148
}
147149
}

‎packages/ui/src/components/editor/prompt/StatusBar/StatusBar.tsx‎

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export type StatusBarAction = {
1313
}
1414

1515
export type Props = {
16-
label: React.ReactNode
16+
label: string
1717
theme?: 'default' | 'warning' | 'success' | 'error' | 'blue' | 'purple'
1818
placement?: 'top' | 'bottom'
1919
icon?: string
@@ -26,16 +26,6 @@ export type Props = {
2626
export const StatusBar: React.FC<Props> = (props) => {
2727
const theme = props.theme ?? 'default'
2828

29-
let char_count = 0
30-
if (typeof props.label === 'string') {
31-
char_count = props.label.length
32-
} else if (typeof props.label === 'number') {
33-
char_count = props.label.toString().length
34-
}
35-
36-
const gradient_start = char_count * 3 + 20
37-
const gradient_end = gradient_start + 100
38-
3929
return (
4030
<div
4131
className={cn(
@@ -46,12 +36,6 @@ export const StatusBar: React.FC<Props> = (props) => {
4636
: styles.rounded,
4737
props.className
4838
)}
49-
style={
50-
{
51-
'--gradient-start': `${gradient_start}px`,
52-
'--gradient-end': `${gradient_end}px`
53-
} as React.CSSProperties
54-
}
5539
>
5640
<div className={styles.content}>
5741
{props.icon && (

0 commit comments

Comments
 (0)