Skip to content

Commit dc1a242

Browse files
authored
Merge pull request #28 from pikinier20/scaladoc/review-fixes
Review fixes
2 parents d77d29b + 63ca286 commit dc1a242

File tree

20 files changed

+175
-75
lines changed

20 files changed

+175
-75
lines changed

docs/_layouts/static-site-main.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
page.
1313
</aside>
1414
{% endif %} {{ content }}
15+
<div class="divider" />
1516
<nav class="arrow-navigation" aria-label="Page navigation">
1617
{% if page.previous %}
1718
<div>
@@ -42,5 +43,12 @@
4243
<div class="content-contributors hidden">
4344
<h1 class="h200">Contributors to this page</h1>
4445
<div id="documentation-contributors" class="contributors-container"></div>
46+
{% if urls.editSource %}
47+
<div class="github-edit-button">
48+
<a class="text-button with-link body-small" href="{{ urls.editSource }}">
49+
Edit this page on GitHub
50+
</a>
51+
</div>
52+
{% endif %}
4553
</div>
4654
</div>
Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,51 @@
11
.content-contributors.hidden {
22
display: none;
33
}
4+
5+
.content-contributors .contributors-container div a {
6+
vertical-align: middle;
7+
padding: 3px;
8+
text-decoration: none;
9+
}
10+
11+
.content-contributors {
12+
background-color: var(--background-neutral);
13+
padding: calc(3 * var(--base-spacing));
14+
border-radius: 4px;
15+
}
16+
417
.content-contributors .contributors-container {
518
display: flex;
619
flex-wrap: wrap;
720
align-items: center;
821
padding-bottom: 25px;
22+
row-gap: calc(3 * var(--base-spacing));
23+
column-gap: calc(4 * var(--base-spacing));
924
}
10-
.content-contributors .contributors-container div {
11-
margin: 5px;
12-
}
13-
.content-contributors .contributors-container div a {
14-
vertical-align: middle;
15-
padding: 3px;
16-
text-decoration: none;
25+
26+
.content-contributors h1 {
27+
color: var(--text-primary);
28+
padding-bottom: calc(3 * var(--base-spacing));
1729
}
30+
1831
.content-contributors .contributors-container div img {
1932
vertical-align: middle;
2033
width: 35px;
2134
height: 35px;
2235
margin-bottom: 0;
23-
border-radius: 7px;
36+
border-radius: 50%;
37+
margin-right: calc(1.5 * var(--base-spacing));
38+
}
39+
40+
#content .content-contributors .contributors-container div a {
41+
text-decoration: none;
42+
border-bottom: none;
43+
}
44+
45+
.content-contributors .contributors-container {
46+
padding: 0;
47+
}
48+
49+
.content-contributors .github-edit-button {
50+
padding-top: calc(2 * var(--base-spacing));
2451
}

scaladoc-testcases/docs/_layouts/static-site-main.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,12 @@
3434
<div class="content-contributors hidden">
3535
<h1 class="h200">Contributors to this page</h1>
3636
<div id="documentation-contributors" class="contributors-container"></div>
37+
{% if urls.editSource %}
38+
<div class="github-edit-button">
39+
<a class="text-button with-link body-small" href="{{ urls.editSource }}">
40+
Edit this page on GitHub
41+
</a>
42+
</div>
43+
{% endif %}
3744
</div>
3845
</div>

scaladoc/resources/dotty_res/scripts/components/DocumentableList.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @typedef { [key: string, value: string][] } Dataset
55
*/
66

7-
class DocumentableList extends Component {
7+
class DocumentableList extends Component {
88
constructor(props) {
99
super(props);
1010

@@ -140,7 +140,7 @@ class List {
140140

141141
function includesInputValue() {
142142
const lcValue = filter.value.toLowerCase()
143-
return elementData.name.toLowerCase().includes(lcValue)
143+
return elementData.name.toLowerCase().includes(lcValue)
144144
|| elementData.description.toLowerCase().includes(lcValue);
145145
}
146146

@@ -177,7 +177,9 @@ class List {
177177
.every(([filterKey, value]) => {
178178
const filterGroup = filter.filters[filterKey]
179179

180-
return value.split(",").some(v => filterGroup && filterGroup[v].selected)
180+
console.log(Object.entries(filterGroup).filter(arr => arr[1].selected))
181+
182+
return Object.entries(filterGroup).filter(arr => arr[1].selected).length == 0 || value.split(",").some(v => (filterGroup && filterGroup[v].selected))
181183
})
182184

183185
return isVisible

scaladoc/resources/dotty_res/scripts/components/Filter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @typedef { Record<FilterAttributes, FilterMap> } Filters
55
*/
66

7-
class Filter {
7+
class Filter {
88
/**
99
* @param value { string }
1010
* @param filters { Filters }
@@ -217,8 +217,8 @@ class Filter {
217217
}
218218

219219
class FilterItem {
220-
constructor(selected = true, visible = true) {
220+
constructor(selected = false, visible = true) {
221221
this.selected = selected
222222
this.visible = visible
223223
}
224-
}
224+
}

scaladoc/resources/dotty_res/scripts/ux.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ window.addEventListener("DOMContentLoaded", () => {
3030
}
3131
}
3232

33-
var memberLists = document.getElementsByClassName("membersList")
33+
var memberLists = document.getElementsByClassName("tab")
3434
if (memberLists) {
3535
for (i = 0; i < memberLists.length; i++) {
3636
memberLists[i].children[0].onclick = function(e) {
@@ -139,14 +139,17 @@ window.addEventListener("DOMContentLoaded", () => {
139139
}
140140
})
141141

142-
// show/hide side menu on mobile view
143-
const sideMenuToggler = document.getElementById("mobile-sidebar-toggle");
144-
sideMenuToggler.addEventListener('click', _e => {
145-
document.getElementById("leftColumn").classList.toggle("show")
146-
document.getElementById("content").classList.toggle("sidebar-shown")
147-
document.getElementById("toc").classList.toggle("sidebar-shown")
148-
sideMenuToggler.classList.toggle("menu-shown")
149-
})
142+
// show/hide side menu on mobile view
143+
const sideMenuToggler = document.getElementById("mobile-sidebar-toggle");
144+
sideMenuToggler.addEventListener('click', _e => {
145+
document.getElementById("leftColumn").classList.toggle("show")
146+
document.getElementById("content").classList.toggle("sidebar-shown")
147+
const toc = document.getElementById("toc");
148+
if(toc) {
149+
toc.classList.toggle("sidebar-shown")
150+
}
151+
sideMenuToggler.classList.toggle("menu-shown")
152+
})
150153

151154
// show/hide mobile menu on mobile view
152155
const mobileMenuOpenIcon = document.getElementById("mobile-menu-toggle");

scaladoc/resources/dotty_res/styles/theme/color-tokens.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
--code-syntax-highlighting-deletion: var(--crimson11);
6565
--code-syntax-highlighting-variable: var(--purple9);
6666

67+
--code-syntax-highlighting-scrollbar: var(--grey8);
68+
--code-syntax-highlighting-scrollbar-hover: var(--grey9);
69+
6770
--code-method-highlighting-type: var(--purple9);
6871
--code-method-highlighting-type-link: var(--sky11);
6972
--code-method-highlighting-code-fg: var(--grey12);
@@ -142,6 +145,9 @@
142145
--code-syntax-highlighting-deletion: var(--crimson11);
143146
--code-syntax-highlighting-variable: var(--purple9);
144147

148+
--code-syntax-highlighting-scrollbar: var(--grey8);
149+
--code-syntax-highlighting-scrollbar-hover: var(--grey9);
150+
145151
--code-method-highlighting-type: var(--purple9);
146152
--code-method-highlighting-type-link: var(--sky11);
147153
--code-method-highlighting-code-fg: var(--grey12);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
--grey9: #706f78;
177177
--grey10: #7e7d86;
178178
--grey11: #a09fa6;
179-
--grey12: #cccccc;
179+
--grey12: #ededef;
180180

181181
/* red colors */
182182
--red1: #1f1315;

scaladoc/resources/dotty_res/styles/theme/components/button/text-button.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ a:active {
8484
text-decoration: none;
8585
margin-bottom: calc(1 * var(--base-spacing));
8686
display: inline-block;
87+
border-bottom: none;
8788
}
8889

8990
.text-button.with-link::after {

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
border: 1px solid transparent;
99
color: var(--text-primary);
1010
overflow-x: scroll;
11+
margin-bottom: calc(3 * var(--base-spacing));
12+
margin-top: calc(3 * var(--base-spacing));
1113
}
1214

1315
.snippet pre {
@@ -165,3 +167,27 @@
165167
.hljs-variable {
166168
color: var(--code-syntax-highlighting-variable);
167169
}
170+
171+
/* Scrollbar */
172+
173+
/* For Firefox */
174+
.snippet {
175+
scrollbar-color: var(--code-syntax-highlighting-scrollbar);
176+
scrollbar-width: thin;
177+
}
178+
179+
/* For Chrome */
180+
181+
.snippet::-webkit-scrollbar-thumb {
182+
background-color: var(--code-syntax-highlighting-scrollbar);
183+
border-radius: 3px;
184+
}
185+
186+
.snippet::-webkit-scrollbar-thumb:hover {
187+
background-color: var(--code-syntax-highlighting-scrollbar-hover);
188+
}
189+
190+
.snippet::-webkit-scrollbar {
191+
width: 8px;
192+
height: 8px;
193+
}

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

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

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@
5858
}
5959

6060
@media (max-width: 1024px) {
61+
#toc {
62+
margin-left: calc(6 * var(--base-spacing));
63+
margin-right: 0;
64+
}
65+
6166
#toc.sidebar-shown {
6267
display: none;
6368
}
@@ -77,6 +82,7 @@
7782
#content .toc-nav a {
7883
color: var(--action-primary-content-default);
7984
text-decoration: none;
85+
border-bottom: none;
8086
}
8187

8288
#toc li:hover > a {

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

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
overflow: hidden;
1515
}
1616

17+
#content.sidebar-shown {
18+
-webkit-transition: width 0.3s ease-in-out;
19+
-moz-transition: width 0.3s ease-in-out;
20+
-o-transition: width 0.3s ease-in-out;
21+
transition: width 0.3s ease-in-out;
22+
}
23+
1724
@media (min-width: 1920px) {
1825
#content {
1926
width: calc(90 * var(--base-spacing));
@@ -75,7 +82,7 @@
7582
}
7683

7784
#content > div:first-child {
78-
width: auto;
85+
width: calc(100% - calc(29 * var(--base-spacing)));
7986
}
8087

8188
#content.sidebar-shown {
@@ -150,6 +157,11 @@
150157
color: var(--text-primary);
151158
}
152159

160+
/* content first paragraph */
161+
#content .first-p {
162+
color: var(--text-secondary);
163+
}
164+
153165
/* content list */
154166
#content li {
155167
color: var(--text-primary);
@@ -165,13 +177,15 @@
165177
border-bottom: 1px solid var(--text-secondary);
166178
}
167179

168-
#content .cover-header a, #content .cover-header a:hover {
180+
#content .cover-header a,
181+
#content .cover-header a:hover {
169182
border-bottom: none;
170183
}
171184

172185
#content :not(pre) > code {
173186
color: var(--code-props-content);
174187
font-family: "FiraCode-Regular";
188+
background-color: var(--red3);
175189
}
176190

177191
.breadcrumbs {
@@ -356,27 +370,27 @@
356370
margin-bottom: calc(3 * var(--base-spacing));
357371
}
358372

359-
.membersList {
373+
.tab {
360374
position: relative;
361375
}
362376

363-
.membersList h2 {
377+
.tab h2 {
364378
border-bottom: 1px solid var(--border-default);
365379
padding-bottom: calc(3 * var(--base-spacing));
366380
padding-top: calc(3 * var(--base-spacing));
367381
}
368382

369-
.membersList > button {
383+
.tab > button {
370384
position: absolute;
371385
right: 0;
372386
top: calc(3.5 * var(--base-spacing));
373387
}
374388

375-
.membersList .documentableList {
389+
.tab .documentableList {
376390
display: none;
377391
}
378392

379-
.membersList.expand .documentableList {
393+
.tab.expand .documentableList {
380394
display: block;
381395
}
382396

@@ -406,3 +420,7 @@
406420
#content section {
407421
margin-top: calc(6 * var(--base-spacing));
408422
}
423+
424+
#content section:last-child {
425+
margin-bottom: calc(6 * var(--base-spacing));
426+
}

0 commit comments

Comments
 (0)