Skip to content

Commit eb8ae98

Browse files
committed
Fixes content color on alerts and gates
1 parent 31cf8b7 commit eb8ae98

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

src/webviews/apps/commitDetails/components/gl-inspect-nav.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export class GlInspectNav extends LitElement {
2828
:host([pinned]) {
2929
background-color: var(--color-alert-warningBackground);
3030
box-shadow: 0 0 0 0.1rem var(--color-alert-warningBorder);
31+
color: var(--color-alert-warningForeground);
3132
border-radius: 0.3rem;
3233
}
3334

src/webviews/apps/home/home.css.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,26 @@ export const alertStyles = css`
182182
display: none;
183183
}
184184
.alert--info {
185+
--color-alert-foreground: var(--color-alert-infoForeground);
185186
background-color: var(--color-alert-infoBackground);
186187
border-left-color: var(--color-alert-infoBorder);
187188
}
188189
.alert--warning {
190+
--color-alert-foreground: var(--color-alert-warningForeground);
189191
background-color: var(--color-alert-warningBackground);
190192
border-left-color: var(--color-alert-warningBorder);
191193
}
192194
.alert--danger {
195+
--color-alert-foreground: var(--color-alert-errorForeground);
193196
background-color: var(--color-alert-errorBackground);
194197
border-left-color: var(--color-alert-errorBorder);
195198
}
199+
.alert a:not(:hover) {
200+
color: color-mix(in srgb, var(--color-alert-foreground) 50%, var(--vscode-textLink-foreground));
201+
}
202+
.alert a:hover {
203+
color: color-mix(in srgb, var(--color-alert-foreground) 50%, var(--vscode-textLink-activeForeground));
204+
}
196205
`;
197206

198207
export const navListStyles = css`

src/webviews/apps/shared/components/feature-gate.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,20 @@ export class GlFeatureGate extends LitElement {
6969
7070
:host-context(body[data-placement='editor']) section,
7171
:host([appearance='alert']) section {
72-
--section-foreground: var(--color-alert-foreground);
72+
--section-foreground: var(--color-alert-infoForeground);
7373
--section-background: var(--color-alert-infoBackground);
7474
--section-border-color: var(--color-alert-infoBorder);
7575
7676
--link-decoration-default: underline;
77-
--link-foreground: var(--vscode-foreground);
77+
--link-foreground: color-mix(in srgb, var(--section-foreground) 50%, var(--textLink-foreground));
7878
/* --link-foreground-active: var(--vscode-foreground); */
7979
8080
/* --link-foreground: var(--vscode-textLink-foreground); */
81-
--link-foreground-active: var(--vscode-textLink-activeForeground);
81+
--link-foreground-active: color-mix(
82+
in srgb,
83+
var(--section-foreground) 50%,
84+
var(--vscode-textLink-activeForeground)
85+
);
8286
8387
border-radius: 0.3rem;
8488
max-width: 600px;

src/webviews/apps/shared/styles/theme.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,15 @@
7070

7171
--color-alert-infoBackground: var(--vscode-inputValidation-infoBackground);
7272
--color-alert-infoBorder: var(--vscode-inputValidation-infoBorder);
73+
--color-alert-infoForeground: var(--vscode-inputValidation-infoForeground, var(--color-alert-foreground));
7374

7475
--color-alert-warningBackground: var(--vscode-inputValidation-warningBackground);
7576
--color-alert-warningBorder: var(--vscode-inputValidation-warningBorder);
77+
--color-alert-warningForeground: var(--vscode-inputValidation-warningForeground, var(--color-alert-foreground));
7678

7779
--color-alert-errorBackground: var(--vscode-inputValidation-errorBackground);
7880
--color-alert-errorBorder: var(--vscode-inputValidation-errorBorder);
81+
--color-alert-errorForeground: var(--vscode-inputValidation-errorForeground, var(--color-alert-foreground));
7982

8083
--color-alert-neutralBorder: var(--vscode-input-foreground);
8184

0 commit comments

Comments
 (0)