Skip to content

Commit 021bfda

Browse files
author
Filip Łukasik
committed
refactor version dropdown and text button component
1 parent c9b461d commit 021bfda

File tree

3 files changed

+27
-36
lines changed

3 files changed

+27
-36
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@
22
display: flex;
33
}
44

5-
.text-button a {
5+
.text-button {
66
color: var(--action-primary-content-default);
77
text-decoration: none;
88
cursor: pointer;
99
}
1010

11-
.text-button:hover a {
11+
.text-button:hover {
1212
color: var(--action-primary-content-hover);
1313
}
1414

15-
.text-button:active a {
15+
.text-button:active {
1616
color: var(--action-primary-content-active);
1717
}
1818

19-
.text-button.selected a {
19+
.text-button.selected {
2020
color: var(--action-primary-content-selected);
2121
}
2222

23-
.text-button:focus-visible a {
23+
.text-button:focus-visible {
2424
box-shadow: 0px 0px 0px 2px var(--focus-default);
2525
}
2626

27-
.text-button:disabled a {
27+
.text-button:disabled {
2828
opacity: 0.5;
2929
}
3030

scaladoc/resources/dotty_res/styles/theme/components/dropdown-menu.css

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,18 @@
1010
position: absolute;
1111
padding: calc(3 * var(--base-spacing));
1212
z-index: 2;
13-
top: calc(6 * var(--base-spacing));
1413
}
1514

16-
/* .dropdown-menu > *:not(:last-child) {
15+
.dropdown-menu > *:not(:last-child) {
1716
margin-bottom: calc(2 * var(--base-spacing));
18-
} */
17+
}
1918

2019
.dropdown-menu.expanded {
2120
display: flex;
2221
}
22+
23+
/* version dropdown */
24+
#version-dropdown {
25+
top: calc(6 * var(--base-spacing));
26+
left: calc(34.25 * var(--base-spacing));
27+
}

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

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -220,43 +220,29 @@ class HtmlRenderer(rootPackage: Member, members: Map[DRI, Member])(using ctx: Do
220220
a()(
221221
args.projectVersion.map(v => div(cls:="projectVersion")(v)).getOrElse("")
222222
),
223-
div(id := "version-dropdown", cls := "dropdown-menu") (
224-
span(cls := "text-button")()
225-
)
226223
),
224+
div(id := "version-dropdown", cls := "dropdown-menu") ()
227225
),
228226
div(cls:="header-container-right")(
229227
button(id := "search-toggle", cls := "icon-button"),
230-
span(cls := "text-button")(
231-
a(href := "https://www.scala-lang.org/download/") (
228+
a(href := "https://www.scala-lang.org/download/", cls := "text-button") (
232229
"Download",
233-
)
234-
),
235-
span(cls := "text-button")(
236-
a(href := "https://docs.scala-lang.org/") (
230+
),
231+
a(href := "https://docs.scala-lang.org/", cls := "text-button") (
237232
"Documentation",
238-
)
239-
),
240-
span(cls := "text-button")(
241-
a(href := "https://index.scala-lang.org") (
233+
),
234+
a(href := "https://index.scala-lang.org", cls := "text-button") (
242235
"Libraries",
243-
)
244-
),
245-
span(cls := "text-button")(
246-
a(href := "https://www.scala-lang.org/contribute/") (
236+
),
237+
a(href := "https://www.scala-lang.org/contribute/", cls := "text-button") (
247238
"Contribute",
248-
)
249-
),
250-
span(cls := "text-button")(
251-
a(href := "https://www.scala-lang.org/contribute/") (
239+
),
240+
a(href := "https://www.scala-lang.org/contribute/", cls := "text-button") (
252241
"Blog",
253-
)
254-
),
255-
span(cls := "text-button")(
256-
a(href := "https://www.scala-lang.org/blog/") (
242+
),
243+
a(href := "https://www.scala-lang.org/blog/", cls := "text-button") (
257244
"Community",
258-
)
259-
),
245+
),
260246
button(id := "theme-toggle", cls := "icon-button"),
261247
),
262248

0 commit comments

Comments
 (0)