Skip to content

Commit fc4241e

Browse files
committed
Merge branch 'scaladoc-fixes' into dynamic-loading-fixes
2 parents aa4ad38 + 2c4bfee commit fc4241e

File tree

10 files changed

+256
-118
lines changed

10 files changed

+256
-118
lines changed

scaladoc/resources/dotty_res/scripts/ux.js

Lines changed: 192 additions & 86 deletions
Large diffs are not rendered by default.

scaladoc/resources/dotty_res/styles/theme/components/api-member.css

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
.documentableElement {
2-
background-color: var(--action-primary-background-default-solid);
3-
padding: calc(3 * var(--base-spacing));
4-
border-radius: 4px;
5-
margin-bottom: calc(3 * var(--base-spacing));
2+
padding: 13px 0 12px;
63
color: var(--text-primary);
74
position: relative;
5+
border-top: 1px solid var(--border-default);
86
}
97

108
.documentableElement:last-child {
119
margin-bottom: 0;
10+
border-top: 1px solid var(--border-default);
1211
}
1312

1413
.documentableElement .signature {
@@ -24,6 +23,10 @@
2423
color: var(--text-secondary);
2524
}
2625

26+
.documentableElement .documentableBrief > p {
27+
margin: 4px 0 0;
28+
}
29+
2730
.documentableElement .annotations {
2831
display: none;
2932
}
@@ -32,8 +35,17 @@
3235
display: none;
3336
}
3437

38+
.documentableElement.expand {
39+
color: var(--text-secondary);
40+
}
41+
3542
.documentableElement.expand > div .cover {
3643
display: block;
44+
45+
}
46+
47+
.documentableElement.expand > div .cover dd {
48+
color: var(--text-primary);
3749
}
3850

3951
.documentableElement.expand .annotations {
@@ -46,7 +58,6 @@
4658

4759
.documentableElement .icon-button {
4860
position: absolute;
49-
top: calc(3 * var(--base-spacing));
5061
right: calc(3 * var(--base-spacing));
5162
display: none;
5263
}
@@ -55,6 +66,10 @@
5566
display: block;
5667
}
5768

69+
.documentableElement .attributes {
70+
margin-bottom: 0;
71+
}
72+
5873
[t="k"] {
5974
color: var(--code-method-highlighting-keyword);
6075
}

scaladoc/resources/dotty_res/styles/theme/components/attributes.css

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
overflow: hidden;
44
padding: 0;
55
margin: 0;
6-
border-bottom: 1px solid var(--border-default);
76
margin-bottom: calc(6 * var(--base-spacing));
87
}
98

@@ -18,11 +17,8 @@
1817
.attributes > dt {
1918
float: left;
2019
width: 20%;
21-
padding: 0;
22-
margin: 0;
20+
padding: 20px 0;
2321
border-top: 1px solid var(--border-default);
24-
padding-top: calc(2.5 * var(--base-spacing));
25-
padding-bottom: calc(2.5 * var(--base-spacing));
2622
text-align: right;
2723
color: var(--text-secondary);
2824
}
@@ -37,6 +33,11 @@
3733
padding-bottom: calc(2.5 * var(--base-spacing));
3834
}
3935

36+
.attributes > dt:first-child,
37+
.attributes > dd:first-of-type {
38+
border-top: none;
39+
}
40+
4041
.attributes > dd > .attributes > dt {
4142
border: none;
4243
padding: 0;
@@ -51,6 +52,4 @@
5152
width: 80%;
5253
}
5354

54-
.documentableElement .attributes {
55-
margin-bottom: 0;
56-
}
55+

scaladoc/resources/dotty_res/styles/theme/components/code-snippet.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515

1616
.snippet pre {
1717
margin: 0;
18+
line-height: 20px;
19+
}
20+
21+
dd .snippet {
22+
margin: 0;
1823
}
1924

2025
.snippet .hidden {

scaladoc/resources/dotty_res/styles/theme/components/pill.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
.pill .filter-name {
4444
color: var(--text-secondary);
4545
margin-right: calc(0.5 * var(--base-spacing));
46-
padding-bottom: 1px;
46+
padding-bottom: 2px;
4747
}
4848

4949
.pill > .close {

scaladoc/resources/dotty_res/styles/theme/components/table-of-content.css

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#toc-container {
99
width: 232px;
10+
position: sticky;
11+
top: calc(18 * var(--base-spacing))
1012
}
1113

1214
#toc ul {
@@ -37,10 +39,6 @@
3739
@media (max-width: 1467px) {
3840
#toc {
3941
margin-left: calc(8.5 * var(--base-spacing));
40-
margin-right: calc(8.5 * var(--base-spacing));
41-
}
42-
#toc-container {
43-
margin-right: calc(8.5 * var(--base-spacing));
4442
}
4543
}
4644

scaladoc/resources/dotty_res/styles/theme/layout/arrowNavigation.css

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
}
66

77
.arrow-navigation > div {
8-
width: 50%;
9-
}
10-
11-
.arrow-navigation > div:first-child {
8+
width: 100%;
129
padding-right: 12px;
1310
}
1411

15-
.arrow-navigation > div:last-child {
12+
.arrow-navigation > div:has(.arrow-navigation--next) {
1613
text-align: right;
14+
padding-right: 0;
1715
padding-left: 12px;
1816
}
1917

scaladoc/resources/dotty_res/styles/theme/layout/content.css

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@
2929

3030
@media (min-width: 1920px) {
3131
#content {
32-
width: calc(90 * var(--base-spacing));
3332
padding-left: calc(36.75 * var(--base-spacing));
3433
padding-top: calc(18 * var(--base-spacing));
3534
}
35+
36+
#content > div:first-child {
37+
width: calc(90 * var(--base-spacing));
38+
}
3639
}
3740

3841
@media (max-width: 1920px) {
@@ -172,6 +175,10 @@
172175
color: var(--text-primary);
173176
}
174177

178+
#content li > ul {
179+
padding-left: 32px;
180+
}
181+
175182
/* content table */
176183
#content table {
177184
color: var(--text-primary);
@@ -415,6 +422,11 @@
415422
margin-bottom: 0;
416423
}
417424

425+
#attributes > h2 {
426+
margin-bottom: calc(3*var(--base-spacing));
427+
}
428+
429+
418430
.tab {
419431
position: relative;
420432
}
@@ -462,6 +474,8 @@
462474
display: block;
463475
}
464476

477+
478+
465479
#content section {
466480
margin-top: calc(6 * var(--base-spacing));
467481
}

scaladoc/resources/dotty_res/styles/theme/typography.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
* {
22
text-rendering: geometricPrecision;
3+
font-weight: initial;
34
}
45

56
@font-face {

scaladoc/src/dotty/tools/scaladoc/renderers/MemberRenderer.scala

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class MemberRenderer(signatureRenderer: SignatureRenderer)(using DocContext) ext
156156

157157
val signature: MemberSignature = signatureProvider.rawSignature(member)()
158158
Seq(
159-
div(cls := "signature mono-small-inline")(
159+
div(cls := "signature mono-medium")(
160160
span(cls := "modifiers")(signature.prefix.map(renderElement(_))),
161161
span(cls := "kind")(signature.kind.map(renderElement(_))),
162162
signature.name.map(renderElement(_, nameClasses*)),
@@ -404,7 +404,7 @@ class MemberRenderer(signatureRenderer: SignatureRenderer)(using DocContext) ext
404404

405405
def signatureList(list: Seq[LinkToType], className: String = "", expandable: Boolean): Seq[AppliedTag] =
406406
if list.isEmpty then Nil
407-
else Seq(div(cls := s"mono-small-inline $className")(
407+
else Seq(div(cls := s"mono-medium $className")(
408408
if(expandable) then span(cls := "icon-button show-content") else span(),
409409
list.map(link =>
410410
div(link.kind.name," ", link.signature.map(renderElement(_)))
@@ -469,7 +469,7 @@ class MemberRenderer(signatureRenderer: SignatureRenderer)(using DocContext) ext
469469
)
470470
) ++ companionBadge(m) ++
471471
Seq(
472-
div(cls := "main-signature mono-medium")(
472+
div(cls := "main-signature mono-small-block")(
473473
annotations(m).getOrElse(Nil),
474474
memberSignature(m)
475475
)
@@ -478,11 +478,13 @@ class MemberRenderer(signatureRenderer: SignatureRenderer)(using DocContext) ext
478478
val memberContent = div(
479479
intro,
480480
memberInfo(m, withAttributes = true),
481-
section(id := "members-list")(
482-
h2(cls := "h500")("Members list"),
483-
buildDocumentableFilter,
484-
buildMembers(m)
485-
)
481+
if m.members.length > 0 then
482+
Seq(section(id := "members-list")(
483+
h2(cls := "h500")("Members list"),
484+
buildDocumentableFilter,
485+
buildMembers(m)
486+
))
487+
else Nil
486488
)
487489

488490
val memberDocument = Jsoup.parse(memberContent.toString)

0 commit comments

Comments
 (0)