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

Menu Seperator #46

Closed
mikemccamon opened this issue Aug 21, 2019 · 8 comments
Closed

Menu Seperator #46

mikemccamon opened this issue Aug 21, 2019 · 8 comments

Comments

@mikemccamon
Copy link

It would be awesome if we had a way to add a menu separator to menus. In other systems I've used if the name of the submenu is "-" (just a dash) it treats the item as a vertical line. Again on https://www2.owasp.org/ ....

On the PROJECTS menu it's natural to have a menu separator between the last cheat sheet and "Browse all projects...". Same on CHAPTERS where we would have one after "Find a local chapter" and "Start a local Chapter". Both of those items belong in that menu but have different user context than other items. Having a "-" would give us flexibility to add it anywhere - but alas those are the most only likely place.

@scorchingoyster
Copy link
Owner

Sure, I agree with the rationale. Let me try something and get back to you.

@scorchingoyster
Copy link
Owner

scorchingoyster commented Aug 22, 2019

Harold can handle this by adding the - as a list item anywhere that's necessary, since all the items in the submenu is wrapped in a list, so adding that between the items that need to be separated will just work out as is.

@mikemccamon
Copy link
Author

Not sure I was lookning at picture correctly but menu separator should be a thin line across the entire blue "drop down" space. We would just use "-" in the menu name/title to denote the treatment.

@scorchingoyster
Copy link
Owner

scorchingoyster commented Aug 23, 2019

How about this? Instead of adding a dash item in HTML, I just added a conditional class that adds a top border which also works as a divider.

There are a two benefits: it won't create a new child list item, which will cause it to interact with mouse hover, and it just leverages plain CSS. Since the submenu won't change frequently regardless, that won't be a big issue.

Also this is the adjusted vertical spacing version for #45; using my old repo because there's no easy to replicate the live setup.

firefox_iAuwS4XaCi

@mikemccamon
Copy link
Author

I really like it a lot! Harold would this work with how we create menus? Hong, FYI right now I just edit a json file and Harold's code stuffs everything into the right html objects.

@mikemccamon
Copy link
Author

BTW a slick hack. (in a good way)

@scorchingoyster
Copy link
Owner

scorchingoyster commented Aug 23, 2019

I looked into the source file for processing the menu and it seems that it should be fairly straightforward to implement (by adding an optional class entry and produces whatever corresponding html class specified in the json file).

It should be live by the way; in the hong-mods branch of the theme repo.

@mikemccamon
Copy link
Author

Sweet!

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

No branches or pull requests

2 participants