Skip to content

Commit

Permalink
feat: make datatips look like the linter tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Mar 19, 2021
1 parent 28a84dc commit 9f97375
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
5 changes: 4 additions & 1 deletion lib/datatip-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,10 @@ export class DataTipManager {
position: Point,
view: ViewContainer
): CompositeDisposable | null {
const element = view.element as HTMLElement
const element = document.createElement("div")
element.className = "datatip-border"

element.appendChild(view.element as HTMLElement)

// TODO do we need this?
if (!element) {
Expand Down
19 changes: 15 additions & 4 deletions styles/atom-ide-datatips.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
@import "ui-variables";
@import "syntax-variables";

// .datatip-overlay {
// }

.datatip-border {
background: @overlay-background-color;
padding: 10px;
}

.datatip-element {
.datatip-responsive-effect();

overflow: auto; // prevents the long text to come out of the datatip
color: @syntax-text-color;
white-space: nowrap;
Expand Down Expand Up @@ -38,15 +48,16 @@
width: auto;
}

.datatip-overlay {
.datatip-responsive-effect() {
margin-left: 5px;
// info border
border-bottom: 5px solid @background-color-highlight;
border-left: 5px solid @background-color-highlight;
border-radius: 3px;

// info bar glow
transition: border-bottom-color 0.15s ease;
transition: border-left-color 0.15s ease;
&:hover {
border-bottom-color: lighten(@background-color-highlight, 10%);
border-left-color: lighten(@background-color-highlight, 10%);
}
}

Expand Down

0 comments on commit 9f97375

Please sign in to comment.