canonical / design-vanilla-framework

Design components for Vanilla Framework.
https://vanillaframework.io
GNU General Public License v3.0
62 stars 11 forks source link

Design menu button #410

Closed kwm14 closed 5 years ago

kwm14 commented 5 years ago

Implemented in MAAS

screenshot_5 screenshot_6

kwm14 commented 5 years ago

Notes to mention

Recent updates regarding icons in the framework.

kwm14 commented 5 years ago

Dropdown menu

When designing we must reuse and keep existing styling from other components, so we're re-creating something new if not needed.

We now include the ability to add p-contextual-menu to buttons as well as links.

Screenshot 2019-07-16 at 14 21 27

Sub-navigation was a new addition which also features a toggle menu to open and close, which inherits consistent style except for hover which is coupled with navigation.

Screenshot 2019-07-16 at 14 24 46
kwm14 commented 5 years ago

Initial design

First exploration using existing Vanilla styles and MAAS implementation.

001

002-dropdown-button

matthewpaulthomas commented 5 years ago

We made a conscious a decision to move icons to the left that are used in other components

  • New addition p-button has-icon which features the icon on the left.

That’s good. However, a menubutton’s triangle/chevron symbol is not an “icon” in this sense. Consider that a menubutton might reasonably have an icon as well as the triangle/chevron symbol:

[ ➕ Add â–Ÿ ] [ Modify â–Ÿ ]

In every toolkit that I know of, any menubutton symbol is on the right, regardless of whether it also has an icon.

We now include the ability to add p-contextual-menu to buttons as well as links.

“Contextual menu” is another name for a context menu — that is, the kind of menu usually opened by right-clicking, which contains items relating to the object you clicked on. It’s a (small) barrier to understanding Vanilla that it uses the term “contextual menu” to mean something different. Ideally this would be deprecated over time, rather than expanding to more controls. Fortunately, the term “menubutton” is already commonly used for a button that opens a menu when clicked. Perhaps it can be used for the class name here instead?

kwm14 commented 5 years ago

Thanks for your feedback @matthewpaulthomas 👍

That’s good. However, a menubutton’s triangle/chevron symbol is not an “icon” in this sense. Consider that a menubutton might reasonably have an icon as well as the triangle/chevron symbol:

It's an icon in Vanilla which is why referenced it, but like you say it doesn't and may not always be that icon/chevron. I will update the design and move the icon to the right 😃

Fortunately, the term “menubutton” is already commonly used for a button that opens a menu when clicked. Perhaps it can be used for the class name here instead?

Happy to update the name of the newly proposed component from dropdown-button to your suggestion menubutton, as it's commonly used 👍

kwm14 commented 5 years ago

Updated design

Taking feedback into consideration. Ready for re-review @matthewpaulthomas @spencerbygraves 👍

002

003-menu-button

spencerbygraves commented 5 years ago

@kwm14 thanks, visual looks good.

matthewpaulthomas commented 5 years ago

It's an icon in Vanilla

Well, now the chevrons are in their usual place 👍 
 But now the + icon has gone to the wrong side. 👎 You were correct to put the icon on the left.

To solve this I think we need to make a distinction between an icon, a custom thing that represents the meaning of an individual control, and a behaviour symbol that conveys how you interact with this type of control. (You might be able to think of a better name than “behaviour symbol”!)

These four images are currently treated by Vanilla as “icons”, but are really behaviour symbols. You can tell this because it’s common for a control that has one of these symbols to also have an icon:

kwm14 commented 5 years ago

But now the + icon has gone to the wrong side. 👎 You were correct to put the icon on the left.

Ah yes, good spot. Will update 👍

To solve this I think we need to make a distinction between an icon, a custom thing that represents the meaning of an individual control, and a behaviour symbol that conveys how you interact with this type of control. (You might be able to think of a better name than “behaviour symbol”!)

Interesting, you make a valid point 😄 to help us and users of the framework we could pull out “behaviour symbols” into a new section under icons. Similarly to how Salesforce do for their icon library. That way we know which icons are to be used for controls/behaviour/actions icons for particular components in the framework 👍

I'll create an issue to update our icon list and we can work together on the page 😃

kwm14 commented 5 years ago

Updated icon position to the left 👍 @matthewpaulthomas

004

004-menu-button

kwm14 commented 5 years ago

Created an Epic to relook at our Icon library and categorize properly 😃

matthewpaulthomas commented 5 years ago

It’s unusual for a menubutton’s triangle/chevron to flip when the menu is open, but I guess that’s a matter of taste. Good work otherwise.

kwm14 commented 5 years ago

Thanks. Next steps to create an MD design spec for build 👍