Skip to content

Commit bb8b7f6

Browse files
Rework api docs
1 parent 0f1a7c6 commit bb8b7f6

File tree

9 files changed

+349
-367
lines changed

9 files changed

+349
-367
lines changed

doc-tool/bootstrap-theme/theme.scss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,14 @@
77
@import url('https://fonts.googleapis.com/css?family=Roboto+Slab:300|Source+Code+Pro:400,600|Source+Sans+Pro:400,600|Lobster&display=swap');
88

99
// Custom values that override the default variables of Bootstrap
10-
$colors: (
11-
"red": #ca445e,
12-
"orange": #f26527
13-
);
1410
$theme-colors: (
1511
"primary": #002b36, // primary toolbar+sidebar dark color
1612
"secondary": #ca445e, // secondary color used on light backgrounds
13+
"secondary-lite": #ca44c822, // less opaque version of secondary
1714
"accent": #ca445e, // secondary-like for dark backgrounds
1815
"contrast": #f26527, // used on dark backgrounds
1916
);
2017
$container-max-widths: (
21-
sm: 540px,
2218
md: 720px,
2319
lg: 960px,
2420
xl: 960px

doc-tool/resources/_layouts/api-page.html

Lines changed: 207 additions & 160 deletions
Large diffs are not rendered by default.

doc-tool/resources/css/api-page.css

Lines changed: 0 additions & 185 deletions
This file was deleted.

doc-tool/resources/css/bootstrap.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc-tool/resources/css/dottydoc.css

Lines changed: 116 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,25 @@ main.container {
1414
height: auto;
1515
}
1616

17-
/* byline */
18-
.byline {
17+
/* headers */
18+
main header {
19+
border-bottom: 1px solid rgba(0,0,0,.1);
20+
margin-bottom: 16px;
21+
padding-bottom: 16px;
22+
}
23+
24+
main > h1 {
25+
margin-bottom: 20px;
26+
}
27+
28+
.byline, .byline a {
1929
color: grey;
2030
}
2131
.byline .author {
2232
display: block;
2333
}
24-
h1:not(.above-byline) {
25-
margin-bottom: 20px;
26-
}
27-
h1 + .byline {
28-
margin-bottom: 20px;
29-
}
3034

35+
/* indexes */
3136
ul.post-list {
3237
list-style: none;
3338
padding-left: 0;
@@ -67,8 +72,9 @@ h4:hover a.anchor:hover,
6772
h5:hover a.anchor:hover {
6873
color: var(--secondary);
6974
}
70-
/* --- */
7175

76+
77+
/* footer */
7278
footer {
7379
color: grey;
7480
}
@@ -80,10 +86,94 @@ footer img#author-img {
8086
border-radius: 50%;
8187
}
8288

83-
.darken {
84-
background-color: rgba(0, 0, 0, 0.2);
89+
/* api docs */
90+
.api span.letter-anchor {
91+
float: left;
92+
width: 50px;
93+
height: 50px;
94+
border-radius: 50px;
95+
color: white;
96+
margin-top: 6px;
97+
margin-right: 8px;
98+
line-height: 50px;
99+
text-align: center;
100+
text-decoration: none;
101+
font-size: 42px;
102+
font-family: var(--font-family-sans-serif);
103+
}
104+
105+
.letter-anchor.object {
106+
background: #2c6c8d;
107+
}
108+
.letter-anchor.class {
109+
background: #44ad7d;
110+
}
111+
.letter-anchor.trait {
112+
background: #19aacf;
113+
}
114+
.letter-anchor.enum {
115+
background: #7803fc;
116+
}
117+
.letter-anchor.package {
118+
background: #2c6c8d;
119+
}
120+
121+
.api header {
122+
font-family: var(--font-family-sans-serif);
123+
}
124+
.api header .name-prefix {
125+
display: block;
126+
}
127+
.api header .name-suffix {
128+
display: inline-block;
129+
}
130+
131+
.api header h1 {
132+
margin: -13px 8px 0 0;
133+
display: inline-block;
134+
}
135+
.api h2 {
136+
margin-top: 1rem;
137+
}
138+
.api h3 {
139+
display: inline;
140+
margin: 0;
141+
font: inherit;
142+
font-weight: bold;
143+
}
144+
145+
/* improved display and wrapping of parameters */
146+
.api .params, .api .type-params {
147+
display: inline-flex;
148+
flex-flow: wrap;
149+
}
150+
151+
/* api layout */
152+
.wide-table {
153+
display: table;
154+
width: 100%;
155+
}
156+
.api .member:hover {
157+
background: var(--secondary-lite);
158+
cursor: pointer;
159+
}
160+
.api .left-column {
161+
white-space: nowrap;
162+
padding-left: 1em;
163+
border-left: 3px solid transparent;/* table rows cannot have borders*/
164+
font-family: var(--font-family-monospace);
165+
width: 0;
166+
}
167+
.api .member:hover .left-column {
168+
border-left: 3px solid var(--secondary);
169+
}
170+
.api .right-column {
171+
display: inline;
172+
text-align: right;
173+
font-family: var(--font-family-monospace);
85174
}
86175

176+
/* code */
87177
pre {
88178
padding: 0;
89179
font-size: 13px;
@@ -100,6 +190,7 @@ pre > code.hljs {
100190
background: transparent;
101191
}
102192

193+
/* admonitions */
103194
blockquote {
104195
padding: 0 1em;
105196
color: #777;
@@ -126,6 +217,7 @@ aside.success {
126217
background-color: #ebfddd;
127218
}
128219

220+
/* gitter chat */
129221
.gitter-open-chat-button {
130222
background-color: grey;
131223
}
@@ -140,6 +232,7 @@ aside.success {
140232
bottom: -10px;
141233
}
142234

235+
/* media queries for bigger screens (dottydoc is mobile-first) */
143236
@media (min-width: 576px) {
144237
.byline .author {
145238
display: inline;
@@ -149,3 +242,15 @@ aside.success {
149242
padding: 15px 30px;
150243
}
151244
}
245+
@media (min-width: 768px) {
246+
.api .member {
247+
display: table-row;
248+
}
249+
.api .left-column {
250+
display: table-cell;
251+
}
252+
.api .right-column {
253+
display: flex;
254+
flex-flow: wrap;
255+
}
256+
}

doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ case class Site(
145145
"css/toolbar.css" -> "/css/toolbar.css",
146146
"css/search.css" -> "/css/search.css",
147147
"css/sidebar.css" -> "/css/sidebar.css",
148-
"css/api-page.css" -> "/css/api-page.css",
149148
"css/dottydoc.css" -> "/css/dottydoc.css",
150149
"css/color-brewer.css" -> "/css/color-brewer.css",
151150
"css/bootstrap.min.css" -> "/css/bootstrap.min.css",

0 commit comments

Comments
 (0)