Skip to content

Commit fc0aa31

Browse files
committed
Specify max-width on both side-by-side and details-below
1 parent 6a2105e commit fc0aa31

File tree

2 files changed

+72
-53
lines changed

2 files changed

+72
-53
lines changed

packages/completion-theme/style/index.css

Lines changed: 72 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,21 @@
2424
overflow: auto;
2525
}
2626

27+
.jp-Completer {
28+
--lsp-completer-max-label-width: 300px;
29+
--lsp-completer-max-detail-width: 200px;
30+
}
31+
2732
.jp-Completer-match {
28-
max-width: 400px;
33+
max-width: var(--lsp-completer-max-label-width);
2934
overflow-x: hidden;
3035
white-space: nowrap;
3136
display: block;
3237
text-overflow: ellipsis;
3338
}
3439

3540
.jp-mod-active .jp-Completer-match {
36-
max-width: 600px;
37-
white-space: break-spaces;
38-
height: auto;
41+
text-overflow: clip;
3942
}
4043

4144
.lsp-completer-placeholder:after {
@@ -47,3 +50,68 @@
4750
.jp-Completer-docpanel pre code {
4851
font-size: 90%;
4952
}
53+
54+
body[data-lsp-completer-layout='detail-below'] .jp-Completer-item {
55+
--lsp-completer-label-height: 24px;
56+
--lsp-completer-detail-height: 20px;
57+
--lsp-completer-icon-width: 16px;
58+
height: var(--lsp-completer-label-height);
59+
display: grid;
60+
grid-template-areas:
61+
'icon label'
62+
'detail detail';
63+
grid-template-columns: min-content 1fr;
64+
}
65+
66+
body[data-lsp-completer-layout='detail-below']
67+
.jp-Completer-item.jp-mod-active {
68+
height: calc(
69+
var(--lsp-completer-detail-height) + var(--lsp-completer-label-height)
70+
);
71+
}
72+
73+
body[data-lsp-completer-layout='detail-below'] .jp-Completer-icon {
74+
grid-area: icon;
75+
width: var(--lsp-completer-icon-width);
76+
}
77+
78+
body[data-lsp-completer-layout='detail-below'] .jp-Completer-match {
79+
grid-area: label;
80+
overflow: hidden;
81+
height: var(--lsp-completer-label-height);
82+
}
83+
84+
.jp-Completer-item .jp-Completer-typeExtended {
85+
max-width: var(--lsp-completer-max-detail-width);
86+
min-height: 50px;
87+
overflow-x: hidden;
88+
text-overflow: ellipsis;
89+
}
90+
91+
.jp-mod-active .jp-Completer-typeExtended {
92+
text-overflow: clip;
93+
}
94+
95+
body[data-lsp-completer-layout='detail-below'] .jp-Completer-typeExtended {
96+
grid-area: detail;
97+
text-align: left;
98+
padding-left: calc(var(--lsp-completer-icon-width) + 8px);
99+
height: var(--lsp-completer-detail-height);
100+
line-height: var(--lsp-completer-detail-height);
101+
display: none;
102+
position: relative;
103+
top: -2px;
104+
overflow: hidden;
105+
max-width: calc(var(--lsp-completer-max-label-width) + var(--lsp-completer-max-detail-width));
106+
}
107+
108+
body[data-lsp-completer-layout='detail-below'] .jp-Completer-match {
109+
overflow: hidden;
110+
max-width: calc(var(--lsp-completer-max-label-width) + var(--lsp-completer-max-detail-width));
111+
}
112+
113+
body[data-lsp-completer-layout='detail-below']
114+
.jp-Completer-item.jp-mod-active
115+
.jp-Completer-typeExtended {
116+
display: block;
117+
}

packages/theme-material/style/completer.css

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -9,52 +9,3 @@
99
.lsp-completer-theme-material .jp-Completer-item.jp-mod-active svg path {
1010
fill: white;
1111
}
12-
13-
body[data-lsp-completer-layout='detail-below'] .jp-Completer-item {
14-
--lsp-completer-label-height: 24px;
15-
--lsp-completer-detail-height: 20px;
16-
--lsp-completer-icon-width: 16px;
17-
height: var(--lsp-completer-label-height);
18-
display: grid;
19-
grid-template-areas:
20-
'icon label'
21-
'detail detail';
22-
grid-template-columns: min-content 1fr;
23-
}
24-
25-
body[data-lsp-completer-layout='detail-below']
26-
.jp-Completer-item.jp-mod-active {
27-
height: calc(
28-
var(--lsp-completer-detail-height) + var(--lsp-completer-label-height)
29-
);
30-
}
31-
32-
body[data-lsp-completer-layout='detail-below'] .jp-Completer-icon {
33-
grid-area: icon;
34-
width: var(--lsp-completer-icon-width);
35-
}
36-
37-
body[data-lsp-completer-layout='detail-below'] .jp-Completer-match {
38-
grid-area: label;
39-
overflow: hidden;
40-
height: var(--lsp-completer-label-height);
41-
}
42-
43-
body[data-lsp-completer-layout='detail-below'] .jp-Completer-typeExtended {
44-
grid-area: detail;
45-
text-align: left;
46-
padding-left: calc(var(--lsp-completer-icon-width) + 8px);
47-
height: var(--lsp-completer-detail-height);
48-
line-height: var(--lsp-completer-detail-height);
49-
display: none;
50-
position: relative;
51-
top: -2px;
52-
overflow: hidden;
53-
max-width: 500px;
54-
}
55-
56-
body[data-lsp-completer-layout='detail-below']
57-
.jp-Completer-item.jp-mod-active
58-
.jp-Completer-typeExtended {
59-
display: block;
60-
}

0 commit comments

Comments
 (0)