Skip to content

Commit ab220e9

Browse files
author
Tajudeen
committed
Fix menubar dropdown theming for dark theme on Windows
- Add comprehensive CSS rules using VS Code theme variables - Set font-family to match codebase (Segoe WPC, Segoe UI for Windows) - Ensure menu text uses light foreground color (#E0E0E0) not black - Set proper background colors using CSS variables - Add hover/focus state styling with selection colors - Style icons, keybindings, and disabled states - Use CSS variable fallbacks to ensure theming works even if inline styles fail
1 parent 7f09b8f commit ab220e9

1 file changed

Lines changed: 77 additions & 2 deletions

File tree

src/vs/base/browser/ui/menu/menubar.css

Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,24 +122,99 @@ body > .menubar-menu-items-holder.monaco-menu-container {
122122
background: transparent !important;
123123
}
124124

125-
/* Ensure proper height calculation for menu content on Windows */
126-
/* Note: Menu widget applies colors via IMenuStyles, so we only fix sizing here */
125+
/* Ensure proper height calculation and theming for menu content on Windows */
126+
/* Menu widget applies colors via IMenuStyles inline styles, but we add CSS variable fallbacks */
127127
body > .menubar-menu-items-holder.monaco-menu-container .monaco-scrollable-element {
128128
/* Ensure proper height calculation - let content determine height */
129129
height: auto !important;
130130
min-height: fit-content !important;
131+
/* Theme colors - use CSS variables as fallback if inline styles aren't applied */
132+
background-color: var(--vscode-menu-background, #060606) !important;
133+
color: var(--vscode-menu-foreground, #E0E0E0) !important;
134+
border-color: var(--vscode-menu-border, #1C1C1C) !important;
135+
/* Font family to match codebase */
136+
font-family: "Segoe WPC", "Segoe UI", sans-serif !important;
131137
}
132138

133139
body > .menubar-menu-items-holder.monaco-menu-container .monaco-menu {
134140
/* Ensure proper height calculation */
135141
height: auto !important;
136142
min-height: fit-content !important;
143+
/* Theme colors */
144+
background-color: var(--vscode-menu-background, #060606) !important;
145+
color: var(--vscode-menu-foreground, #E0E0E0) !important;
146+
/* Font family */
147+
font-family: "Segoe WPC", "Segoe UI", sans-serif !important;
137148
}
138149

139150
body > .menubar-menu-items-holder.monaco-menu-container .actions-container {
140151
/* Ensure proper height calculation */
141152
height: auto !important;
142153
min-height: fit-content !important;
154+
/* Theme colors */
155+
color: var(--vscode-menu-foreground, #E0E0E0) !important;
156+
/* Font family */
157+
font-family: "Segoe WPC", "Segoe UI", sans-serif !important;
158+
}
159+
160+
body > .menubar-menu-items-holder.monaco-menu-container .monaco-action-bar {
161+
/* Font family */
162+
font-family: "Segoe WPC", "Segoe UI", sans-serif !important;
163+
}
164+
165+
/* Menu items - ensure proper text color and font */
166+
body > .menubar-menu-items-holder.monaco-menu-container .action-menu-item {
167+
color: var(--vscode-menu-foreground, #E0E0E0) !important;
168+
font-family: "Segoe WPC", "Segoe UI", sans-serif !important;
169+
}
170+
171+
body > .menubar-menu-items-holder.monaco-menu-container .action-label {
172+
color: var(--vscode-menu-foreground, #E0E0E0) !important;
173+
font-family: "Segoe WPC", "Segoe UI", sans-serif !important;
174+
}
175+
176+
body > .menubar-menu-items-holder.monaco-menu-container .keybinding {
177+
color: var(--vscode-menu-foreground, #E0E0E0) !important;
178+
font-family: "Segoe WPC", "Segoe UI", sans-serif !important;
179+
opacity: 0.7;
180+
}
181+
182+
/* Menu item hover and focus states */
183+
body > .menubar-menu-items-holder.monaco-menu-container .action-menu-item:hover,
184+
body > .menubar-menu-items-holder.monaco-menu-container .action-menu-item:focus {
185+
background-color: var(--vscode-menu-selectionBackground, #161016) !important;
186+
color: var(--vscode-menu-selectionForeground, #FFFFFF) !important;
187+
}
188+
189+
body > .menubar-menu-items-holder.monaco-menu-container .action-menu-item:hover .action-label,
190+
body > .menubar-menu-items-holder.monaco-menu-container .action-menu-item:focus .action-label,
191+
body > .menubar-menu-items-holder.monaco-menu-container .action-menu-item:hover .keybinding,
192+
body > .menubar-menu-items-holder.monaco-menu-container .action-menu-item:focus .keybinding {
193+
color: var(--vscode-menu-selectionForeground, #FFFFFF) !important;
194+
}
195+
196+
/* Icons and indicators */
197+
body > .menubar-menu-items-holder.monaco-menu-container .codicon,
198+
body > .menubar-menu-items-holder.monaco-menu-container .submenu-indicator,
199+
body > .menubar-menu-items-holder.monaco-menu-container .menu-item-check {
200+
color: var(--vscode-menu-foreground, #E0E0E0) !important;
201+
}
202+
203+
body > .menubar-menu-items-holder.monaco-menu-container .action-menu-item:hover .codicon,
204+
body > .menubar-menu-items-holder.monaco-menu-container .action-menu-item:focus .codicon,
205+
body > .menubar-menu-items-holder.monaco-menu-container .action-menu-item:hover .submenu-indicator,
206+
body > .menubar-menu-items-holder.monaco-menu-container .action-menu-item:focus .submenu-indicator,
207+
body > .menubar-menu-items-holder.monaco-menu-container .action-menu-item:hover .menu-item-check,
208+
body > .menubar-menu-items-holder.monaco-menu-container .action-menu-item:focus .menu-item-check {
209+
color: var(--vscode-menu-selectionForeground, #FFFFFF) !important;
210+
}
211+
212+
/* Disabled menu items */
213+
body > .menubar-menu-items-holder.monaco-menu-container .action-item.disabled .action-label,
214+
body > .menubar-menu-items-holder.monaco-menu-container .action-item.disabled .keybinding,
215+
body > .menubar-menu-items-holder.monaco-menu-container .action-item.disabled .codicon {
216+
color: var(--vscode-disabledForeground, #6E6E6E) !important;
217+
opacity: 0.4;
143218
}
144219

145220
.menubar .toolbar-toggle-more {

0 commit comments

Comments
 (0)