Skip to content

Commit

Permalink
Improve styling of the signature
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski committed Aug 30, 2021
1 parent 5ffa540 commit 04912dc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions packages/jupyterlab-lsp/src/components/free_tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { IEditorPosition } from '../positioning';
const MIN_HEIGHT = 20;
const MAX_HEIGHT = 250;

const CLASS_NAME = 'lsp-tooltip';

interface IFreeTooltipOptions extends Tooltip.IOptions {
/**
* Position at which the tooltip should be placed, or null (default) to use the current cursor position.
Expand Down Expand Up @@ -171,6 +173,7 @@ export class EditorTooltipManager {
rendermime: this.rendermime_registry,
position: PositionConverter.cm_to_ce(position)
});
tooltip.addClass(CLASS_NAME);
tooltip.addClass(options.className);
Widget.attach(tooltip, document.body);
this.currentTooltip = tooltip;
Expand Down
3 changes: 2 additions & 1 deletion packages/jupyterlab-lsp/style/index.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import url('./highlight.css');
@import url('./hover.css');
@import url('./tooltip.css');
@import url('./signature.css');

.lsp-document-locator:hover {
cursor: pointer;
Expand Down
3 changes: 3 additions & 0 deletions packages/jupyterlab-lsp/style/signature.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.lsp-signature-help pre code {
font-size: var(--jp-code-font-size);
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.lsp-hover .jp-RenderedHTMLCommon {
.lsp-tooltip .jp-RenderedHTMLCommon {
/* Reduce the default padding from 20px to 0px */
padding-right: 0px;
}

.lsp-hover .jp-RenderedHTMLCommon > *:last-child {
.lsp-tooltip .jp-RenderedHTMLCommon > *:last-child {
/* Reduce the default margin */
margin-bottom: 0;
}

0 comments on commit 04912dc

Please sign in to comment.