Skip to content

Commit

Permalink
GH-101: New mobile portal and nav menu design
Browse files Browse the repository at this point in the history
Known Issues:
1. On CMS & Docs, `s-header__menu-backdrop` adds gap in navigation bar.
2. On CMS, mobile navbar opens and closes too slow.
3. login link is a bit too wide
  • Loading branch information
wesleyboar committed Sep 9, 2021
1 parent 3a5c088 commit 73ddd2e
Show file tree
Hide file tree
Showing 7 changed files with 493 additions and 244 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
Navbar (Bootstrap)
Add to Bootstrap styles. See:
- [Bootstrap Grid](https://getbootstrap.com/docs/4.0/components/navbar/)
Styleguide Components.Bootstrap.Navbar
*/

/* To support collapsing navbar horizontally */
/* SEE: https://stackoverflow.com/a/50064701/11817077 */
.collapsing.width {
transition-property: width, visibility;
width: 0;
height: auto;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,22 @@ Styleguide Trumps.ForOtherSites.Portal
*/
@import url("_imports/tools/selectors.css");



/* Selectors */

/* HACK: Relying on definition from `s-header.css` */
/* @custom-selector :--portal-button */



/* Ammend `s-header.css` (for Header because of Body) */

@media (--nav-compressed) {

/* To position navbar menus/buttons based on window width not parent width */
/* FAQ: Portal at body min. width places menu buttons outside narrow screen */
/* NOTE: If Portal had no horz. body scroll, then we would not need this */
:--for-portal .s-header :--navbar-toggle {
position: absolute; /* assumes Bootstrap `.navbar { position: relative }` */
width: env(--header-navbar-toggle-width);
Expand All @@ -30,15 +40,10 @@ Styleguide Trumps.ForOtherSites.Portal
- env(--header-navbar-toggle-width--portal-user)
); /* FAQ: = window width – its own width (not others, cuz it's the last) */
}
:--for-portal .s-header .navbar-collapse {
width: calc(
100vw
- env(--header-navbar-mobile-menu-offset)
); /* FAQ: = window width – offset from window */
}

/* WARNING: Only Portal may use this cuz only its markup knows login state */
:--for-portal .s-header.is-portal-user :--portal-nav-link {
/* To prevent negligible width change from browser dynamic calculation */
/* CAVEAT: Only Portal may use this cuz only its markup knows login state */
:--for-portal .s-header.is-portal-user :--portal-button {
width: env(--header-navbar-toggle-width--portal-user);
}

Expand Down
Loading

0 comments on commit 73ddd2e

Please sign in to comment.