From 27261307d301003491bc4e23c58161cf8f382db3 Mon Sep 17 00:00:00 2001 From: Tessa Kelly Date: Fri, 3 Dec 2021 12:10:49 -0800 Subject: [PATCH] Fix mobile styles --- styleguide-app/Main.elm | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/styleguide-app/Main.elm b/styleguide-app/Main.elm index e1575bfd..beff8a60 100644 --- a/styleguide-app/Main.elm +++ b/styleguide-app/Main.elm @@ -233,16 +233,26 @@ viewPreviews containerId examples = navigation : Route -> Html Msg navigation currentRoute = let - toNavLinkConfig : Category -> SideNav.Entry Route Msg - toNavLinkConfig category = - SideNav.entry (Category.forDisplay category) - [ SideNav.href (Routes.Category category) + toNavLinkConfig : String -> Route -> SideNav.Entry Route Msg + toNavLinkConfig name route = + SideNav.entry name + [ SideNav.href route + , SideNav.css + [ withMedia [ mobile ] + [ Css.marginBottom Css.zero + ] + ] ] navLinks : List (SideNav.Entry Route Msg) navLinks = - SideNav.entry "All" [ SideNav.href Routes.All ] - :: List.map toNavLinkConfig Category.all + toNavLinkConfig "All" Routes.All + :: List.map + (\category -> + toNavLinkConfig (Category.forDisplay category) + (Routes.Category category) + ) + Category.all in SideNav.view { userPremiumLevel = PremiumLevel.Free @@ -254,6 +264,10 @@ navigation currentRoute = [ VendorPrefixed.value "position" "sticky" , top (px 55) ] + , withMedia [ mobile ] + [ Css.padding Css.zero + , Css.margin Css.zero + ] ] } navLinks