Skip to content

Commit 19b4034

Browse files
author
Filip Łukasik
committed
add missing hints style
1 parent df20c3d commit 19b4034

File tree

9 files changed

+142
-20
lines changed

9 files changed

+142
-20
lines changed

scaladoc-js/common/css/searchbar.css

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,11 @@ div[selected] > .scaladoc-searchbar-inkuire-package {
207207
outline: none;
208208
} */
209209

210-
#scaladoc-searchbar-results {
210+
/* #scaladoc-searchbar-results {
211211
display: flex;
212212
flex-direction: column;
213-
max-height: 500px;
214213
overflow: auto;
215-
}
214+
} */
216215

217216
.scaladoc-searchbar-row {
218217
display: flex;
@@ -266,7 +265,7 @@ div[selected] > .scaladoc-searchbar-inkuire-package {
266265
margin-right: 4px;
267266
}
268267

269-
.searchbar-hints {
268+
/* .searchbar-hints {
270269
padding-top: 5vh;
271270
padding-bottom: 5vh;
272271
padding-left: 5vw;
@@ -280,7 +279,7 @@ div[selected] > .scaladoc-searchbar-inkuire-package {
280279
.searchbar-hints-list {
281280
font-size: medium;
282281
line-height: 2em;
283-
}
282+
} */
284283

285284
#searchBar {
286285
display: inline-flex;

scaladoc-js/main/src/searchbar/SearchbarComponent.scala

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -310,21 +310,20 @@ class SearchbarComponent(engine: SearchbarEngine, inkuireEngine: InkuireJSSearch
310310
private def showHints() = {
311311
def clearResults() = while (resultsDiv.hasChildNodes()) resultsDiv.removeChild(resultsDiv.lastChild)
312312
val hintsDiv = div(cls := "searchbar-hints")(
313-
span(cls := "fas fa-lightbulb fa-5x"),
314-
h1("A bunch of hints to make your life easier"),
313+
span(cls := "lightbulb"),
314+
h1(cls := "body-medium")("A bunch of search hints to make your life easier"),
315315
ul(cls := "searchbar-hints-list")(
316-
li("Type a phrase to search members ", b("by name")," and static sites ", b("by title"),""),
317-
li("Type abbreviations", b("cC, caCa, camCa")," to search for ", b("camelCase")),
318-
li(
319-
"Type a function signature to search for members ", b("by signature")," using Inkuire",
320-
ul(
321-
li("Type ", b("String => Int")," to find ", b("String.size"),", ", b("String.toInt"),""),
322-
li("Type ", b("String => String => String")," to find ", b("String.mkString"),", ", b("String.stripPrefix"),""),
323-
li("Inkuire also finds field accessors. Type ", b("Some[A] => A")," to find ", b("Some.value"),""),
324-
li("For more information about Inkuire see ", a(href := "https://docs.scala-lang.org/scala3/guides/scaladoc/search-engine.html")("the documentation")),
325-
li("The availability of this function depends on configuration used to generate Scaladoc")
326-
)
327-
)
316+
h1(cls := "h100")("Members or Static sites by any phrase"),
317+
li(cls := "mono-small-inline")("Any phrase to find", b(" Name")," or ", b("Title"),""),
318+
div(cls := "divider"),
319+
li(cls := "mono-small-inline")("cC, caCa, camCa" , b(" to find")," camelCase"),
320+
h1(cls := "h100")("Members by signature"),
321+
li(cls := "mono-small-inline")("String => Int", b(" to find"), " String.size, String.toInt"),
322+
div(cls := "divider"),
323+
li(cls := "mono-small-inline")("String => String => String", b(" to find "), "String.mkString, String.stripPrefix"),
324+
div(cls := "divider"),
325+
li(cls := "mono-small-inline")("Some[A] => A", b(" to find"), " Some.value"),
326+
li(cls := "link body-small")("Availability of searching by inkuire depends on the configuration of Scaladoc. For more info, ", a(href := "https://docs.scala-lang.org/scala3/guides/scaladoc/search-engine.html")("the documentation")),
328327
)
329328
)
330329
clearResults()
Lines changed: 12 additions & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.divider {
2+
width: 100%;
3+
border-top: 1px solid var(--border-default);
4+
}

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

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
-webkit-appearance: none;
3737
height: 1em;
3838
width: 1em;
39-
border-radius: 50em;
4039
background: url("../../../images/icon-buttons/close/light/default.svg")
4140
no-repeat 50% 50%;
4241
background-size: contain;
@@ -63,3 +62,87 @@
6362
border-radius: 4px;
6463
margin-top: calc(1.5 * var(--base-spacing));
6564
}
65+
66+
.searchbar-hints {
67+
color: var(--text-primary);
68+
display: flex;
69+
flex-flow: column;
70+
align-items: center;
71+
justify-content: center;
72+
height: calc(108.5 * var(--base-spacing));
73+
}
74+
75+
.searchbar-hints h1 {
76+
margin: 0;
77+
}
78+
79+
.searchbar-hints .link {
80+
color: var(--text-secondary);
81+
margin-top: calc(4.5 * var(--base-spacing));
82+
position: relative;
83+
}
84+
85+
.searchbar-hints .link a {
86+
color: var(--text-secondary);
87+
}
88+
89+
.searchbar-hints .link::marker {
90+
color: transparent;
91+
}
92+
93+
.searchbar-hints .link::before {
94+
content: url("../../../images/info/light/default.svg");
95+
position: absolute;
96+
left: calc(-4 * var(--base-spacing));
97+
}
98+
99+
.text-dark .searchbar-hints .link::before {
100+
content: url("../../../images/info/dark/default.svg");
101+
}
102+
103+
.searchbar-hints .lightbulb {
104+
margin-bottom: calc(2 * var(--base-spacing));
105+
}
106+
107+
.searchbar-hints .lightbulb:after {
108+
content: url("../../../images/bulb/light/default.svg");
109+
}
110+
111+
.theme-dark .searchbar-hints .lightbulb:after {
112+
content: url("../../../images/bulb/dark/default.svg");
113+
}
114+
115+
.theme-dark .searchbar-hints .lightbulb:after {
116+
content: url("../../../images/bulb/dark/default.svg");
117+
}
118+
119+
.searchbar-hints-list {
120+
margin-top: calc(5.5 * var(--base-spacing));
121+
width: calc(61 * var(--base-spacing));
122+
}
123+
124+
.searchbar-hints-list li b {
125+
color: var(--text-secondary);
126+
}
127+
128+
.searchbar-hints-list li {
129+
margin-left: calc(4.6 * var(--base-spacing));
130+
}
131+
132+
.searchbar-hints-list li::marker {
133+
color: var(--text-secondary);
134+
}
135+
136+
.searchbar-hints-list .h100 {
137+
margin-bottom: calc(3 * var(--base-spacing));
138+
margin-left: calc(2 * var(--base-spacing));
139+
}
140+
141+
.searchbar-hints-list .divider {
142+
margin-bottom: calc(1.5 * var(--base-spacing));
143+
margin-top: calc(1.5 * var(--base-spacing));
144+
}
145+
146+
.searchbar-hints-list .h100:last-of-type {
147+
margin-top: calc(6 * var(--base-spacing));
148+
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ trait Resources(using ctx: DocContext) extends Locations, Writer:
115115
"styles/theme/components/button/icon-button.css",
116116
"styles/theme/components/button/text-button.css",
117117
"styles/theme/components/dropdown-menu.css",
118+
"styles/theme/components/divider.css",
118119

119120
"styles/nord-light.css",
120121
"styles/dotty-icons.css",
@@ -335,6 +336,10 @@ trait Resources(using ctx: DocContext) extends Locations, Writer:
335336
dottyRes("images/icon-buttons/arrow-right/light/default.svg"),
336337
dottyRes("images/icon-buttons/close/light/default.svg"),
337338
dottyRes("images/icon-buttons/close/dark/default.svg"),
339+
dottyRes("images/bulb/dark/default.svg"),
340+
dottyRes("images/bulb/light/default.svg"),
341+
dottyRes("images/info/light/default.svg"),
342+
dottyRes("images/info/dark/default.svg"),
338343
searchData(pages),
339344
scastieConfiguration(),
340345
)

0 commit comments

Comments
 (0)