From a3230509581e4715e59906b2266fc3205b639f11 Mon Sep 17 00:00:00 2001 From: "Mario N. Nikolov" Date: Sat, 2 May 2026 16:26:29 +0300 Subject: [PATCH] Display search on mobile (#286) --- src/index.css | 23 +++++++++++++++++++---- src/menu/top_bar.tsx | 17 ++++++++++++----- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/index.css b/src/index.css index 6e2a544..8ba8595 100644 --- a/src/index.css +++ b/src/index.css @@ -178,10 +178,6 @@ div.zoom { text-transform: uppercase; } -.ui.sub.header, .ui.list { - margin-left: 20px; -} - .limit-height { height: 300px; overflow-y: scroll; @@ -339,6 +335,14 @@ div.zoom { white-space: pre; } +@media (max-width: 450px) { + /* Hide the title from the top bar when the viewport is too small to display + it alongside the search box. */ + .topbar--title { + display: none; + } +} + @media (max-width: 767px) { #sidebar { background-color: #fff; @@ -385,4 +389,15 @@ div.zoom { #content #sidebar.very.thin ~ .pusher { width: 100%; } + + /* Push the search box to the right on small screens. */ + .ui.search { + margin-left: auto; + margin-right: 1em; + } + + .ui.search>.results { + left: initial; + right: 0; + } } \ No newline at end of file diff --git a/src/menu/top_bar.tsx b/src/menu/top_bar.tsx index a271858..e228a8e 100644 --- a/src/menu/top_bar.tsx +++ b/src/menu/top_bar.tsx @@ -224,10 +224,10 @@ export function TopBar(props: Props) { } switch (screenSize) { - case ScreenSize.LARGE: { + case ScreenSize.LARGE: // Show dropdown if chart is shown, otherwise show individual menu // items. - const menus = props.showingChart ? ( + return props.showingChart ? ( @@ -250,8 +250,6 @@ export function TopBar(props: Props) { ); - return menus; - } case ScreenSize.SMALL: return ( @@ -311,7 +309,16 @@ export function TopBar(props: Props) { - {props.standalone ? {title()} : title()} +
+ {props.standalone ? {title()} : title()} +
+ {props.showingChart && ( + + )} ); }