Skip to content

Commit 93d3535

Browse files
authored
Improve dev toolbar notification contrast on hover (#10657)
* fix(#10399, PLT-1786): improve notification contrast on hover * chore: add changeset
1 parent 8214bac commit 93d3535

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

.changeset/loud-wasps-pay.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"astro": patch
3+
---
4+
5+
Improves the color contrast for notification badges on dev toolbar apps

packages/astro/src/runtime/client/dev-toolbar/entrypoint.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ document.addEventListener('DOMContentLoaded', async () => {
6565
const notificationLevels = ['error', 'warning', 'info'] as const;
6666
const notificationSVGs: Record<(typeof notificationLevels)[number], string> = {
6767
error:
68-
'<svg viewBox="0 0 10 10"><rect width="9" height="9" x=".5" y=".5" fill="#B33E66" stroke="#13151A" rx="4.5"/></svg>',
68+
'<svg viewBox="0 0 10 10" style="--fill:var(--fill-default);--fill-default:#B33E66;--fill-hover:#E3AFC1;"><rect width="9" height="9" x=".5" y=".5" fill="var(--fill)" stroke="#13151A" stroke-width="2" rx="4.5"/></svg>',
6969
warning:
70-
'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="10" fill="none"><path fill="#B58A2D" stroke="#13151A" d="M7.29904 1.25c-.57735-1-2.02073-1-2.59808 0l-3.4641 6C.65951 8.25 1.3812 9.5 2.5359 9.5h6.9282c1.1547 0 1.8764-1.25 1.299-2.25l-3.46406-6Z"/></svg>',
71-
info: '<svg viewBox="0 0 10 10"><rect width="9" height="9" x=".5" y=".5" fill="#3645D9" stroke="#13151A" rx="1.5"/></svg>',
70+
'<svg width="12" height="10" fill="none" style="--fill:var(--fill-default);--fill-default:#B58A2D;--fill-hover:#D5B776;"><path fill="var(--fill)" stroke="#13151A" stroke-width="2" d="M7.29904 1.25c-.57735-1-2.02073-1-2.59808 0l-3.4641 6C.65951 8.25 1.3812 9.5 2.5359 9.5h6.9282c1.1547 0 1.8764-1.25 1.299-2.25l-3.46406-6Z"/></svg>',
71+
info: '<svg viewBox="0 0 10 10" style="--fill:var(--fill-default);--fill-default:#3645D9;--fill-hover:#BDC3FF;"><rect width="9" height="9" x=".5" y=".5" fill="var(--fill)" stroke="#13151A" stroke-width="2" rx="1.5"/></svg>',
7272
} as const;
7373

7474
const prepareApp = (appDefinition: DevToolbarAppDefinition, builtIn: boolean): DevToolbarApp => {

packages/astro/src/runtime/client/dev-toolbar/toolbar.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,14 @@ export class AstroDevToolbar extends HTMLElement {
189189
}
190190
}
191191
192+
#dev-bar #bar-container .item:hover .notification rect, #dev-bar #bar-container .item:hover .notification path {
193+
stroke: #38393D;
194+
--fill: var(--fill-hover);
195+
}
196+
192197
#dev-bar #bar-container .item.active .notification rect, #dev-bar #bar-container .item.active .notification path {
193-
stroke: rgba(71, 78, 94, 1);
198+
stroke: #454C5C;
199+
--fill: var(--fill-hover);
194200
}
195201
196202
#dev-bar .item .icon {

0 commit comments

Comments
 (0)