-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Refactor hover widget styles for improved layout and spacing #276702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -48,7 +48,7 @@ | |||
| .monaco-hover h4, | ||||
| .monaco-hover h5, | ||||
| .monaco-hover h6 { | ||||
| margin: 8px 0; | ||||
| margin: 4px 0; | ||||
| } | ||||
|
|
||||
| .monaco-hover h1, | ||||
|
|
@@ -68,20 +68,33 @@ | |||
| box-sizing: border-box; | ||||
| border-left: 0px; | ||||
| border-right: 0px; | ||||
| margin-top: 4px; | ||||
| margin-bottom: -4px; | ||||
| margin-top: 0px; | ||||
| margin-bottom: 0px; | ||||
| margin-left: -8px; | ||||
| margin-right: -8px; | ||||
| height: 1px; | ||||
| } | ||||
|
|
||||
| .monaco-hover p:first-child, | ||||
| .monaco-hover .code:first-child, | ||||
| .monaco-hover ul:first-child { | ||||
| margin-top: 0; | ||||
| } | ||||
|
|
||||
| .monaco-hover p:last-child, | ||||
| .monaco-hover p:first-child { | ||||
| margin-top: 4px; | ||||
| display: flex; | ||||
| align-items: center; | ||||
| } | ||||
|
Comment on lines
+83
to
+87
|
||||
|
|
||||
| .monaco-hover p:first-child img { | ||||
| border-radius: 50%; | ||||
| margin-right: 4px; | ||||
| } | ||||
|
|
||||
| .monaco-hover p:last-child { | ||||
| margin-bottom: 2px; | ||||
| } | ||||
|
|
||||
| .monaco-hover .code:last-child, | ||||
| .monaco-hover ul:last-child { | ||||
| margin-bottom: 0; | ||||
|
|
@@ -199,7 +212,8 @@ | |||
| * https://github.com/microsoft/vscode/issues/221359 | ||||
| */ | ||||
| .monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span.codicon { | ||||
| margin-bottom: 2px; | ||||
| /* margin-bottom: 2px; */ | ||||
|
||||
| /* margin-bottom: 2px; */ |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,7 +8,6 @@ | |||||||||||||
| .monaco-hover.workbench-hover { | ||||||||||||||
| position: relative; | ||||||||||||||
| font-size: 13px; | ||||||||||||||
| line-height: 19px; | ||||||||||||||
| /* Must be higher than sash's z-index and terminal canvases */ | ||||||||||||||
| z-index: 40; | ||||||||||||||
| overflow: hidden; | ||||||||||||||
|
|
@@ -34,6 +33,25 @@ | |||||||||||||
| font-size: 12px; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| .monaco-hover.workbench-hover.compact .codicon, | ||||||||||||||
|
||||||||||||||
| .monaco-hover.workbench-hover.compact .codicon, | |
| .monaco-hover.workbench-hover.compact .codicon { | |
| font-size: 16px; | |
| } |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using !important to override inline styles is a code smell that suggests the underlying issue should be fixed at the source. The comment states this is to override inline styles, but it would be better to avoid setting inline styles for codicon font-size in the first place. Consider addressing the root cause instead of using !important.
| /* Increase codicon size in hover content paragraphs - use !important to override inline styles */ | |
| .monaco-hover .monaco-hover-content p .codicon { | |
| font-size: 16px !important; | |
| /* Increase codicon size in hover content paragraphs */ | |
| .monaco-hover .monaco-hover-content p .codicon { | |
| font-size: 16px; |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Setting display: flex on all last paragraph elements without specific justification could cause layout issues. This appears to be specifically needed for the anchor element styling on lines 50-53, but will affect all last paragraphs regardless of whether they contain links. Consider a more specific selector like p:last-child:has(a) or document why all last paragraphs need flex display.
| .monaco-hover .monaco-hover-content p:last-child { | |
| .monaco-hover .monaco-hover-content p:last-child:has(a) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary use of units with zero values. Per CSS best practices,
0pxshould be written as0(no unit needed). This applies to both margin-top and margin-bottom.