Skip to content

Commit f2d858b

Browse files
author
Filip Łukasik
committed
handle arrow pseudoclasses
1 parent eb2fa66 commit f2d858b

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed
Lines changed: 1 addition & 1 deletion
Loading

scaladoc/resources/dotty_res/scripts/ux.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ window.addEventListener("DOMContentLoaded", () => {
2323
e.stopPropagation()
2424
});
2525

26-
document.querySelectorAll(".nh").forEach(el => el.addEventListener('click', () => el.lastChild.click()))
26+
document.querySelectorAll(".nh").forEach(el => el.addEventListener('click', () => {
27+
el.lastChild.click()
28+
el.first.addClass("expanded")
29+
el.parent.addClass("expanded")
30+
}))
2731

2832
$('.names .tab').on('click', function () {
2933
parent = $(this).parents(".tabs").first()

scaladoc/resources/dotty_res/styles/theme/components/navigation-item.css

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
padding-bottom: calc(1.25 * var(--base-spacing));
2121
padding-right: calc(1.25 * var(--base-spacing));
2222
overflow: hidden;
23+
position: relative;
2324
}
2425

2526
.nh > a {
@@ -99,7 +100,7 @@
99100
}
100101

101102
.nh.selected > a {
102-
color: var(--action-primary-content-selected);
103+
color: var(--action-primary-content-selected) !important;
103104
}
104105

105106
.nh.cs > a {
@@ -112,11 +113,15 @@
112113
color: transparent;
113114
}
114115

115-
span.ar {
116+
button.ar {
116117
cursor: pointer;
117118
position: absolute;
118119
}
119120

121+
button.ar:active ~ a:not(.nh:active) {
122+
color: var(--action-primary-content-default);
123+
}
124+
120125
.nh a {
121126
position: relative;
122127
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class HtmlRenderer(rootPackage: Member, members: Map[DRI, Member])(using ctx: Do
123123
}
124124
Seq(
125125
span(cls := s"nh " + attrs.mkString(" "))(
126-
if withArrow then Seq(span(cls := "ar icon-button")) else Nil,
126+
if withArrow then Seq(button(cls := s"ar icon-button ${if isSelected || expanded then "expanded" else ""}")) else Nil,
127127
a(href := pathToPage(pageLink.dri, nav.link.dri))(icon, span(nav.link.name))
128128
)
129129
)

0 commit comments

Comments
 (0)