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

New Menu #424

Merged
merged 33 commits into from Feb 2, 2015
Merged

New Menu #424

merged 33 commits into from Feb 2, 2015

Conversation

jamesalley
Copy link
Contributor

This PR significantly revises Tilo Mitra's second take on Menus. I significantly reworked everything and cooked up new examples and tests. Tilo's core insight has been retained: that lower-specificity selectors via additional classnames will make customization easier.

Pros:

  • More easily customizable, with lower-specificity selectors.
  • Less default CSS properties in place– the menus are more bare-bones, so there's less to override. You're more likely to add on top instead of overriding with the new Menu.
  • More responsive, with the inclusion of horizontal responsive menus. This feature has been removed from the version currently in development. It was not accessible and was rather opinionated and clunky. Sorry, but I had to jettison the concept. However, I added new responsive menu examples to the Layouts page.
  • New: CSS-only dropdowns/submenus. We recommend augmenting your menus with JavaScript for accessibility and keyboard navigation, but adding pure-menu-allow-hover class will enable menus which reveal on hover, which is sometimes desirable and a nice way to handle the no-JS case.
  • New: Menu is now more modular, broken up into files for core, horizontal, dropdowns, scrollable, and skin; you can get hyper-efficient by creating a rollup of just what you need. The menus.css rollup is still very small, though.
  • New: scrollable menus. Adding a pure-menu-scrollable class to make your menu scrollable and flickable when there isn't enough room to display the whole thing.
  • Any old Y.Menu cruft has been removed.

Cons:

  • Not backwards compatible with Pure 0.5. You'll need to add additional classnames such as .pure-menu-item and .pure-menu-link into your markup. However, this is not difficult.

How to Upgrade:

  • Remove the pure-menu-open class. It's not used anymore.
  • Add pure-menu-list to your menu's <ul>.
  • Add pure-menu-item to any <li>.
  • Add pure-menu-link to any <a>.
  • Refactor your customizations. Many old customizations (e.g. .pure-menu > li > a { ... }) may still work, since the overall markup structure has not changed. Consider adding pure-menu-custom-foo classes and writing your customizations on top of them instead of modifying Pure's classes.
  • You'll probably need to tweak pure-menu-item and pure-menu-link padding to suit your design.

tilomitra and others added 15 commits July 19, 2013 13:28
This commit makes .pure-menu smaller, more responsive, and easier to customize.

- Remove `.pure-menu-open`
- Remove dropdown menu CSS
- Add `.pure-menu-responsive` and `.pure-menu-toggle` to
  make responsive horizontal menus.
- Make pure menus *really* easy to customize
- Removed menus-paginator, I don't think it's very useful
- Added CSS-only dropdowns
- Mobile-first
- Easier to style, with new classnames
- Responsive Menus supported
Conflicts:
	src/menus/css/menus-core.css
	src/menus/tests/manual/menus.html
…l rule ensures the caret :after for a dropdown menu does not affect the sizing of its parent box, which was causing bad vertical alignment of links in the horizontal menu.
@yahoocla
Copy link

CLA is valid!

… in a scrollable concept. Everything has been designed to work well with the new JS I've written which adds in better accessibility. More to come though.
jamesalley added a commit that referenced this pull request Feb 2, 2015
@jamesalley jamesalley merged commit 325a3b7 into pure-css:master Feb 2, 2015
@jamesalley jamesalley deleted the new-menu branch February 2, 2015 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants