@@ -411,26 +411,63 @@ abstract class Layout(config: MicrositeSettings) {
411411 )
412412 }
413413
414+ def searchBar: Option[TypedTag[String]] = {
415+ val classes =
416+ if (config.visualSettings.theme == "pattern") "search-nav hidden-xs"
417+ else "search-nav"
418+
419+ if (config.searchSettings.searchEnabled) {
420+ Some(
421+ li(
422+ cls := classes,
423+ div(
424+ id := "search-dropdown",
425+ label(
426+ i(cls := "fa fa-search"),
427+ "Search"
428+ ),
429+ input(
430+ id := "search-bar",
431+ `type` := "text",
432+ placeholder := "Enter keywords here...",
433+ onclick := "displayToggleSearch(event)"
434+ ),
435+ ul(
436+ id := "search-dropdown-content",
437+ cls := "dropdown dropdown-content"
438+ )
439+ )
440+ )
441+ )
442+ } else Option.empty
443+ }
444+
414445 def buildCollapseMenu: TypedTag[String] =
415446 nav(
416447 cls := "text-right",
417448 ul(
418449 cls := "",
450+ searchBar,
419451 li(
420452 a(
453+ cls := "transparent-on-hover",
421454 href := config.gitSiteUrl,
422455 i(cls := s"fa ${config.gitHostingIconClass}"),
423456 target := "_blank",
424457 rel := "noopener noreferrer",
425- span(cls := "hidden-xs", config.gitSettings.gitHostingService.name)
458+ span(cls := "hidden-sm hidden- xs", config.gitSettings.gitHostingService.name)
426459 )
427460 ),
428461 if (!config.urlSettings.micrositeDocumentationUrl.isEmpty)
429462 li(
430463 a(
464+ cls := "transparent-on-hover",
431465 href := s"${config.urlSettings.micrositeDocumentationUrl}",
432466 i(cls := "fa fa-file-text"),
433- span(cls := "hidden-xs", config.urlSettings.micrositeDocumentationLabelDescription)
467+ span(
468+ cls := "hidden-sm hidden-xs",
469+ config.urlSettings.micrositeDocumentationLabelDescription
470+ )
434471 )
435472 )
436473 else ()
@@ -439,28 +476,7 @@ abstract class Layout(config: MicrositeSettings) {
439476
440477 def buildLightCollapseMenu: TypedTag[String] =
441478 ul(
442- "{% if site.search_enabled %}",
443- li(
444- cls := "search-nav",
445- div(
446- id := "search-dropdown",
447- label(
448- i(cls := "fa fa-search"),
449- "Search"
450- ),
451- input(
452- id := "search-bar",
453- `type` := "text",
454- placeholder := "Enter keywords here...",
455- onclick := "displayToggleSearch(event)"
456- ),
457- ul(
458- id := "search-dropdown-content",
459- cls := "dropdown dropdown-content"
460- )
461- )
462- ),
463- "{% endif %}",
479+ searchBar,
464480 "{% if site.data.versions %}",
465481 raw("""{% assign own_version = site.data.versions | where: "own", true | first %}"""),
466482 li(
0 commit comments