Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-101: Navigation Bar (Sans Search & Portal Nav Button) #225

Conversation

wesleyboar
Copy link
Member

@wesleyboar wesleyboar commented May 17, 2021

Overview

Redesign the nav dropdowns and the CMS nav.

The search bar and portal nav button have not been redesigned yet. Their final design might change.

Issues

Changes

Summary:

  • Support custom selectors.
  • For variable freezing, support custom environment variables.
  • Install merge-lite.
  • Add arrow mixin to CSS.
  • Document the kinds of "Trumps" that are in our CSS.
  • Add stylesheet trumps/for-docs.header.css.
  • Rewrite trumps/s-header.css.
  • Add Theme "constants".
  • Fix docs header colors by loading colors in site.header.css.

Bug Fixes:

Complete List
  • New: Support custom selectors.
    • So we can scope selectors to subsite, and change in one place how we scope.
  • New: For variable freezing, support custom environment variables.
  • New: Install merge-lite to support deep merge of objects.
  • Minor: Add test case for custom environment variables.
  • Minor: Move header-specific branding styles from branding component to header scope.
  • Minor: Use fallback values for custom properties.
  • Minor: Control logo image width and height within component styles._
  • Minor: Add comment about work involved for conversion of font size to 62.5%._
  • Minor: Deprecate "global variables" for font weight in favor of custom environment variables._
  • New: Add arrow mixin.
    • So we can create customizable arrows with CSS.
  • Docs: Describe the kinds of "Trumps" that are in our CSS.
    • Because I never documented "Scopes" and have now added "For (Other Sites)"
  • New: Add stylesheet trumps/for-docs.header.css.
    • So we can add styles to manage Docs-specific side effects of header.
  • New: Rewrite trumps/s-header.css.
    • Because this is where the bulk of the header styles are.
  • Minor Remove s-header ID (because s-header class will be used twice).
  • Minor: Remove now-useless code from trumps/s-portal-nav.css.
  • New: Add Theme "constants".
    • So we can share immutable values across themes.
  • Minor: Add new theme property --header-link-bkgd-color.
  • Fix: Load colors in site.header.css.
    • So Docs has access to the color variables used in header.
  • Fix: Do not support CMS menu nav link + dropdown (Do Not Support CMS Menu Dropdown Nav Link #129).
    • Because supporting it retains complexity in markup and styles.
  • Minor: Improve responsiveness of mobile nav (because now-smaller nav text allows this).
  • Minor: Update taccsite_custom:frontera-cms based on these Core changes.

¹ I expect to completely replace freeze_variables feature with env() in whichever GH-101 PR updates the search bar.

Testing

Simple UI Testing

Light/Dark Navbar

Prerequisite: CMS menu has dropdowns (by having nested links set to display in menu).

  1. Build CSS with CMS setting/secret _THEME set to None.
  2. Confirm dropdown styles match CMS-Common Components > Navigation Light-mode.
  3. Build CSS with CMS setting/secret _THEME set to 'has-dark-logo'.
  4. Confirm dropdown styles match CMS-Common Components > Navigation Dark-mode.
Responsiveness

Prerequisite: These steps assume you are testing on a CMS with an attached Portal. Without a Portal, see "Detailed UI Testing" at "Responsiveness".

Known Issue: For Portal and Docs, responsiveness will not have changed unless testing on their branch task/GH-101-header-redesign.

While resizing width of window:

  • Search field may shrink (but it must always have a border all the way around).
  • Space between CMS Nav items may grow or shrink.
  • Space between Nav Bar and edge of screen must not shrink.
  • Given Frontera nav link count and text:
    • CMS Nav items must not wrap.
    • CMS Nav items text must not be cut off.
    • CMS Nav items text may be truncated with an ellipses.
  • Logo must not shrink.
  • Portal nav link (not logged in) must not shrink.
  • Portal menu toggle (logged in) must not shrink.
  • Search button should not shrink, furthermore:
    • Search button text must not wrap.
    • Search button text should not be cut off.
    • Search button text may be truncated with an ellipses.

Detailed UI Testing

Hide/Show Sections

Responsiveness

CMS (with Portal)

Known Issue:
For Portal and Docs, these steps will differ on Portal/Docs without their branch task/GH-101-header-redesign.

Expected Difference
  1. Load site with page wider than 1200px.
  2. Resize page to narrower than 1200px.
  3. Confirm mobile nav is triggered.
  1. Load site with page wider than 1200px.
  2. Note distance between CMS nav links.
  3. Resize page to narrower than 1200px.
  4. Confirm distance between CMS nav links is shorter.
  5. Resize page to narrower than 992px.
  6. Confirm mobile nav is triggered.
CMS (stand-alone)
  1. Load site with page wider than 992px.
  2. Note distance between CMS nav links.
  3. Resize page to narrower than 992px.
  4. Confirm distance between CMS nav links is shorter.
  5. Resize page to narrower than 768px.
  6. Confirm mobile nav is triggered.

Logo & CMS Nav Alignment

CMS (with Portal)
  • The CMS Nav is aligned to the left.
  • The Nav Bar's left and right padding is equal. When comparing, be aware:
    • Portal Nav link has internal padding that is not part of Nav Bar's right padding.
    • Logo image may have internal space that is not part of Nav Bar's left padding.
    • Portal Nav link design is not complete in this PR.
  • The Logo image's left side is aligned with Portal sidebar text's left side.
  • The CMS Nav first link text's left side is aligned with Portal section header text's left side.
CMS (stand-alone)
  • The CMS Nav is aligned to the right.
  • The Nav Bar's left and right padding is equal. When comparing, be aware:
    • CMS Nav link has internal padding that is not part of Nav Bar's right padding.
    • Logo image may have internal space that is not part of Nav Bar's left padding.
  • The Logo image's left side is aligned with Portal sidebar text's left side.
  • The CMS Nav first link text's left side is aligned with Portal section header text's left side.

Light/Dark Navbar

Perform "Simple UI Testing" at "Light/Dark Navbar", but review items on the checklist for each theme.

Checklist
  • navbar height
  • logo dimension & spacing:
    • logo height
    • vertical space between logo and top and bottom of navbar¹
  • top-level nav link states:
    • (default)
    • :hover
    • :focus
    • .active (on page)²
    • :active (mid-click)²
  • dropdown menu border
  • dropdown menu toggle states:
    • menu closed
    • menu opened
  • dropdown menu link states:
    • (default)
    • :hover
    • :focus
    • .active (on page)²
    • :active (mid-click)²
  • portal nav
    • link when not logged in
    • menu toggle when logged in

¹ The logo image may have its own internal space (annotated screenshot, example logo file).

² Not explicit in design, but should match :hover state.

- Remove now-moot taccsite_custom:frontera-cms search bar font sizes.
- Support CSS custom selectors (known external bug).
- Test CSS custom selectors (known external bug).
- Remove outdated comment from `c-branding`.
- Set `c-logo` image height in component stylesheet.
- Add TODO for `html { font-size: 62.5%; }`
- Add arrow "mixin" (note: using `%-arrow` syntax).
- Redesign header (but not dropdowns and not portal nav).
- Remove now-moot `s-portal-nav` styles.
- Add & Update header env variables for themes.
- Perform "GH-129: Do Not Support CMS Menu Nav Link & Dropdown".
Prevent dropdown link from being flagged as active.
- (Real Fix) Ensure colors are available to Docs.
- (Possible Fix) Ensure correct colors are available to Portal.\*

\* The Portal has its own settings/color.css that is almost identical.
- Load new styles solely for docs header.
- Force branding styles on old markup.
- Migrate subsite selectors from `trumps/s-header` to `tools/selectors`.
- Rename `:--in-__subsite__` selectors to `:--from-__subsite__`.
- Create new styles solely for docs header.
- Document "For (Other Sites)" i.e. `trumps/for-docs.*.css` stylesheets.
Unset Docs' `img { max-width; }`. Docs does this too but for old markup.
- Install `merge-lite` for deep merge constants and theme data.
- Use env() vars for header height.
- Remove unnecessary code and improve comments.
- Create constants for theme JSON.
- Merge constants on top of theme data.
- Update theme data comment syntax.
- Add frontera-cms logo width overwrite (temp. ineffectual, see GH-223).
- Prevent Core (but not a project) from stretching logo too wide.
- Align CMS nav for narrow logos. Allow project-specific adaptation.
- Remove redundant color assignment for nav-link.
- Add font weight constants.
- Add border constants.
- Style dropdowns and use new constants.
Use correct global var not wrong env var for branding bar bkgd.
Scope dropdown styles to header so as to not effect any other dropdowns.
1. Scope header-specific `.c-branding` styles with `.s-header`.
2. Clarify which `s-header` is being styled and why.
3. Remove `s-header` ID from sample header markup.
4. Add `s-header` class to `header-branding`.
5. Replace `s-header` ID with `header-navbar` ID.
Portal needs to overwrite Bootstrap's color for active `dropdown-item`.
Instead of defining a value to be overwritten, set a fallback.

This reduces one level of overwrite when tracking/debugging values.
@wesleyboar wesleyboar changed the title GH-101: Navigation Bar (Partially Complete) GH-101: Navigation Bar (Sans Search & Portal Nav Button) May 18, 2021
Ensure Portal & Docs line-height (in header) matches CMS.
- The responsive space between nav items now considers portal elements.
- Whether header is loaded on portal is noted by presence of a class.
@wesleyboar wesleyboar force-pushed the task/GH-101-header-redesign--navigation-bar branch from 4f49fef to 315ac1d Compare May 18, 2021 03:30
@wesleyboar wesleyboar marked this pull request as ready for review May 18, 2021 17:11
@wesleyboar wesleyboar merged commit 9012318 into task/GH-101-header-redesign May 18, 2021
@wesleyboar wesleyboar deleted the task/GH-101-header-redesign--navigation-bar branch May 18, 2021 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant