Fix mobile styles

This commit is contained in:
Tessa Kelly 2021-12-03 12:10:49 -08:00
parent 66245759b1
commit 27261307d3

View File

@ -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