Skip to content
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

feat: make datatips look like the linter tooltips #132

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/datatip-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export class DataTipManager {
containerClassName: "datatip-component-container",
contentClassName: "datatip-component",
},
className: "datatip-element select-list popover-list",
className: "datatip-element",
})
this.dataTipMarkerDisposables = this.mountDataTipWithMarker(editor, datatip.range, position, dataTipView)
} else if (datatip.markedStrings.length > 0) {
Expand Down Expand Up @@ -399,7 +399,7 @@ export class DataTipManager {
const dataTipView = new ViewContainer({
snippet,
markdown,
className: "datatip-element select-list popover-list",
className: "datatip-element",
})

this.dataTipMarkerDisposables = this.mountDataTipWithMarker(editor, datatip.range, position, dataTipView)
Expand All @@ -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
25 changes: 16 additions & 9 deletions styles/atom-ide-datatips.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
@import "ui-variables";
@import "syntax-variables";

// .datatip-overlay {
// }

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

.datatip-element {
background: @app-background-color;
.datatip-hover-effect();
padding: 2px;

overflow: auto; // prevents the long text to come out of the datatip
color: @syntax-text-color;
white-space: nowrap;
Expand Down Expand Up @@ -34,19 +46,14 @@
}
}

.datatip-element.select-list.popover-list {
width: auto;
}

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

// 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