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

Reorganize and refactor Navigation #273

Closed
gregrickaby opened this issue May 26, 2017 · 3 comments · Fixed by #335
Closed

Reorganize and refactor Navigation #273

gregrickaby opened this issue May 26, 2017 · 3 comments · Fixed by #335
Assignees

Comments

@gregrickaby
Copy link
Contributor

As discussed internally, we're going to break navigation components (mobile, desktop, etc...) out into separate partials.

@gregrickaby gregrickaby added this to the Utilities Clean Up milestone May 26, 2017
@gregrickaby gregrickaby self-assigned this May 26, 2017
@carrieforde carrieforde self-assigned this Jun 29, 2017
@gregrickaby
Copy link
Contributor Author

Just a follow up... I refactored this on a recent project and would love to demo it. Maybe bring it into wd_s!

@jomurgel
Copy link
Contributor

jomurgel commented Oct 3, 2017

Branch: https://github.com/WebDevStudios/wd_s/compare/theme/navigation-refactor

I've made several changes in this branch.

  • Removed the _mobile-navigation.scss partial which appeared to be a carry-over from the older mobile-navigataion setup.
  • Created a navigation folder inside modules and moved navigation partials in there.
  • Consolodated navigation into global (contains .menu), main, mobile (contains off-canvas) and post-navigation.
  • Moved the post-navigation styles out of _navigation.scss into its own partial in modules > navigation.
  • Moved the global link styles into it's own _links.scss partial because it's independent from any navigation (presumably) and added a transition helper.
  • Removed the hamburger menu styles from _icons.scss both because it doesn't really belong in there and to consolidate all navigation styles into the new menus folder.
  • Added support for multiple nested levels in the mobile-menu.js
  • Added styles to rotate dropdown arrow at each level.
  • Adds script to prevent body from scrolling when off-canvas navigation is open.
  • Moved some of the basic container styles for the main navigation into the _header.scss partial to consolidate all of the structural elements.
  • Fixed some positioning problems with the mobile hamburger on mobile if the admin bar was present.
  • Reworked the transitions on the hamburger button to make them a little less choppy using transforms rather than absolute positioning. Tested working still in IE11, Edge, Safari, Chrome, Firefox and Opera 😁

Before
kapture 2017-10-03 at 8 16 47

After
kapture 2017-10-03 at 9 58 56

  • Decreased the max transition duration from 0.8s to 0.5s in the transitions helper partial. Adds transition for hamburger specifically.
  • Reworked the header/nav area on desktop to fix some basic render issues.

Before
screenshot 2017-10-03 09 16 52

After
screenshot 2017-10-03 11 53 16

  • Removed as much fat, or consolidated as much as I could to clean things up a bit.
  • Added table of contents to _mobile-navigation.scss partial for ease of use.

Opened issue #334 to potentially discuss moving related styles together as I did here. Keeping nav-only buttons in with navigation vs with buttons.

Opened issue #333 to potentially discuss reworking navigation to target and add classes to each submenu level individually rather than adding a global is-visible class.

@gregrickaby
Copy link
Contributor Author

@jomurgel This looks fantastic and is exactly what I had in mind. 🥇

Go ahead and open a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants