Skip to content

Commit 61d8bac

Browse files
committed
basic content layout
1 parent c2b4d45 commit 61d8bac

File tree

5 files changed

+41
-18
lines changed

5 files changed

+41
-18
lines changed

scaladoc/resources/dotty_res/styles/scalastyle.css

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ input {
5454
flex-direction: column;
5555
align-items: center;
5656
}
57-
#content {
57+
/* #content {
5858
max-width: 1100px;
5959
width: 100%;
60-
}
60+
} */
6161

6262
/* Text */
6363
h1,
@@ -801,11 +801,11 @@ footer .mode {
801801
position: relative;
802802
}
803803

804-
.cover-header {
804+
/* .cover-header {
805805
display: flex;
806806
flex-direction: row;
807807
padding-top: 1em;
808-
}
808+
} */
809809

810810
.micon {
811811
box-sizing: content-box;
@@ -930,6 +930,7 @@ footer .socials {
930930
}
931931

932932
#toc {
933+
display: inline;
933934
position: fixed;
934935
right: 0px;
935936
top: 0px;
@@ -1095,7 +1096,7 @@ footer .socials {
10951096

10961097
/* Breadcrumbs */
10971098

1098-
.breadcrumbs a {
1099+
/* .breadcrumbs a {
10991100
margin: 0 8px;
11001101
}
11011102
@@ -1105,7 +1106,7 @@ footer .socials {
11051106
11061107
.breadcrumbs {
11071108
align-self: flex-start;
1108-
}
1109+
} */
11091110

11101111
/* Header from docs.scala-lang */
11111112

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#content {
2+
height: 100%;
3+
width: calc(100% - calc(39 * var(--base-spacing)));
4+
float: right;
5+
overflow: scroll;
6+
margin-top: var(--header-height);
7+
display: flex;
8+
}
9+
10+
#content-wrapper {
11+
12+
}
13+
14+
#content h1 {
15+
color: var(--text-primary);
16+
}
17+
18+
.breadcrumbs {
19+
position: absolute;
20+
}

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ class HtmlRenderer(rootPackage: Member, members: Map[DRI, Member])(using ctx: Do
208208
)
209209
}
210210

211-
div(id := "container")(
211+
div(id := "")(
212212
div(id := "header", cls := "body-small")(
213213
div(cls := "header-container-left")(
214214
projectLogoElem.toSeq,
@@ -322,16 +322,17 @@ class HtmlRenderer(rootPackage: Member, members: Map[DRI, Member])(using ctx: Do
322322
"© 2002-2021 · LAMP/EPFL"
323323
)
324324
),
325+
div(id := "scaladoc-searchBar"),
325326
div(id := "main")(
326-
div (id := "leftToggler")(
327-
span(cls := "icon-toggler")
327+
parentsHtml,
328+
div(id := "content")(
329+
content.content,
330+
renderTableOfContents(content.toc).fold(Nil) { toc =>
331+
div(id := "toc")(
332+
span(cls := "toc-title")("In this article"),
333+
toc
334+
)
335+
}
328336
),
329-
div(id := "scaladoc-searchBar"),
330337
),
331-
renderTableOfContents(content.toc).fold(Nil) { toc =>
332-
div(id := "toc")(
333-
span(cls := "toc-title")("In this article"),
334-
toc
335-
)
336-
}
337338
)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class MemberRenderer(signatureRenderer: SignatureRenderer)(using DocContext) ext
3030

3131
def inheritedFrom(m: Member) = m.inheritedFrom match
3232
case Some(InheritedFrom(name, dri, isSourceSuperclassHidden)) =>
33-
val hiddenNameSuffix = if isSourceSuperclassHidden then " (hidden)" else ""
33+
val hiddenNameSuffix = if isSourceSuperclassHidden then " (hidden)" else ""
3434
tableRow("Inherited from:", signatureRenderer.renderLink(name + hiddenNameSuffix, dri))
3535
case _ => Nil
3636

@@ -396,7 +396,7 @@ class MemberRenderer(signatureRenderer: SignatureRenderer)(using DocContext) ext
396396
Seq(
397397
div(cls := "cover-header")(
398398
memberIcon(m),
399-
h1(m.name)
399+
h1(cls := "h600")(m.name)
400400
),
401401
div(cls := "signature monospace")(
402402
annotations(m),

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ trait Resources(using ctx: DocContext) extends Locations, Writer:
111111
"styles/theme/layout/floatingButton.css",
112112
"styles/theme/layout/mobileMenu.css",
113113
"styles/theme/layout/footer.css",
114+
"styles/theme/layout/content.css",
114115

115116
// components
116117
"styles/theme/components/switcher.css",

0 commit comments

Comments
 (0)