Skip to content

Commit 2c4bfee

Browse files
Merge pull request #26 from szymon-rd/member-design
Member design
2 parents 1df646f + 8c28994 commit 2c4bfee

File tree

5 files changed

+44
-13
lines changed

5 files changed

+44
-13
lines changed

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: 6 additions & 4 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

@@ -34,6 +33,11 @@
3433
padding-bottom: calc(2.5 * var(--base-spacing));
3534
}
3635

36+
.attributes > dt:first-child,
37+
.attributes > dd:first-of-type {
38+
border-top: none;
39+
}
40+
3741
.attributes > dd > .attributes > dt {
3842
border: none;
3943
padding: 0;
@@ -48,6 +52,4 @@
4852
width: 80%;
4953
}
5054

51-
.documentableElement .attributes {
52-
margin-bottom: 0;
53-
}
55+

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
line-height: 20px;
1919
}
2020

21+
dd .snippet {
22+
margin: 0;
23+
}
24+
2125
.snippet .hidden {
2226
display: none;
2327
}

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

Lines changed: 11 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) {
@@ -419,6 +422,11 @@
419422
margin-bottom: 0;
420423
}
421424

425+
#attributes > h2 {
426+
margin-bottom: calc(3*var(--base-spacing));
427+
}
428+
429+
422430
.tab {
423431
position: relative;
424432
}
@@ -466,6 +474,8 @@
466474
display: block;
467475
}
468476

477+
478+
469479
#content section {
470480
margin-top: calc(6 * var(--base-spacing));
471481
}

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

Lines changed: 3 additions & 3 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
)

0 commit comments

Comments
 (0)