mediawiki-skins-Vector/stories
jdlrobson 9f1a1fa829 Simplify menu code
SkinMustache in core provides most of what is required for Vector to
generate its menus.  In the interest of having a canonical source of
truth for menus across all skins, Vector should use this data.

To ensure the HTML generated is (mostly) the same after this patch to
prior, a few modifications are necessary:

* The data from core is decorated so that Vector can continue having its
  own custom class names on menus. This is done using the
  decoratePortletClass method.
* There is no support for a menu having a header representing the
  selected menu item, as is currently the case with variants. This is
  achieved via an extension to getPortletData. It's assumed that later
  when variants are merged with languages, this can be removed.
* Menus are agnostic to how they are displayed, so we must continue to
  add the is-dropdown template variable to drop down menus. In future we
  may want to rethink our Menu partial to make this unnecessary in PHP.
* The portal-first class is redundant in the modern Vector as we can
  use the first-child selector. Previously we introduced a class to
  service the legacy skin where this rule doesn't apply as #p-logo is
  the first child.  However, the legacy skin can do this using a special
  next sibling selector instead.

Bug: T268157
Change-Id: I5f7adc1840441b508ffee40139b85b64021789e6
2021-01-04 19:02:34 +00:00
..
.eslintrc.json build: Update devDependencies 2020-07-01 14:43:39 -07:00
Footer.stories.data.js Fix storybook instance display of footer and personal menu 2020-10-08 16:08:43 -07:00
Footer.stories.js Fix storybook instance display of footer and personal menu 2020-10-08 16:08:43 -07:00
legacy.stories.js Naming convention using 'skin' as entrance point 2020-05-28 20:58:01 -07:00
Logo.stories.data.js [Storybook] Fix PNG/SVG asset resolution. 2020-09-25 12:52:05 +02:00
Logo.stories.js [modern] A new version of Vector with a new logo 2020-04-30 14:11:54 -07:00
Menu.stories.data.js Fix storybook instance display of footer and personal menu 2020-10-08 16:08:43 -07:00
Menu.stories.js Refactor: Generalise personal menu 2020-05-05 17:34:44 -07:00
MenuDropdown.stories.data.js Drop unsupported skin CSS classes 2020-10-01 19:50:24 +00:00
MenuDropdown.stories.js Refactor: VectorMenu merged in to Menu 2020-05-06 16:09:22 -07:00
MenuPortal.stories.data.js Simplify menu code 2021-01-04 19:02:34 +00:00
MenuPortal.stories.js Refactor: Portal is also a Menu 2020-05-07 16:56:59 -07:00
MenuTabs.stories.data.js Drop unsupported skin CSS classes 2020-10-01 19:50:24 +00:00
MenuTabs.stories.js Organize CSS by common, layout, typography and components 2020-05-07 22:57:13 +00:00
rawLoader.d.ts [Storybook] Fix PNG/SVG asset resolution. 2020-09-25 12:52:05 +02:00
SearchBox.stories.data.js Refactor: html-userlangattributes -> html-user-language-attributes 2020-07-15 10:18:45 -07:00
SearchBox.stories.js Rename Storybook Files to Reflect Their Respective Component 2020-03-03 18:32:55 +00:00
Sidebar.stories.data.js Simplify menu code 2021-01-04 19:02:34 +00:00
Sidebar.stories.js Separate languages portal from other portals in sidebar 2020-06-22 15:28:02 -07:00
skin.stories.data.js Simplify menu code 2021-01-04 19:02:34 +00:00
types.js Simplify menu code 2021-01-04 19:02:34 +00:00
utils.js Refactor: html-userlangattributes -> html-user-language-attributes 2020-07-15 10:18:45 -07:00