Skip to content

Commit e268f6a

Browse files
authored
fix(theme): red Menu.Item label contrast in portaled menus (#2289)
## Summary - Add a global CSS override in `_base-tokens.scss` so `Menu.Item` with `color="red"` uses `--mantine-color-red-light-color` for `--menu-item-color`, matching danger controls and fixing low contrast from Mantine default `red-6`. - `Menu.extend` item styles cannot target these rows because Popover defaults to `withinPortal`, so the dropdown DOM is outside the `Menu` root. <img width="832" height="612" alt="image" src="https://github.com/user-attachments/assets/436e143b-813c-4460-98e0-263c3a16e346" /> ## Test plan - [ ] Open user menu, confirm Logout (red row) label reads clearly in light and dark mode. - [ ] Smoke another menu with a red item if applicable. Made with [Cursor](https://cursor.com)
1 parent e2db2ef commit e268f6a

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperdx/app": patch
3+
---
4+
5+
Fix label color for red `Menu.Item` rows (for example Logout) by overriding `--menu-item-color` in global CSS. `Menu.extend` item styles do not apply when the menu dropdown is portaled outside the Menu root.

‎packages/app/src/theme/themes/_base-tokens.scss‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,14 @@
2020
[data-mantine-color-scheme='light'] {
2121
@include hyperdx-tokens.light-mode-tokens;
2222
}
23+
24+
/*
25+
* Menu.Item + color="red": Mantine inlines --menu-item-color as red-6 while
26+
* --menu-item-hover uses red-light-hover. `Menu.extend` styles do not reach items
27+
* because Popover defaults to withinPortal — the dropdown is outside the Menu
28+
* root, so component-scoped theme CSS never matches. Global rule + !important
29+
* beats inline vars; substring matches Mantine red light hover token.
30+
*/
31+
[data-menu-item][style*='red-light-hover'] {
32+
--menu-item-color: var(--mantine-color-red-light-color) !important;
33+
}

0 commit comments

Comments
 (0)