Skip to content

Commit 9f97375

Browse files
committed
feat: make datatips look like the linter tooltips
1 parent 28a84dc commit 9f97375

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

lib/datatip-manager.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,10 @@ export class DataTipManager {
425425
position: Point,
426426
view: ViewContainer
427427
): CompositeDisposable | null {
428-
const element = view.element as HTMLElement
428+
const element = document.createElement("div")
429+
element.className = "datatip-border"
430+
431+
element.appendChild(view.element as HTMLElement)
429432

430433
// TODO do we need this?
431434
if (!element) {

styles/atom-ide-datatips.less

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
@import "ui-variables";
22
@import "syntax-variables";
33

4+
// .datatip-overlay {
5+
// }
6+
7+
.datatip-border {
8+
background: @overlay-background-color;
9+
padding: 10px;
10+
}
11+
412
.datatip-element {
13+
.datatip-responsive-effect();
14+
515
overflow: auto; // prevents the long text to come out of the datatip
616
color: @syntax-text-color;
717
white-space: nowrap;
@@ -38,15 +48,16 @@
3848
width: auto;
3949
}
4050

41-
.datatip-overlay {
51+
.datatip-responsive-effect() {
52+
margin-left: 5px;
4253
// info border
43-
border-bottom: 5px solid @background-color-highlight;
54+
border-left: 5px solid @background-color-highlight;
4455
border-radius: 3px;
4556

4657
// info bar glow
47-
transition: border-bottom-color 0.15s ease;
58+
transition: border-left-color 0.15s ease;
4859
&:hover {
49-
border-bottom-color: lighten(@background-color-highlight, 10%);
60+
border-left-color: lighten(@background-color-highlight, 10%);
5061
}
5162
}
5263

0 commit comments

Comments
 (0)